Parse JSON as bytes arrive instead of buffering a complete document before processing.
Use JSON directly over UART and TCP/IP streams when no packet framing is available.
Use APIs that simplify converting between C data structures and JSON messages.
Use the same JSON encoder and decoder with WebSocket, MQTT, SMQ, REST, or custom transports.
Many IoT protocols already provide packet framing. WebSocket frames include a size header, MQTT publishes messages by topic, and HTTP APIs define request and response boundaries. In these cases, a conventional JSON encoder or decoder can work on each complete message.
Raw TCP/IP and UART are different. They are byte streams, not message transports, so the application may receive part of a JSON document, several documents, or a document split across multiple reads. The Real Time Logic JSON parser is designed for this environment: it can parse incoming data incrementally and notify the application when a complete JSON message has been assembled.
Send and receive JSON over simple streams without inventing delimiters or buffering full messages.
Use JSON as the payload format for browser interfaces, device APIs, and service integrations.
The JSON library is used in the Minnow Server IoT reference example.
The GitHub repository includes a raw TCP/IP example. After cloning the project, build it and run the m2mled example, then open the companion browser interface to test the connected device.