Brak opisu

Benoit Blanchon dfd51b8f76 Added keywords.txt to allow syntax highlighting in Arduino IDE 12 lat temu
examples 4377a5020a Added example sketch 12 lat temu
utility 49f5843788 Initial commit 12 lat temu
JsonArray.cpp 9c7ff38bbf Added JsonArray::getBool() and JsonHashTable::getBool() 12 lat temu
JsonArray.h 9c7ff38bbf Added JsonArray::getBool() and JsonHashTable::getBool() 12 lat temu
JsonHashTable.cpp 9c7ff38bbf Added JsonArray::getBool() and JsonHashTable::getBool() 12 lat temu
JsonHashTable.h 9c7ff38bbf Added JsonArray::getBool() and JsonHashTable::getBool() 12 lat temu
JsonObjectBase.cpp 9c7ff38bbf Added JsonArray::getBool() and JsonHashTable::getBool() 12 lat temu
JsonObjectBase.h 9c7ff38bbf Added JsonArray::getBool() and JsonHashTable::getBool() 12 lat temu
JsonParser.h b3647a7d91 Parser size is now specified in bytes instead of number of tokens 12 lat temu
README.md 3b91a8a218 Added README.md 12 lat temu
keywords.txt dfd51b8f76 Added keywords.txt to allow syntax highlighting in Arduino IDE 12 lat temu

README.md

A malloc-free JSON parser for Arduino

The library is an convenient and efficient wrapper around the jsmn tokenizer: http://zserge.com/jsmn.html

It works without any allocation on the heap (no malloc) and supports nested objects.

Example

char* json = "{\"Name\":\"Blanchon\",\"Skills\":[\"C\",\"C++\",\"C#\"],\"Age\":32,\"Online\":true}";

JsonParser<256> parser;

JsonHashTable hashTable = parser.parseHashTable(json);

if (!hashTable.success())
{
    return;
}

char* name = hashTable.getString("Name");

JsonArray skills = hashTable.getArray("Skills");

int age = hashTable.getLong("Age");

bool online = hashTable.getBool("Online");