No Description

Benoit Blanchon e53e4e3dd9 Fixed typos 8 years ago
.github 7626db624e Changed all link to point to HTTPS version 8 years ago
examples e53e4e3dd9 Fixed typos 8 years ago
fuzzing 024976cda2 Renamed folder `include/` to `src/` (issue #461) 9 years ago
scripts 34674fc282 Fixed error `IsBaseOf is not a member of ArduinoJson::TypeTraits` (issue #495) 8 years ago
src 57d98e48f7 Added detection of Keil ARM Compiler (issue #629) 8 years ago
test d3a1203782 Added JsonVariant::operator| to return a default value 8 years ago
third-party 221c2861fc Changed all links to point to arduinojson.org 8 years ago
.clang-format 8c7edbd9c3 ArduinoJson is now a header-only library (issue #199) 9 years ago
.gitattributes e31d667bec Added support of comments in JSON input (issue #88) 10 years ago
.gitignore 6b2f6a4f87 Added fuzzer 9 years ago
.mbedignore 3fd87e8e82 Added fuzzing/ to .mbedignore 9 years ago
.travis.yml a428e125fa Travis: Added GCC 7 8 years ago
ArduinoJson.h 221c2861fc Changed all links to point to arduinojson.org 8 years ago
CHANGELOG.md e53e4e3dd9 Fixed typos 8 years ago
CMakeLists.txt 221c2861fc Changed all links to point to arduinojson.org 8 years ago
CONTRIBUTING.md 6df204cf40 Split CONTRIBUTING and SUPPORT 8 years ago
LICENSE.md 671329a3e9 Updated copyright year from 2016 to 2017 9 years ago
README.md 36fe6535c4 Reworked the readme 8 years ago
SUPPORT.md 7626db624e Changed all link to point to HTTPS version 8 years ago
appveyor.yml b55e57a7cf Set version to 5.12.0 8 years ago
banner.svg d6e61cbcda Added banner with the new logo 8 years ago
keywords.txt 4a7232ac99 Added DynamicJsonBuffer to the keywords 9 years ago
library.json b55e57a7cf Set version to 5.12.0 8 years ago
library.properties b55e57a7cf Set version to 5.12.0 8 years ago

README.md

ArduinoJson


Build status Build Status Coverage Status Star this project

ArduinoJson is a C++ JSON library for Arduino and IoT (Internet Of Things).

Features

  • JSON decoding (comments are supported)
  • JSON encoding (with optional indentation)
  • Elegant API, easy to use
  • Fixed memory allocation (zero malloc)
  • No data duplication (zero copy)
  • Portable (written in C++98, can be used in any C++ project)
  • Self-contained (no external dependency)
  • Small footprint
  • Input and output streams
  • 100% code coverage
  • Header-only library
  • MIT License
  • Comprehensive documentation

Compatibility

ArduinoJson works on the following hardware:

ArduinoJson compiles with zero warning on the following compilers, IDEs, and platforms:

Quickstart

Deserialization

Here is a program that parses a JSON document with ArduinoJson.

char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";

StaticJsonBuffer<200> jsonBuffer;

JsonObject& root = jsonBuffer.parseObject(json);

const char* sensor = root["sensor"];
long time          = root["time"];
double latitude    = root["data"][0];
double longitude   = root["data"][1];

See the tutorial on arduinojson.org

Serialization

Here is a program that generates a JSON document with ArduinoJson:

StaticJsonBuffer<200> jsonBuffer;

JsonObject& root = jsonBuffer.createObject();
root["sensor"] = "gps";
root["time"] = 1351824120;

JsonArray& data = root.createNestedArray("data");
data.add(48.756080);
data.add(2.302038);

root.printTo(Serial);
// This prints:
// {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}

See the tutorial on arduinojson.org

Documentation

The documentation is available on arduinojson.org, here are some shortcuts:

  • The Examples show how to use the library in various situations.
  • The API Reference contains the description of each class and function.
  • The FAQ has the answer to virtually all questions.
  • The ArduinoJson Assistant writes programs for you!

Do you like this library? Please star this project on GitHub!