mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-08-18 03:51:21 +02:00
Updated FAQ (markdown)
4
FAQ.md
4
FAQ.md
@@ -116,7 +116,7 @@ struct SensorData {
|
|||||||
bool deserialize(SensorData& data, const char* json)
|
bool deserialize(SensorData& data, const char* json)
|
||||||
{
|
{
|
||||||
StaticJsonBuffer<SENSORDATA_JSON_SIZE> jsonBuffer;
|
StaticJsonBuffer<SENSORDATA_JSON_SIZE> jsonBuffer;
|
||||||
JsonObject& root = jsonBuffer.parseObject(json)
|
JsonObject& root = jsonBuffer.parseObject(json);
|
||||||
data.name = json["name"];
|
data.name = json["name"];
|
||||||
data.time = json["time"];
|
data.time = json["time"];
|
||||||
data.value = json["value"];
|
data.value = json["value"];
|
||||||
@@ -126,7 +126,7 @@ bool deserialize(SensorData& data, const char* json)
|
|||||||
void serialize(const SensorData& data, char* json, size_t maxSize)
|
void serialize(const SensorData& data, char* json, size_t maxSize)
|
||||||
{
|
{
|
||||||
StaticJsonBuffer<SENSORDATA_JSON_SIZE> jsonBuffer;
|
StaticJsonBuffer<SENSORDATA_JSON_SIZE> jsonBuffer;
|
||||||
JsonObject& root = jsonBuffer.createObject()
|
JsonObject& root = jsonBuffer.createObject();
|
||||||
root["name"] = data.name;
|
root["name"] = data.name;
|
||||||
root["time"] = data.time;
|
root["time"] = data.time;
|
||||||
root["value"] = data.value;
|
root["value"] = data.value;
|
||||||
|
Reference in New Issue
Block a user