@@ -190,26 +190,26 @@ int CLAppConn::loadPrefs() {
190
190
return ret;
191
191
}
192
192
193
- ret = json_obj_get_string (&jctx, " mdns_name" , mdnsName, sizeof (mdnsName));
193
+ ret = json_obj_get_string (&jctx, ( char *) " mdns_name" , mdnsName, sizeof (mdnsName));
194
194
195
195
if (ret != OS_SUCCESS)
196
196
Serial.println (" MDNS Name is not defined!" );
197
197
198
198
if (ret == OS_SUCCESS) {
199
- json_obj_get_string (&jctx, " host_name" , hostName, sizeof (hostName));
200
- json_obj_get_int (&jctx, " http_port" , &httpPort);
201
- json_obj_get_bool (&jctx, " dhcp" , &dhcp);
199
+ json_obj_get_string (&jctx, ( char *) " host_name" , hostName, sizeof (hostName));
200
+ json_obj_get_int (&jctx, ( char *) " http_port" , &httpPort);
201
+ json_obj_get_bool (&jctx, ( char *) " dhcp" , &dhcp);
202
202
}
203
203
204
- if (ret == OS_SUCCESS && json_obj_get_array (&jctx, " stations" , &stationCount) == OS_SUCCESS) {
204
+ if (ret == OS_SUCCESS && json_obj_get_array (&jctx, ( char *) " stations" , &stationCount) == OS_SUCCESS) {
205
205
Serial.print (" Known external SSIDs: " );
206
206
if (stationCount>0 )
207
207
for (int i=0 ; i < stationCount && i < MAX_KNOWN_STATIONS; i++) {
208
208
209
209
if (json_arr_get_object (&jctx, i) == OS_SUCCESS) {
210
210
Station *s = (Station*) malloc (sizeof (Station));
211
- if (json_obj_get_string (&jctx, " ssid" , s->ssid , sizeof (s->ssid )) == OS_SUCCESS &&
212
- json_obj_get_string (&jctx, " pass" , s->password , sizeof (s->password )) == OS_SUCCESS) {
211
+ if (json_obj_get_string (&jctx, ( char *) " ssid" , s->ssid , sizeof (s->ssid )) == OS_SUCCESS &&
212
+ json_obj_get_string (&jctx, ( char *) " pass" , s->password , sizeof (s->password )) == OS_SUCCESS) {
213
213
Serial.printf (" %s\r\n " , s->ssid );
214
214
stationList[i] = s;
215
215
}
@@ -226,7 +226,7 @@ int CLAppConn::loadPrefs() {
226
226
}
227
227
228
228
// read static IP
229
- if (ret == OS_SUCCESS && json_obj_get_object (&jctx, " static_ip" ) == OS_SUCCESS) {
229
+ if (ret == OS_SUCCESS && json_obj_get_object (&jctx, ( char *) " static_ip" ) == OS_SUCCESS) {
230
230
readStaticIPfromJSON (&jctx, &staticIP.ip , " ip" );
231
231
readStaticIPfromJSON (&jctx, &staticIP.netmask , " netmask" );
232
232
readStaticIPfromJSON (&jctx, &staticIP.gateway , " gateway" );
@@ -235,34 +235,34 @@ int CLAppConn::loadPrefs() {
235
235
json_obj_leave_object (&jctx);
236
236
}
237
237
238
- json_obj_get_string (&jctx, " ap_ssid" , apName, sizeof (apName));
239
- json_obj_get_string (&jctx, " ap_pass" , apPass, sizeof (apPass));
240
- if (json_obj_get_int (&jctx, " ap_channel" , &ap_channel) != OS_SUCCESS)
238
+ json_obj_get_string (&jctx, ( char *) " ap_ssid" , apName, sizeof (apName));
239
+ json_obj_get_string (&jctx, ( char *) " ap_pass" , apPass, sizeof (apPass));
240
+ if (json_obj_get_int (&jctx, ( char *) " ap_channel" , &ap_channel) != OS_SUCCESS)
241
241
ap_channel = 1 ;
242
- if (json_obj_get_bool (&jctx, " ap_dhcp" , &ap_dhcp) != OS_SUCCESS)
242
+ if (json_obj_get_bool (&jctx, ( char *) " ap_dhcp" , &ap_dhcp) != OS_SUCCESS)
243
243
ap_dhcp = true ;
244
244
245
245
// read AP IP
246
- if (ret == OS_SUCCESS && json_obj_get_object (&jctx, " ap_ip" ) == OS_SUCCESS) {
246
+ if (ret == OS_SUCCESS && json_obj_get_object (&jctx, ( char *) " ap_ip" ) == OS_SUCCESS) {
247
247
readStaticIPfromJSON (&jctx, &apIP.ip , " ip" );
248
248
readStaticIPfromJSON (&jctx, &apIP.netmask , " netmask" );
249
249
json_obj_leave_object (&jctx);
250
250
}
251
251
252
252
// OTA
253
- json_obj_get_bool (&jctx, " ota_enabled" , &otaEnabled);
254
- json_obj_get_string (&jctx, " ota_password" , otaPassword, sizeof (otaPassword));
253
+ json_obj_get_bool (&jctx, ( char *) " ota_enabled" , &otaEnabled);
254
+ json_obj_get_string (&jctx, ( char *) " ota_password" , otaPassword, sizeof (otaPassword));
255
255
256
256
// NTP
257
- json_obj_get_string (&jctx, " ntp_server" , ntpServer, sizeof (ntpServer));
257
+ json_obj_get_string (&jctx, ( char *) " ntp_server" , ntpServer, sizeof (ntpServer));
258
258
int64_t gmtOffset;
259
- if (json_obj_get_int64 (&jctx, " gmt_offset" , &gmtOffset) == OS_SUCCESS) {
259
+ if (json_obj_get_int64 (&jctx, ( char *) " gmt_offset" , &gmtOffset) == OS_SUCCESS) {
260
260
gmtOffset_sec = (long ) gmtOffset;
261
261
}
262
- json_obj_get_int (&jctx, " dst_offset" , &daylightOffset_sec);
262
+ json_obj_get_int (&jctx, ( char *) " dst_offset" , &daylightOffset_sec);
263
263
264
264
bool dbg;
265
- if (json_obj_get_bool (&jctx, " debug_mode" , &dbg) == OS_SUCCESS)
265
+ if (json_obj_get_bool (&jctx, ( char *) " debug_mode" , &dbg) == OS_SUCCESS)
266
266
setDebugMode (dbg);
267
267
268
268
// close the file
0 commit comments