-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Adapt System layer to Zephyr OS #1594
Merged
andy31415
merged 3 commits into
project-chip:master
from
Damian-Nordic:feature/systemwakeevent
Jul 17, 2020
Merged
Adapt System layer to Zephyr OS #1594
andy31415
merged 3 commits into
project-chip:master
from
Damian-Nordic:feature/systemwakeevent
Jul 17, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The System layer was based on the assumption that when BSD socket API is available then other POSIX functions can be used as well. Unfortunately, this is not the case in Zephyr which only implements a subset of POSIX requirements. Replace usage of pipe() system call with an equivalent usage of socketpair(). Update KConfig of the door-lock example for nrfconnect platform to set up networking properly. This only makes sure that libSystemLayer.a builds correctly when NCS and the socket-based Inet layer is used. However, the Inet layer itself still has some build issues which need to be resolved.
Size increase report for "nrf-example-build"
Full report output
|
Size increase report for "linux-example-build"
Full report output
|
Size increase report for "esp32-example-build"
Full report output
|
Size increase report for "gn_nrf-example-build"
Full report output
|
Size increase report for "gn_linux-example-build"
Full report output
|
andy31415
approved these changes
Jul 14, 2020
woody-apple
approved these changes
Jul 14, 2020
lgtm |
mspang
approved these changes
Jul 16, 2020
e-rk
reviewed
Jul 16, 2020
|
||
Error SystemWakeEvent::Open() | ||
{ | ||
mFD = eventfd(0, EFD_NONBLOCK); |
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.
Have you verified this change on Zephyr?
BroderickCarlin
approved these changes
Jul 16, 2020
kedars
pushed a commit
to kedars/connectedhomeip
that referenced
this pull request
Jul 21, 2020
* Adapt System layer to Zephyr socket API The System layer was based on the assumption that when BSD socket API is available then other POSIX functions can be used as well. Unfortunately, this is not the case in Zephyr which only implements a subset of POSIX requirements. Replace usage of pipe() system call with an equivalent usage of socketpair(). Update KConfig of the door-lock example for nrfconnect platform to set up networking properly. This only makes sure that libSystemLayer.a builds correctly when NCS and the socket-based Inet layer is used. However, the Inet layer itself still has some build issues which need to be resolved. * Use eventfd for system event * Adapt to GN build system and add unit tests Co-authored-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
kedars
pushed a commit
to kedars/connectedhomeip
that referenced
this pull request
Jul 21, 2020
* Adapt System layer to Zephyr socket API The System layer was based on the assumption that when BSD socket API is available then other POSIX functions can be used as well. Unfortunately, this is not the case in Zephyr which only implements a subset of POSIX requirements. Replace usage of pipe() system call with an equivalent usage of socketpair(). Update KConfig of the door-lock example for nrfconnect platform to set up networking properly. This only makes sure that libSystemLayer.a builds correctly when NCS and the socket-based Inet layer is used. However, the Inet layer itself still has some build issues which need to be resolved. * Use eventfd for system event * Adapt to GN build system and add unit tests Co-authored-by: Rafał Kuźnia <rafal.kuznia@nordicsemi.no>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Make System layer build on Zephyr OS
Summary of Changes
The system layer uses pipe() function to create a dummy data stream needed to wake a thread waiting for sockets. Unfortunately, pipe() is unavailable in Zephyr API, so create an abstract object - SystemWakeEvent - which can be implemented using any primitives available on a given platform.
Originally the change was part of #1494 PR, but it was requested as a separate change set by @rwalker-apple.