source: rtos_arduino/trunk/arduino_lib/libraries/ArduinoJson/README.md@ 209

Last change on this file since 209 was 209, checked in by ertl-honda, 8 years ago

BlueMix用のフィアルを追加

File size: 4.8 KB
Line 
1Arduino JSON library
2====================
3
4[![Build status](https://ci.appveyor.com/api/projects/status/m7s53wav1l0abssg/branch/master?svg=true)](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/master) [![Build Status](https://travis-ci.org/bblanchon/ArduinoJson.svg?branch=master)](https://travis-ci.org/bblanchon/ArduinoJson) [![Coverage Status](https://img.shields.io/coveralls/bblanchon/ArduinoJson.svg)](https://coveralls.io/r/bblanchon/ArduinoJson?branch=master) [![Star this project](http://githubbadges.com/star.svg?user=bblanchon&repo=ArduinoJson&style=flat&color=fff&background=007ec6)](https://github.com/bblanchon/ArduinoJson)
5
6*An elegant and efficient JSON library for embedded systems.*
7
8It's designed to have the most intuitive API, the smallest footprint and works without any allocation on the heap (no malloc).
9
10It has been written with Arduino in mind, but it isn't linked to Arduino libraries so you can use this library in any other C++ project.
11
12Features
13--------
14
15* JSON decoding (comments are supported)
16* JSON encoding (with optional indentation)
17* Elegant API, very easy to use
18* Fixed memory allocation (zero malloc)
19* No data duplication (zero copy)
20* Portable (written in C++98)
21* Self-contained (no external dependency)
22* Small footprint
23* MIT License
24
25Works on
26--------
27
28* All Arduino boards (Uno, Due, Mini, Micro, Yun...)
29* ESP8266
30* Teensy
31* Intel Edison
32* PlatformIO
33* Energia
34* RedBearLab boards (BLE Nano...)
35* Computers (Windows, Linux, OSX...)
36
37See [FAQ: Compatibility issues](https://github.com/bblanchon/ArduinoJson/wiki/Compatibility-issues)
38
39Quick start
40-----------
41
42#### Decoding / Parsing
43
44```c++
45char json[] = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.756080,2.302038]}";
46
47StaticJsonBuffer<200> jsonBuffer;
48
49JsonObject& root = jsonBuffer.parseObject(json);
50
51const char* sensor = root["sensor"];
52long time = root["time"];
53double latitude = root["data"][0];
54double longitude = root["data"][1];
55```
56
57#### Encoding / Generating
58
59```c++
60StaticJsonBuffer<200> jsonBuffer;
61
62JsonObject& root = jsonBuffer.createObject();
63root["sensor"] = "gps";
64root["time"] = 1351824120;
65
66JsonArray& data = root.createNestedArray("data");
67data.add(48.756080, 6); // 6 is the number of decimals to print
68data.add(2.302038, 6); // if not specified, 2 digits are printed
69
70root.printTo(Serial);
71// This prints:
72// {"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}
73```
74
75
76Documentation
77-------------
78
79The documentation is available online in the [Arduino JSON wiki](https://github.com/bblanchon/ArduinoJson/wiki)
80
81Testimonials
82------------
83
84From Arduino's Forum user `jflaplante`:
85> I tried aJson json-arduino before trying your library. I always ran into memory problem after a while.
86> I have no such problem so far with your library. It is working perfectly with my web services.
87
88From Arduino's Forum user `gbathree`:
89> Thanks so much - this is an awesome library! If you want to see what we're doing with it - the project is located at www.photosynq.org.
90
91From StackOverflow user `thegreendroid`:
92> It has a really elegant, simple API and it works like a charm on embedded and Windows/Linux platforms. We recently started using this on an embedded project and I can vouch for its quality.
93
94From GitHub user `zacsketches`:
95
96> Thanks for a great library!!!
97> I've been watching you consistently develop this library over the past six months, and I used it today for a publish and subscribe architecture designed to help hobbyists move into more advanced robotics. Your library allowed me to implement remote subscription in order to facilitate multi-processor robots.
98> ArduinoJson saved me a week's worth of time!!
99
100[From Reddit user `erm_what_`](https://www.reddit.com/r/arduino/comments/3jj6ep/announcing_arduinojson_50/cusjk8c):
101
102> This is a great library and I wouldn't be able to do the project I'm doing without it. I completely recommend it.
103
104[From Reddit user `makerhacks`](https://www.reddit.com/r/arduino/comments/3jj6ep/announcing_arduinojson_50/cusqg7b):
105
106> I am just starting an ESP8266 clock project and now I can output JSON from my server script and interpret it painlessly.
107
108Donators
109--------
110
111Special thanks to the following persons and companies who made generous donations to the library author:
112
113* Robert Murphy
114* Surge Communications
115* Alex Scott
116* Firepick Services LLC
117* A B Doodkorte
118* Scott Smith
119* Johann Stieger
120* Gustavo Donizeti Gini
121
122---
123
124Found this library useful? Please star this project or [help me back with a donation!](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=donate%40benoitblanchon%2efr&lc=GB&item_name=Benoit%20Blanchon&item_number=Arduino%20JSON&currency_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted) :smile:
Note: See TracBrowser for help on using the repository browser.