Changeset 053fc2b in mainline for uspace/app/wifi_supplicant/wifi_supplicant.c
- Timestamp:
- 2015-04-10T13:52:11Z (10 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a931b7b
- Parents:
- d7dadcb4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/wifi_supplicant/wifi_supplicant.c
rd7dadcb4 r053fc2b 36 36 #include <ieee80211_iface.h> 37 37 38 #include <inet/inetcfg.h> 39 #include <inet/dhcp.h> 38 40 #include <errno.h> 39 41 #include <stdio.h> … … 173 175 } 174 176 175 int rc = ieee80211_connect(sess, ssid_start, password); 177 int rc = ieee80211_disconnect(sess); 178 if(rc != EOK) { 179 if(rc == EREFUSED) { 180 printf("Device is not ready yet.\n"); 181 } else { 182 printf("Error when disconnecting device. " 183 "Error: %d\n", rc); 184 } 185 186 return rc; 187 } 188 189 ieee80211_connect(sess, ssid_start, password); 176 190 if(rc != EOK) { 177 191 if(rc == EREFUSED) { … … 179 193 } else if(rc == ETIMEOUT) { 180 194 printf("Timeout when authenticating to network.\n"); 181 } else if(rc == E PERM) {182 printf(" Bad password provided.\n");195 } else if(rc == ENOENT) { 196 printf("Given SSID not in scan results.\n"); 183 197 } else { 184 198 printf("Error when connecting to network. " … … 188 202 return rc; 189 203 } 204 205 // TODO: Wait for DHCP address ? 190 206 191 207 printf("Successfully connected to network!\n"); … … 274 290 int rc; 275 291 uint32_t index; 292 293 rc = inetcfg_init(); 294 if (rc != EOK) { 295 printf(NAME ": Failed connecting to inetcfg service (%d).\n", 296 rc); 297 return 1; 298 } 299 300 rc = dhcp_init(); 301 if (rc != EOK) { 302 printf(NAME ": Failed connecting to dhcp service (%d).\n", rc); 303 return 1; 304 } 276 305 277 306 if(argc == 2) {
Note:
See TracChangeset
for help on using the changeset viewer.