Changeset 8565a42 in mainline for uspace/app/wifi_supplicant


Ignore:
Timestamp:
2018-03-02T20:34:50Z (8 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/wifi_supplicant/wifi_supplicant.c

    r3061bc1 r8565a42  
    8181            addr->address[0], addr->address[1], addr->address[2],
    8282            addr->address[3], addr->address[4], addr->address[5]);
    83        
     83
    8484        if (rc < 0)
    8585                return NULL;
    86        
     86
    8787        return str;
    8888}
     
    9696                return rc;
    9797        }
    98        
     98
    9999        rc = loc_category_get_svcs(wifi_cat, wifis, count);
    100100        if (rc != EOK) {
     
    102102                return rc;
    103103        }
    104        
     104
    105105        return EOK;
    106106}
     
    110110        service_id_t *wifis = NULL;
    111111        size_t count;
    112        
     112
    113113        errno_t rc = get_wifi_list(&wifis, &count);
    114114        if (rc != EOK) {
     
    116116                return NULL;
    117117        }
    118        
     118
    119119        if (i >= count) {
    120120                printf("Invalid wifi index.\n");
     
    122122                return NULL;
    123123        }
    124        
     124
    125125        async_sess_t *sess =
    126126            loc_service_connect(wifis[i], INTERFACE_DDF, 0);
     
    130130                return NULL;
    131131        }
    132        
     132
    133133        return sess;
    134134}
     
    138138        service_id_t *wifis = NULL;
    139139        size_t count;
    140        
     140
    141141        errno_t rc = get_wifi_list(&wifis, &count);
    142142        if (rc != EOK) {
     
    144144                return EINVAL;
    145145        }
    146        
     146
    147147        printf("[Index]: [Service Name]\n");
    148148        for (size_t i = 0; i < count; i++) {
     
    154154                        return rc;
    155155                }
    156                
     156
    157157                printf("%zu: %s\n", i, svc_name);
    158                
     158
    159159                free(svc_name);
    160160        }
    161        
     161
    162162        return EOK;
    163163}
     
    166166{
    167167        assert(ssid_start);
    168        
     168
    169169        async_sess_t *sess = get_wifi_by_index(index);
    170170        if (sess == NULL) {
     
    173173                return EINVAL;
    174174        }
    175        
     175
    176176        errno_t rc = ieee80211_disconnect(sess);
    177177        if(rc != EOK) {
     
    181181                        printf("Error when disconnecting device: %s\n",
    182182                            str_error(rc));
    183                
    184                 return rc;
    185         }
    186        
     183
     184                return rc;
     185        }
     186
    187187        rc = ieee80211_connect(sess, ssid_start, password);
    188188        if(rc != EOK) {
     
    196196                        printf("Error when connecting to network: %s\n",
    197197                            str_error(rc));
    198                
    199                 return rc;
    200         }
    201        
     198
     199                return rc;
     200        }
     201
    202202        // TODO: Wait for DHCP address?
    203        
     203
    204204        printf("Successfully connected to network!\n");
    205        
     205
    206206        return EOK;
    207207}
     
    215215                return EINVAL;
    216216        }
    217        
     217
    218218        errno_t rc = ieee80211_disconnect(sess);
    219219        if (rc != EOK) {
     
    225225                        printf("Error when disconnecting from network: %s\n",
    226226                            str_error(rc));
    227                
    228                 return rc;
    229         }
    230        
     227
     228                return rc;
     229        }
     230
    231231        printf("Successfully disconnected.\n");
    232        
     232
    233233        return EOK;
    234234}
     
    242242                return EINVAL;
    243243        }
    244        
     244
    245245        ieee80211_scan_results_t scan_results;
    246246        errno_t rc = ieee80211_get_scan_results(sess, &scan_results, now);
     
    251251                        printf("Failed to fetch scan results: %s\n",
    252252                            str_error(rc));
    253                
    254                 return rc;
    255         }
    256        
     253
     254                return rc;
     255        }
     256
    257257        if (scan_results.length == 0)
    258258                return EOK;
    259        
     259
    260260        printf("%16.16s %17s %4s %5s %5s %7s %7s\n",
    261261            "SSID", "MAC", "CHAN", "TYPE", "AUTH", "UNI-ALG", "GRP-ALG");
    262        
     262
    263263        for (uint8_t i = 0; i < scan_results.length; i++) {
    264264                ieee80211_scan_result_t result = scan_results.results[i];
    265                
     265
    266266                printf("%16.16s %17s %4d %5s %5s %7s %7s\n",
    267267                    result.ssid, nic_addr_format(&result.bssid),
     
    272272                    enum_name(ieee80211_security_alg_strs, result.security.group_alg));
    273273        }
    274        
     274
    275275        return EOK;
    276276}
     
    284284                return 1;
    285285        }
    286        
     286
    287287        rc = dhcp_init();
    288288        if (rc != EOK) {
     
    291291                return 1;
    292292        }
    293        
     293
    294294        if (argc == 2) {
    295295                if (!str_cmp(argv[1], "list"))
     
    303303                        return EINVAL;
    304304                }
    305                
     305
    306306                if (!str_cmp(argv[1], "scan")) {
    307307                        bool now = false;
     
    309309                                if (!str_cmp(argv[3], "-n"))
    310310                                        now = true;
    311                        
     311
    312312                        return wifi_scan(index, now);
    313313                } else if (!str_cmp(argv[1], "connect")) {
     
    316316                                if (argc > 4)
    317317                                        pass = argv[4];
    318                                
     318
    319319                                return wifi_connect(index, argv[3], pass);
    320320                        }
     
    322322                        return wifi_disconnect(index);
    323323        }
    324        
     324
    325325        print_syntax();
    326        
     326
    327327        return EOK;
    328328}
Note: See TracChangeset for help on using the changeset viewer.