
SE59XX-SDK
Software development Kit
User Manual
Data Structure
Documentation
7.13.6
int parse_setting (void)
API
: parse_setting
Arguments
: nothing (void)
Function
: resets Wi-Fi connection settings (via USB-dongle)
Returns
: nothing (void)
Example code
:
226 {
227 char *ssid,*psk,*key_mgmt;
228
229 // read key from ini
230 dictionary *ini = iniparser_load(ini_file_name);
231 if (ini==NULL) {
232 fprintf(stderr, "Cannot open %s\n",ini_file_name);
233 return -1;
234 }
235
236 // read ssid.psk.key_mgmt from ini
237 ssid = iniparser_getstring(ini, "network:SSID", NULL);
238 psk = iniparser_getstring(ini, "network:PSK", NULL);
239 key_mgmt = iniparser_getstring(ini, "network:key_mgmt", NULL);
240
241 // parse ini into config format
242 FILE *fout ;
243 fout = fopen(parse_conf_name, "w");
244 fprintf(fout,"network={\n");
245 fprintf(fout,"\tscan_ssid=1\n");
246 if (ssid != NULL) fprintf(fout,"\tssid=\"%s\"\n", ssid);
247 if ((psk != NULL) && (strcmp(key_mgmt,"None") != 0)) fprintf(fout,"\tpsk=\"%s\"\n", psk);
248 if (key_mgmt != NULL) fprintf(fout,"\tkey_mgmt=%s\n}\n", key_mgmt);
249 fclose(fout);
250 iniparser_freedict(ini);
251 return 0;
252 }
7.13.7
void run_connection (void)
API
: run_connection
Arguments
: nothing (void)
Function
: initiate a Wi-FI connection through the USB Wi-Fi dongle. It runs authentication via wpa_supplication.
Returns
: nothing (void)
Example code
:
256 {
257 char cmd[60];
258 system("killall wpa_supplicant");
259 sprintf(cmd,"wpa_supplicant -Dnl80211 -iwlan0 -c%s &",parse_conf_name);
260 system(cmd);
7.13.8
int set_key_mgmt (int
mode
)
API
: set_key_mgmt
Arguments
: mode: - (int)
0
: Disabled
1
: WPA-PSK
2
: WPA2-PSK
Function
: sets security key management mode to INI file for Wi-Fi dongle connection
Returns
: error code (int)
-1 : Cannot open file
0 : Successful
Example code
:
Summary of Contents for SE59XX-SDK
Page 11: ...SE59XX SDK Software development Kit User Manual V1 2...
Page 13: ...SE59XX SDK Software development Kit User Manual V1 2 libatop so 1 0 0 ATOP library binary...
Page 17: ...SE59XX SDK Software development Kit User Manual V1 2 Figure 2 5 SE5904DB o ot loadermenu...
Page 33: ...SE59XX SDK Software development Kit User Manual V1 2...
Page 35: ...SE59XX SDK Software development Kit User Manual V1 2 SE5901B SE5908 16...
Page 36: ...SE59XX SDK Software development Kit User Manual V1 2 SE5908A 16A...
Page 37: ...SE59XX SDK Software development Kit User Manual V1 2...
Page 52: ...SE59XX SDK Software development Kit User Manual V1 2...