Closed zhaocundang closed 1 year ago
Hello! I think using the out-of-band delimiters allows for a more reliable stream parser. They allow you to a) easily cut out the json string to hand to a parser and b) allow fast stream recovery in case there is data corruption (e.g. with the serial link).
I appreciate that some people use a length field followed by data but the existing OOB system works and there is already a bunch of software built around it. Adding the length would break everything and cause me a huge amount of work so I must respectfully decline this feature request.
Regards, Dan
hi dan, why not add 16-bit length of response json data ? for example, I send requst cmd “get_image” ,then device reponse 0x02 {json length}{json}0x03