Skip to content

Instantly share code, notes, and snippets.

View MathiasKoch's full-sized avatar
🦀

Mathias Koch MathiasKoch

🦀
View GitHub Profile
@MathiasKoch
MathiasKoch / Example.md
Last active June 20, 2023 07:19
AWS IoT Protobuf decoding

Creating descriptor file

protoc --descriptor_set_out=issue.desc --proto_path=src/sensor --include_imports issue.proto

Running the decode locally using protoc:

// Implemented by derive macro
pub(crate) trait Struct {
fn field_at(&self, index: usize) -> Option<(&'static str, Option<&'a dyn Struct>)>;
}
pub struct KeyIter<'a> {
pub(crate) struct_val: &'a dyn Struct,
pub(crate) index: usize,
pub(crate) prefix: Option<heapless::String<MAX_KEY_LEN>>,
pub(crate) inner: Option<KeyIter<'a>>,