-->
Page 1 of 1

Json exception

PostPosted: Sun Jan 24, 2016 2:27 pm
by fastlink30
with this routine i print some info on serial, but when quit routine, get errors (as you can see on image attached)
the network object must be 'closed'? how is correct?

void inforeadCommand(void)
{
DynamicJsonBuffer jsonBuffer;

JsonObject& network = jsonBuffer.createObject();

network["HEAP"] = system_get_free_heap_size();
network["IP"] = WifiStation.getIP().toString().c_str();
network["MASK"] = WifiStation.getNetworkMask().toString().c_str();
network["GWAY"] = WifiStation.getNetworkGateway().toString().c_str();
network["DHCP"] = WifiStation.isEnabledDHCP();
network["SSID"] = WifiStation.getSSID().c_str();
network["PASS"] = WifiStation.getPassword().c_str();
network["UDP"] = UDP_PORT_SERIALE;
network["CHAN"] = wifi_get_channel();
network["CHIP_ID"] = system_get_chip_id();
network["SDK"] = system_get_sdk_version();
network["VDD"] = system_get_vdd33();
network["CPU_FREQ"] = system_get_cpu_freq();
network["HOSTNAME"] = wifi_station_get_hostname();

Serial.printf("%s\r\n",network.toJsonString().c_str());
}

another think, how to calculate vdd from the int returned from system_get_vdd33()?
thanks

Re: Json exception

PostPosted: Mon Jan 25, 2016 10:36 am
by hreintke
Questions like this are better to be posted on the https://gitter.im/SmingHub/Sming chat.
Multiple persons using json in sming are in there.