@@ -190,26 +190,26 @@ int CLAppConn::loadPrefs() {
190190 return ret;
191191 }
192192
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));
194194
195195 if (ret != OS_SUCCESS)
196196 Serial.println (" MDNS Name is not defined!" );
197197
198198 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);
202202 }
203203
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) {
205205 Serial.print (" Known external SSIDs: " );
206206 if (stationCount>0 )
207207 for (int i=0 ; i < stationCount && i < MAX_KNOWN_STATIONS; i++) {
208208
209209 if (json_arr_get_object (&jctx, i) == OS_SUCCESS) {
210210 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) {
213213 Serial.printf (" %s\r\n " , s->ssid );
214214 stationList[i] = s;
215215 }
@@ -226,7 +226,7 @@ int CLAppConn::loadPrefs() {
226226 }
227227
228228 // 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) {
230230 readStaticIPfromJSON (&jctx, &staticIP.ip , " ip" );
231231 readStaticIPfromJSON (&jctx, &staticIP.netmask , " netmask" );
232232 readStaticIPfromJSON (&jctx, &staticIP.gateway , " gateway" );
@@ -235,34 +235,34 @@ int CLAppConn::loadPrefs() {
235235 json_obj_leave_object (&jctx);
236236 }
237237
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)
241241 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)
243243 ap_dhcp = true ;
244244
245245 // 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) {
247247 readStaticIPfromJSON (&jctx, &apIP.ip , " ip" );
248248 readStaticIPfromJSON (&jctx, &apIP.netmask , " netmask" );
249249 json_obj_leave_object (&jctx);
250250 }
251251
252252 // 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));
255255
256256 // NTP
257- json_obj_get_string (&jctx, " ntp_server" , ntpServer, sizeof (ntpServer));
257+ json_obj_get_string (&jctx, ( char *) " ntp_server" , ntpServer, sizeof (ntpServer));
258258 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) {
260260 gmtOffset_sec = (long ) gmtOffset;
261261 }
262- json_obj_get_int (&jctx, " dst_offset" , &daylightOffset_sec);
262+ json_obj_get_int (&jctx, ( char *) " dst_offset" , &daylightOffset_sec);
263263
264264 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)
266266 setDebugMode (dbg);
267267
268268 // close the file
0 commit comments