Binary JSON support

Hello,
i would like to transfer data from one device to another device with minimum data size.
For this i would like to use the general RPC mechanism of Mongoose OS in order
to use the service as well over mDash from remote.

I would like to setup RPC handlers for getting/setting the data from/to a device.
I can do this already with the existing ASCII JSON formated string that mongoose os
provides. But now i want to transfer more data in shorter time, that’s why i would like to
benefit from a binary formated JSON method. Do you provide a mechanism to do so?

Thanks for an answer.

How about using JSON, but wrap data in a single base64-encoded blob?

Thanks for the answer,
this is for sure the first approach which saves some bytes and makes the response faster, but as you know the base64 coding is still represented in ASCII and therefore gives a minimum overhead of a factor 2 then if you would just send the binary coded values. So there is minimum a factor 2 where it can be done better than base64 coded ASCII representation.

I do not see where Base64 encoding will save any bytes at all, but it‘s easier to handle. On the top you may use the MINIZ library to compress your data before sending - this will save up to 90% of the transferred amount of data, if the data package has a certain size (if not, the efficiency goes down).

Checkout CBOR

It is likely what you’re chasing.