-
Notifications
You must be signed in to change notification settings - Fork 2k
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
pkg/wakaama: bump version #10738
pkg/wakaama: bump version #10738
Conversation
targetP->securityMode = LWM2M_SECURITY_MODE_PRE_SHARED_KEY; | ||
if (bsPskId) | ||
{ | ||
- targetP->publicIdentity = strdup(bsPskId); |
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.
@moenoel do you remember what was the reason for using lwm2m_strdup
instead of strdup
?
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.
One of the reasons was consistency, as Wakaama defines prototypes for a few functions that it expects the specific implementation to fill in (e.g. lwm2m_malloc()
and lwm2m_free()
) and it just seemed to make sense to use those wrappers throughout the Wakaama related code.
There was at least one other reason, but I can't for the life of me remember what that was specifically.
|
||
struct _lwm2m_data_t | ||
{ | ||
- lwm2m_data_type_t type; |
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.
@moenoel is this safe? E.g wakaama code could eventually cast _lwm2m_data_t
to lwm2m_data_type_t
because address_of(_lwm2m_data_t) == addess_of(_lwm2m_data_t->type). With this change, address_of(_lwm2m_data_t) == address_of(_lwm2m_data_t->id).
Do you remember the reason behind this?
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.
Not entirely sure if it's safe, though I didn't encounter any obvious problems running it. The reason for that change was to get rid of a memory alignment issue on the ARM boards we used.
IIRC lwm2m_data_type_t
is an enum and apparently enums can have strange widths, so all the following struct members got misaligned, leading to hard faults. Making the enum member the last one fixed that for us.
I added two fixups that bump to the latest release and add a fix on the access control object that hasn't yet been merged to upstream |
I can confirm that any application builds with |
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.
ACK. I've tested this PR with #11036. @jia200x, @leandrolanzieri please squash
- copy basic objects from client implementation - fix pkg warnings - use lwm2m_strdup instead of strdup - fix alignment problem in lwm2m data struct - add fix of acc_ctrl object read
0b14e82
to
82c7eac
Compare
Contribution description
This PR is a part of a rework of #8610 by @moenoel (see #8610 (comment)).
This PR:
Update
Testing procedure
Hard to test without an example application, which will be introduced with the rework of #8610).
However it's possible to check it compile with no errors. E.g
Issues/PRs references
#8610