Hi, thanks for making this crate. I would like to use it as a logging format to log data to a SD card via a serial connection. The data is serialized in a no_std environment and deserialized later in a std env into a vec of messages.
I recorded some test data with a serial monitor but I don't understand how to deserialize it.
let mut buffer = [0u8; 256];
loop {
let sensor_update = // load sensor values
let buffer = to_slice_cobs(&sensor_update, &mut buffer).unwrap();
// Write `buffer` to the serial connection
}
On the deserialization side I'm including the data with include_bytes!("../serial_output.txt") but what do I do from there? I found the example for CobsAccumulator but I'm not sure if it's applicable or how to adjust it to my use case. I hope you can point me in the right direction. Thanks!
I should have read more about COBS encoding before opening this issue. It's trivial to split the bytes from the file on the zero byte and decode each message separately. Works like a charm.
Hi, thanks for making this crate. I would like to use it as a logging format to log data to a SD card via a serial connection. The data is serialized in a
no_std
environment and deserialized later in astd
env into a vec of messages.I recorded some test data with a serial monitor but I don't understand how to deserialize it.
My data type are like this
On serialization side I have:
On the deserialization side I'm including the data with
include_bytes!("../serial_output.txt")
but what do I do from there? I found the example forCobsAccumulator
but I'm not sure if it's applicable or how to adjust it to my use case. I hope you can point me in the right direction. Thanks!I uploaded some example data here.