You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2019/04/29 23:25:05 UTC
[GitHub] [mynewt-core] ccollins476ad opened a new pull request #1787:
encoding/cborattr: Structured encoding
ccollins476ad opened a new pull request #1787: encoding/cborattr: Structured encoding
URL: https://github.com/apache/mynewt-core/pull/1787
The motivation for this change is to simplify logging of events as CBOR data. This change allows events to be logged without needing to structure CBOR data with calls into the tinyCBOR API.
The cborattr package allows CBOR data to be decoded to a set of C structs. This commit implements the reverse functionality: the ability to encode structures to CBOR data.
The existing structure (`struct cbor_attr_t`) is almost appropriate for this new functionality, but not quite. The semantics between the two operations are sufficiently different to justify implementing a new data structure: `struct cbor_out_attr_t`. To encode to CBOR, populate an array of these objects, and pass it to one of the `cbor_write_[...]` functions.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services