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

Enhance zephyr integration with west and kconfig #395

Merged
merged 1 commit into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions zephyr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
if(CONFIG_ZENOH_PICO)

zephyr_compile_definitions(ZENOH_ZEPHYR)
zephyr_include_directories(../include)
zephyr_library()

function(configure_zenoh_feature config)
string(REPLACE CONFIG_ZENOH_PICO Z_FEATURE feature ${config})
if(${config})
zephyr_compile_definitions(${feature}=1)
else()
zephyr_compile_definitions(${feature}=0)
endif()
endfunction()


configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_SERIAL)
configure_zenoh_feature(CONFIG_ZENOH_PICO_MULTI_THREAD)
configure_zenoh_feature(CONFIG_ZENOH_PICO_PUBLICATION)
configure_zenoh_feature(CONFIG_ZENOH_PICO_SUBSCRIPTION)
configure_zenoh_feature(CONFIG_ZENOH_PICO_QUERY)
configure_zenoh_feature(CONFIG_ZENOH_PICO_QUERYABLE)
configure_zenoh_feature(CONFIG_ZENOH_PICO_RAWETH_TRANSPORT)
configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_TCP)
configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_UDP_UNICAST)
configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_UDP_MULTICAST)
configure_zenoh_feature(CONFIG_ZENOH_PICO_SCOUTING_UDP)
configure_zenoh_feature(CONFIG_ZENOH_PICO_LINK_WS)


file(GLOB_RECURSE Sources
"../src/api/*.c"
"../src/collections/*.c"
"../src/deprecated/*.c"
"../src/link/*.c"
"../src/net/*.c"
"../src/protocol/*.c"
"../src/session/*.c"
"../src/transport/*.c"
"../src/utils/*.c"
)

file (GLOB Sources_Zephyr "../src/system/zephyr/*.c")
list(APPEND Sources ${Sources_Zephyr})
zephyr_library_sources(${Sources})
endif()
69 changes: 69 additions & 0 deletions zephyr/Kconfig.zenoh
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
config ZENOH_PICO
bool "Zenoh PICO library"
help
Enable Zenoh pico support

if ZENOH_PICO

config ZENOH_PICO_LINK_SERIAL
bool "Serial Link"
help
Use serial link

config ZENOH_PICO_MULTI_THREAD
bool "Multithreading support"
help
Multithreading support

config ZENOH_PICO_PUBLICATION
bool "Publication Support"
help
Publication support

config ZENOH_PICO_SUBSCRIPTION
bool "Subscription Support"
help
Subscription Support

config ZENOH_PICO_QUERY
bool "Query Support"
help
Query Support

config ZENOH_PICO_QUERYABLE
bool "Queryable Support"
help
Queryable Support

config ZENOH_PICO_RAWETH_TRANSPORT
bool "Raw Ethernet Support"
help
Raw Ethernet Support

config ZENOH_PICO_LINK_TCP
bool "TCP Link"
help
TCP Link

config ZENOH_PICO_LINK_UDP_UNICAST
bool "UDP Unicast"
help
UDP Unicast

config ZENOH_PICO_LINK_UDP_MULTICAST
bool "UDP Multicast"
help
UDP Multicast

config ZENOH_PICO_SCOUTING_UDP
bool "Scouting UDP"
help
Scouting UDP

config ZENOH_PICO_LINK_WS
bool "WS Link"
help
WS Link

endif

4 changes: 2 additions & 2 deletions zephyr/module.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: zenoh-pico
build:
cmake-ext: True
kconfig-ext: True
cmake: zephyr/
kconfig: zephyr/Kconfig.zenoh
Loading