
SE59XX-SDK
Software development Kit
User Manual
Data Structure
Documentation
-1 : ERROR – Cannot open file, or get PSK error
0 : Successful
Example code
:
157 {
158 char *str;
159
160 // read key from ini
161 dictionary *ini = iniparser_load(ini_file_name);
162 if (ini==NULL) {
163 fprintf(stderr, "Cannot open %s\n",ini_file_name);
164 return -1;
165 }
166
167 // read psk from ini
168 str = iniparser_getstring(ini, "network:PSK", NULL);
169
170 // malloc a space and copy psk to it
171 if ( str!=NULL )
172 *psk = strdup(str);
173 else {
174 printf("Get PSK error!\n");
175 iniparser_freedict(ini);
176 return -1;
177 }
178
179 // free dictionary space
180 iniparser_freedict(ini);
181 return 0;
182 }
7.13.5
int get_ssid (char
ssid
)
API
: get_ssid
Arguments
: ssid : buffer for reading SSID (string)
Function
: reads SSID from ini file.
Returns
: Error code (int)
-1 : ERROR: Cannot open file or function error
0 : Successful
Example code
:
27 {
28 char *str;
29
30 // read key from ini
31 dictionary *ini = iniparser_load(ini_file_name);
32 if (ini==NULL) {
33 fprintf(stderr, "Cannot open %s\n",ini_file_name);
34 return -1;
35 }
36
37 // read ssid from ini
38 str = iniparser_getstring(ini, "network:SSID", NULL);
39
40 // malloc a space and copy ssid to it
41 if ( str!=NULL )
42 *ssid = strdup(str);
43 else {
44 printf("Get ssid error!\n");
45 iniparser_freedict(ini);
46 return -1;
47 }
48
49 // free dictionary space
50 iniparser_freedict(ini);
51 return 0;
52 }
Содержание SE59XX-SDK
Страница 11: ...SE59XX SDK Software development Kit User Manual V1 2...
Страница 13: ...SE59XX SDK Software development Kit User Manual V1 2 libatop so 1 0 0 ATOP library binary...
Страница 17: ...SE59XX SDK Software development Kit User Manual V1 2 Figure 2 5 SE5904DB o ot loadermenu...
Страница 33: ...SE59XX SDK Software development Kit User Manual V1 2...
Страница 35: ...SE59XX SDK Software development Kit User Manual V1 2 SE5901B SE5908 16...
Страница 36: ...SE59XX SDK Software development Kit User Manual V1 2 SE5908A 16A...
Страница 37: ...SE59XX SDK Software development Kit User Manual V1 2...
Страница 43: ...SE59XX SDK Software development Kit User Manual V1 2 5 SG Signal Ground SG Signal Ground SG Signal Ground...
Страница 52: ...SE59XX SDK Software development Kit User Manual V1 2...