Hi All,
I am moving my Arduino-like project to use Zephyr and C. It is mostly working but something wrong with the deserialization functions.
The notecard message is as expected:
[INFO] {“req”:“note.get”,“file”:“command.qi”,“delete”:true,“crc”:“002A:32E87BAA”}
[INFO] {“time”:1736184879,“body”:{“cmd_id”:“3D88EDBE-505C-45AE-8969-1FFF3FC21F15”,“cmd_type”:“f”,“dev_id”:“scan”}}
I try to deserialize the message the way I always have:
J *body = JGetObject(rsp, “body”);
cmdtype = JGetString(body, “cmd_type”);
devid = JGetString(body, “dev_id”);
cmdid = JGetString(body, “cmd_id”);
I end up with:
cmdid: €UË?ðñÉ?-505C-45AE-8969-1FFF3FC21F15
cmdtype: ÐñÉ?ÐñÉ?h
devid: scan
The cmd_type field, which should be a single character, is always replaced by 8 bytes. They are always similar, e.g., 208-241-201-63-208-241-201-63, 4 bytes repeated.
The first 8 bytes of cmd_id are sometimes overwritten.
The dev_id field is never overwritten regardless of the order the fields are deserialized.
I tried adding 10 leading dots to the fields:
[INFO] {“time”:1736184524,“body”:{“cmd_id”:“…B626C449-E1D3-4693-B41D-166B67FA16E9”,“cmd_type”:“…f”,“dev_id”:“…scan”}}
The result was consistent with the original:
cmd_id: øñÉ?øñÉ?..B626C449-E1D3-4693-B41D-166B67FA16E9
cmd_type: ØñÉ?ØñÉ?..f
dev_id: …scan
I can only conclude that there is a problem with the note-c Zephyr library. Any clues would be much appreciated.
Thanks in advance,
Rob