RealTimeLogic / JSON

JSON C/C++ Library for IoT Communication

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON C/C++ Library for IoT Communication

The JSON C library is designed for use in resource constrained micro controllers such as the Cortex-M0. See the JSON C/C++ Library home page for details.

This standalone version of the JSON library is also embedded in the Barracuda App Server (repository), which provides a Lua API via the Lua Server Pages Engine.

The library can be used in three modes:

  • Using dynamic allocation (Complexity level: easy)
  • Using static allocation based on the JSON Parser Value Factory (Complexity level: moderate)
  • Using static allocation based on the JSON Decoder class (Complexity level: advanced)

A detailed explanation on the three different modes can be found in the reference manual .

Included JSON Examples

  • The m2m-led.c IoT example is using the JSON parser in continuous stream parser mode and is using the more complex JSON Decoder setup. This setup is explained in the online M2M LED JSON Client Documentation.
  • The StaticAllocatorEx.cpp shows how to use a static allocator with the JSON Parser Value Factory.
  • Generic test/example program: test/test1.cpp

Additional JSON IoT Examples

Compiling

Decide if you want to use the more complex JDecoder with static allocation or the easier to use JSON Parser Value Factory (JParserValFact) with dynamic allocation or static allocation. See the documentation for details regarding these two classes.

  • If using JParserValFact, include all C files in the build, except JDecoder.c
  • If using JDecoder, include all C files in the build, except JVal.c and define the macro NO_JVAL_DEPENDENCY when compiling the code. See the comment at the top of the source file JEncoder.c for details.

The included example Makefile, which is configured for GCC, builds 3 libraries. See the Makefile for details.

NOTE: The C files in the src directory MUST be compiled by a C compiler and not by a C++ compiler. Files ending with .c must be compiled by a C compiler and files ending with .cpp must be compiled by a C++ compiler.

About

JSON C/C++ Library for IoT Communication

License:Eclipse Public License 2.0


Languages

Language:C 85.4%Language:C++ 13.8%Language:Makefile 0.8%