-
Notifications
You must be signed in to change notification settings - Fork 3
Add classes for standard cbor encoders/decoders #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #33 +/- ##
==========================================
+ Coverage 29.85% 30.21% +0.36%
==========================================
Files 27 29 +2
Lines 1819 1830 +11
==========================================
+ Hits 543 553 +10
- Misses 1276 1277 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Memory usage change @ 4e40624
Click for full report table
Click for full report CSV
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of WiFIFWVersionMessageEncoder
, why don't we call it VersionMessageEncoder
? We can make it generic and reuse it by providing a Cbor tag and message id as parameters in the constructor, like this:
struct VersionMessage {
Message c;
struct {
const char *versionString;
} params;
};
VersionMessageEncoder(CborTag tag, MessageId id)
: CBORMessageEncoderInterface(tag, id) {}
VersionMessageEncoder WiFiFWVersionEncoder(CBORWiFiFWVersionMessage, WiFiFWVersionMessageId);
typedef VersionMessage WiFiFWVersionMessage;
In this way we can encode all kind of version messages with just this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some examples to improve code coverage?
ArduinoStandardMessageStartId = 0x000, | ||
ArduinoIOTCloudStartMessageId = 0x100, | ||
ArduinoProvisioningStartMessageId = 0x200, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ArduinoStandardMessageStartId = 0x000, | |
ArduinoIOTCloudStartMessageId = 0x100, | |
ArduinoProvisioningStartMessageId = 0x200, | |
ArduinoMessageStartId = 0x000, | |
ArduinoIOTCloudStartMessageId = 0x100, | |
ArduinoProvisioningStartMessageId = 0x200, | |
ArduinoVersionsStartId = 0x300, |
Changes