Skip to content
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

Merged
merged 1 commit into from
Feb 27, 2019
Merged

Conversation

jia200x
Copy link
Member

@jia200x jia200x commented Jan 9, 2019

Contribution description

This PR is a part of a rework of #8610 by @moenoel (see #8610 (comment)).
This PR:

  • Bumps pkg/wakaama version (LWM2M)
  • Fixes include path in pkg/wakaama/Makefile.include
  • Adds patches to fix warnings in pkg/wakaama example code
  • Makefile copies some code from pkg/wakaama client example
  • Adds a patch to fix a memory alignment problem to pkg/wakaama
    Update
  • Adds a patch to fix path issues
  • Adds a patch to fix access control object

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

USEPKG=wakaama make all

Issues/PRs references

#8610

@jia200x jia200x requested review from cladmi and kb2ma January 9, 2019 13:59
@jia200x jia200x added Area: pkg Area: External package ports Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jan 9, 2019
targetP->securityMode = LWM2M_SECURITY_MODE_PRE_SHARED_KEY;
if (bsPskId)
{
- targetP->publicIdentity = strdup(bsPskId);
Copy link
Member Author

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?

Copy link
Contributor

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;
Copy link
Member Author

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?

Copy link
Contributor

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.

@leandrolanzieri
Copy link
Contributor

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

@PeterKietzmann
Copy link
Member

I can confirm that any application builds with USEPKG=wakaama for native and samr21-xpro. The pkg is cloned and patches were applied without conflicts. @leandrolanzieri don't you have a test application at hand?

Copy link
Member

@PeterKietzmann PeterKietzmann left a 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
@leandrolanzieri leandrolanzieri merged commit 3e7b3d3 into RIOT-OS:master Feb 27, 2019
@danpetry danpetry added this to the Release 2019.04 milestone Mar 12, 2019
@leandrolanzieri leandrolanzieri deleted the pkg/wakaaama_bump branch July 8, 2020 06:40
@leandrolanzieri leandrolanzieri restored the pkg/wakaaama_bump branch July 8, 2020 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: pkg Area: External package ports CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants