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

Add support for zephyr #24

Merged
merged 6 commits into from
Apr 1, 2021
Merged

Add support for zephyr #24

merged 6 commits into from
Apr 1, 2021

Conversation

esteve
Copy link
Contributor

@esteve esteve commented Mar 31, 2021

@Mallets this PR has many changes, let me know if you'd like me to break it out:

  • I changed the #ifs to just check if the macros had been defined.
  • I added an implementation of strdup, since Zephyr does not provide it
  • Because some MCUs do not implement _times() when calling clock(), I replaced the srand() initialization to just use time()
  • Added support for Zephyr. Zephyr does not support many of the socket flags that are used in zenoh-pico, so this last commit is the one I'm not sure it should be merged as is, let me know if the flags are really needed.

Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
return r;
}

// NOTE(esteve): SO_KEEPALIVE and SO_LINGER not supported in Zephyr
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would simply remove the commented code and leave the note saying that those flags are not supported in Zephyr.


return 0;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would simply remove the commented code and leave the note saying that iovec is not supported in Zephyr.

@Mallets
Copy link
Member

Mallets commented Apr 1, 2021

@esteve I went through your PR and it seems fine to me. Thanks for adding the support for Zephyr into zenoh-pico!

For what concerns the socket flags, they are not mandatory in zenoh-pico. It's only a matter of tuning that we found beneficial on UNIX systems. If those flags are not supported in Zephyr, let's simply ignore them.

Signed-off-by: Esteve Fernandez <esteve@apache.org>
Signed-off-by: Esteve Fernandez <esteve@apache.org>
@Mallets Mallets merged commit 2b6aff8 into eclipse-zenoh:master Apr 1, 2021
@Mallets Mallets mentioned this pull request May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants