3 ms·
I wrote my own serialization library for embedded systems recently. It serializes data that can be defined and initialized natively in C. The intention is for
by jhallenworld 7y ago
I wrote my own serialization library for embedded systems recently. It serializes data that can be defined and initialized natively in C. The intention is for data section only data, not heap data. So for example, you can have variable length arrays, but you must have a maximum length to match the preallocated C array declaration.
The serialized format mimicks JSON, except that it supports tables- arrays of structs. This saves space compared with actual JSON, since the column names only have to be given once. Also tables where the columns are primitive types can be loaded directly into common spreadsheet applications. This is useful for my specific application.
The application has a CLI that allows you to browse the data with xpath like expressions. You can set or get any field of the hierarchy (using the serialization format), and since the type is known it can parse and schema check the user input.
I use the serialized format for storing a copy of the data in flash memory, so that it can be restored on boot up.
The metadata with the type information is all marked as const. In embedded systems, this data is placed in flash memory instead of precious RAM.
- mhdhn 7y agoSounds cool, is it open source?