Single-header JSON field extractor for when you control both message format and receiver. 106 bytes on ARM Cortex-M4, no malloc, MIT licensed.
#include “packet_atoms.h”
char temp[16];
jet(“{“temp”:22.5,”hum”:65}”, “temp”, temp, sizeof(temp));
// temp now holds “22.5”
Deliberate limitations:
– Fixed field order (uses strstr)
– No nested objects/arrays
– Strings include quotes
– You design the protocol
Size comparison (ARM -Os):
– cJSON: 3.2 kB + malloc
– JSMN: 800 B + token iteration
– This: 106 B
Tested on Cortex-M4 and x86-64. Header-only, copy-paste ready.
Comments URL: https://news.ycombinator.com/item?id=45648471
Points: 1
# Comments: 0
Source: github.com
