1# CBOR Example 2(See the README.md file in the upper level 'examples' directory for more information about examples.) 3 4## Overview 5 6The [CBOR](https://en.wikipedia.org/wiki/CBOR)(Concise Binary Object Representation) is a binary data serialization format which is similar to JSON but with smaller footprint. This example will illustrate how to encode and decode CBOR data using the APIs provided by [tinycbor](https://github.com/intel/tinycbor). 7 8For detailed information about how CBOR encoding and decoding works, please refer to [REF7049](https://tools.ietf.org/html/rfc7049) or [cbor.io](http://cbor.io/); 9 10## How to use example 11 12### Hardware Required 13 14This example should be able to run on any commonly available ESP32 development board. 15 16### Build and Flash 17 18Run `idf.py -p PORT flash monitor` to build and flash the project. 19 20(To exit the serial monitor, type ``Ctrl-]``.) 21 22See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/latest/get-started/index.html) for full steps to configure and use ESP-IDF to build projects. 23 24## Example Output 25 26```bash 27I (320) example: encoded buffer size 67 28I (320) example: convert CBOR to JSON 29[{"chip":"esp32","unicore":false,"ip":[192,168,1,100]},3.1400001049041748,"simple(99)","2019-07-10 09:00:00+0000","undefined"] 30I (340) example: decode CBOR manually 31Array[ 32 Map{ 33 chip 34 esp32 35 unicore 36 false 37 ip 38 Array[ 39 192 40 168 41 1 42 100 43 ] 44 } 45 3.14 46 simple(99) 47 2019-07-10 09:00:00+0000 48 undefined 49] 50``` 51 52## Troubleshooting 53 54For more API usage, please refer to [tinycbor API](https://intel.github.io/tinycbor/current/). 55 56(For any technical queries, please open an [issue](https://github.com/espressif/esp-idf/issues) on GitHub. We will get back to you as soon as possible.) 57