mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
https://github.com/msgpack/website/blob/master/README.md#how-to-list-up-your-project-on-msgpackorg
47 lines
2.5 KiB
Markdown
47 lines
2.5 KiB
Markdown
MessagePack for Arduino
|
|
=======================
|
|
|
|
[](https://www.ardu-badge.com/ArduinoJson/6.12.0)
|
|
[](https://ci.appveyor.com/project/bblanchon/arduinojson/branch/6.x)
|
|
[](https://travis-ci.org/bblanchon/ArduinoJson)
|
|
[](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
|
|
[](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
|
|
[](https://github.com/bblanchon/ArduinoJson/stargazers)
|
|
|
|
[ArduinoJson](https://arduinojson.org) supports [MessagePack](http://msgpack.org/) serialization and deserialization.
|
|
|
|
It supports all [MessagePack](http://msgpack.org/) features except [bin format](https://github.com/msgpack/msgpack/blob/master/spec.md#bin-format-family) and [timestamp](https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type).
|
|
|
|
How to install?
|
|
---------------
|
|
|
|
To install [ArduinoJson](https://arduinojson.org), you can either:
|
|
|
|
* install the library from the [Arduino Library Manager](https://www.ardu-badge.com/ArduinoJson/6.12.0),
|
|
* install the library from the [Particle Web IDE](https://build.particle.io/libs/ArduinoJson/),
|
|
* download the single header from [the release page](https://github.com/bblanchon/ArduinoJson/releases/latest/).
|
|
|
|
See also: [How to install ArduinoJson](https://arduinojson.org/v6/doc/installation/) on [arduinojson.org](https://arduinojson.org).
|
|
|
|
How to serialize to MsgPack?
|
|
----------------------------
|
|
|
|
```c++
|
|
StaticJsonDocument<200> doc;
|
|
doc["hello"] = "world";
|
|
serializeMsgPack(doc, Serial);
|
|
```
|
|
|
|
See also: [serializeMsgPack()](https://arduinojson.org/v6/api/msgpack/serializemsgpack/) on [arduinojson.org](https://arduinojson.org).
|
|
|
|
How to deserialize from MsgPack?
|
|
--------------------------------
|
|
|
|
```c++
|
|
StaticJsonDocument<200> doc;
|
|
deserializeMsgPack(doc, input);
|
|
const char* hello = doc["hello"];
|
|
```
|
|
|
|
See also: [deserializeMsgPack()](https://arduinojson.org/v6/api/msgpack/deserializemsgpack/) and [MsgPackParser.ino](https://arduinojson.org/v6/example/msgpack-parser/) on [arduinojson.org](https://arduinojson.org).
|