
SE59XX-SDK
Software development Kit
User Manual
Data Structure
Documentation
7.13.2
void create_default_ini_file (void)
API
: create_default_ini_file
Arguments
: nothing (void)
Function
: creates default INI configuration file for Wi-Fi dongle settings
Returns
: nothing (void)
Example code
:
13 {
14 FILE *fout;
15 fout = fopen(ini_file_name, "w");
16 fprintf(fout,
17 "\n"
18 "[network]\n"
19 "ssid = default;\n"
20 "key_mgmt = WPA2-PSK;\n"
21 "psk = 12345678;\n");
22 fclose(fout);
23 }
7.13.3
void get_key_mgmt (char
key_mgmt
)
API
: get_key_mgmt
Arguments
: key_mgmt – buffer for the management mode read value (char)
Function
: reads Wi-Fi dongle key management mode from the INI configuration file
Returns
: Error code (int)
-1 : ERROR – Cannot open file; cannot read key management from file
0 : Successful
Example code
:
86 {
87 char *str;
88
89 // read key from ini
90 dictionary *ini = iniparser_load(ini_file_name);
91 if (ini==NULL) {
92 fprintf(stderr, "Cannot open %s\n",ini_file_name);
93 return -1;
94 }
95
96 // read key_mgmt from ini
97 str = iniparser_getstring(ini, "network:key_mgmt", NULL);
98
99 // malloc a space and copy key_mgmt to it
100 if ( str!=NULL )
101 *key_mgmt = strdup(str);
102 else {
103 printf("Get key_mgmt error!\n");
104 iniparser_freedict(ini);
105 return -1;
106 }
107
108 // free dictionary space
109 iniparser_freedict(ini);
110 return 0;
111 }
7.13.4
int get_psk(char
psk
)
API
: get_psk
Arguments
: psk : buffer for PSK (string)
Function
: Reads current passphrase (PSK) from INI file and writes it to the argument
Returns
: Error code (int)
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...