-
Notifications
You must be signed in to change notification settings - Fork 542
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
netutils: add Eclipse Wakaama support
- Loading branch information
1 parent
862df9f
commit 175c225
Showing
5 changed files
with
310 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/wakaama | ||
/*.tar.gz |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# ############################################################################## | ||
# apps/netutils/wakaama/CMakeLists.txt | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
# license agreements. See the NOTICE file distributed with this work for | ||
# additional information regarding copyright ownership. The ASF licenses this | ||
# file to you under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
# ############################################################################## | ||
|
||
if(CONFIG_NETUTILS_WAKAAMA) | ||
|
||
if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/wakaama) | ||
FetchContent_Declare( | ||
wakaama | ||
DOWNLOAD_NAME "${CONFIG_WAKAAMA_VERSION}.tar.gz" | ||
DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR} | ||
URL "https://github.com/eclipse/wakaama/archive/${CONFIG_WAKAAMA_VERSION}.tar.gz" | ||
SOURCE_DIR | ||
${CMAKE_CURRENT_LIST_DIR}/wakaama | ||
BINARY_DIR | ||
${CMAKE_BINARY_DIR}/apps/netutils/wakaama/wakaama | ||
CONFIGURE_COMMAND | ||
"" | ||
BUILD_COMMAND | ||
"" | ||
INSTALL_COMMAND | ||
"" | ||
TEST_COMMAND | ||
"" | ||
DOWNLOAD_NO_PROGRESS true | ||
TIMEOUT 30) | ||
|
||
FetchContent_GetProperties(wakaama) | ||
|
||
if(NOT wakaama_POPULATED) | ||
FetchContent_Populate(wakaama) | ||
endif() | ||
endif() | ||
|
||
include(wakaama/wakaama.cmake) | ||
|
||
set(WAKAAMA_OPTIONS -Wno-format -Wno-type-limits -Wno-cast-align | ||
-Wno-unused-but-set-variable) | ||
set(WAKAAMA_DEFINITIONS) | ||
|
||
if(CONFIG_ENDIAN_BIG) | ||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_BIG_ENDIAN) | ||
else() | ||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_LITTLE_ENDIAN) | ||
endif() | ||
|
||
if(CONFIG_WAKAAMA_CLIENT_MODE) | ||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_CLIENT_MODE) | ||
endif() | ||
|
||
if(CONFIG_WAKAAMA_SERVER_MODE) | ||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_SERVER_MODE) | ||
endif() | ||
|
||
if(CONFIG_WAKAAMA_BOOTSTRAP) | ||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_BOOTSTRAP) | ||
endif() | ||
|
||
if(CONFIG_WAKAAMA_BOOTSTRAP_SERVER_MODE) | ||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_BOOTSTRAP_SERVER_MODE) | ||
endif() | ||
|
||
if(CONFIG_WAKAAMA_JSON) | ||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_SUPPORT_JSON) | ||
endif() | ||
|
||
if(CONFIG_WAKAAMA_SENML_JSON) | ||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_SUPPORT_SENML_JSON) | ||
endif() | ||
|
||
list(APPEND WAKAAMA_DEFINITIONS LWM2M_COAP_DEFAULT_BLOCK_SIZE=${CONFIG_WAKAAMA_COAP_DEFAULT_BLOCK_SIZE}) | ||
|
||
nuttx_add_library(wakaama) | ||
target_include_directories(wakaama PUBLIC wakaama/include) | ||
target_compile_options(wakaama PUBLIC ${WAKAAMA_OPTIONS}) | ||
target_compile_definitions(wakaama PUBLIC ${WAKAAMA_DEFINITIONS}) | ||
target_sources_wakaama(wakaama) | ||
|
||
include(examples.cmake) | ||
|
||
endif() |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# | ||
# For a description of the syntax of this configuration file, | ||
# see the file kconfig-language.txt in the NuttX tools repository. | ||
# | ||
|
||
config NETUTILS_WAKAAMA | ||
bool "Eclipse Wakaama" | ||
default n | ||
depends on ALLOW_ECLIPSE_COMPONENTS | ||
---help--- | ||
Enable Eclipse Wakaama (formerly liblwm2m) - an implementation | ||
of LWM2M protocol. | ||
|
||
if NETUTILS_WAKAAMA | ||
|
||
config WAKAAMA_VERSION | ||
string "Wakaama version" | ||
default "514659414c792f8c252782af63551b6d09704a7b" | ||
|
||
config WAKAAMA_COAP_DEFAULT_BLOCK_SIZE | ||
int "Wakaama LWM2M COAP default block size" | ||
default 1024 | ||
|
||
config WAKAAMA_CLIENT_MODE | ||
bool "Wakaama client mode" | ||
default n | ||
|
||
config WAKAAMA_SERVER_MODE | ||
bool "Wakaama server mode" | ||
default n | ||
|
||
config WAKAAMA_BOOTSTRAP | ||
bool "Wakaama bootstrap" | ||
default n | ||
|
||
config WAKAAMA_OLD_CONTENT_FORMAT_SUPPORT | ||
bool "Wakaama old content format support" | ||
default n | ||
|
||
config WAKAAMA_TLV | ||
bool "Wakaama TLV support" | ||
default n | ||
|
||
config WAKAAMA_JSON | ||
bool "Wakaama JSON support" | ||
default n | ||
|
||
config WAKAAMA_SENML_JSON | ||
bool "Wakaama SenML JSON support" | ||
default n | ||
|
||
menuconfig WAKAAMA_EXAMPLES | ||
bool "Wakaama examples" | ||
|
||
if WAKAAMA_EXAMPLES | ||
|
||
if WAKAAMA_CLIENT_MODE | ||
|
||
choice | ||
prompt "Wakaama clinet example" | ||
default WAKAAMA_EXAMPLE_CLIENT_LIGHT | ||
|
||
config WAKAAMA_EXAMPLE_CLIENT_LIGHT | ||
bool "Wakaama light client example" | ||
|
||
config WAKAAMA_EXAMPLE_CLIENT | ||
bool "Wakaama client example" | ||
|
||
config WAKAAMA_EXAMPLE_CLIENT_DTLS | ||
bool "Wakaama client DTLS example" | ||
depends on NETUTILS_TINYDTLS | ||
|
||
endchoice # "Wakaama clinet example" | ||
|
||
config WAKAAMA_EXAMPLE_CLIENT_STACKSIZE | ||
int "Wakaama client example stack size" | ||
default 8192 | ||
|
||
endif # WAKAAMA_CLIENT_MODE | ||
|
||
endif # WAKAAMA_EXAMPLES | ||
|
||
endif # NETUTILS_WAKAAMA |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
# ############################################################################## | ||
# apps/netutils/wakaama/examples.cmake | ||
# | ||
# Licensed to the Apache Software Foundation (ASF) under one or more contributor | ||
# license agreements. See the NOTICE file distributed with this work for | ||
# additional information regarding copyright ownership. The ASF licenses this | ||
# file to you under the Apache License, Version 2.0 (the "License"); you may not | ||
# use this file except in compliance with the License. You may obtain a copy of | ||
# the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | ||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | ||
# License for the specific language governing permissions and limitations under | ||
# the License. | ||
# | ||
# ############################################################################## | ||
|
||
set(CLIENT_DIR wakaama/examples/client) | ||
set(CLIENT_LIGHT_DIR wakaama/examples/lightclient) | ||
set(SHARED_DIR wakaama/examples/shared) | ||
|
||
set(CLIENT_SOURCES | ||
${CLIENT_DIR}/lwm2mclient.c | ||
${CLIENT_DIR}/lwm2mclient.h | ||
${CLIENT_DIR}/object_access_control.c | ||
${CLIENT_DIR}/object_connectivity_moni.c | ||
${CLIENT_DIR}/object_connectivity_stat.c | ||
${CLIENT_DIR}/object_device.c | ||
${CLIENT_DIR}/object_firmware.c | ||
${CLIENT_DIR}/object_location.c | ||
${CLIENT_DIR}/object_security.c | ||
${CLIENT_DIR}/object_server.c | ||
${CLIENT_DIR}/object_test.c | ||
${CLIENT_DIR}/system_api.c | ||
${SHARED_DIR}/commandline.c | ||
${SHARED_DIR}/platform.c) | ||
|
||
set(CLIENT_LIGHT_SOURCES | ||
${CLIENT_LIGHT_DIR}/lightclient.c | ||
${CLIENT_LIGHT_DIR}/object_device.c | ||
${CLIENT_LIGHT_DIR}/object_security.c | ||
${CLIENT_LIGHT_DIR}/object_server.c | ||
${CLIENT_LIGHT_DIR}/object_test.c | ||
${SHARED_DIR}/commandline.c | ||
${SHARED_DIR}/platform.c) | ||
|
||
if(CONFIG_WAKAAMA_EXAMPLE_CLIENT) | ||
nuttx_add_application( | ||
NAME | ||
lwm2mclient | ||
SRCS | ||
${CLIENT_SOURCES} | ||
${SHARED_DIR}/connection.c | ||
STACKSIZE | ||
${CONFIG_WAKAAMA_EXAMPLE_CLIENT_STACKSIZE} | ||
INCLUDE_DIRECTORIES | ||
${SHARED_DIR} | ||
DEPENDS | ||
wakaama) | ||
endif() | ||
|
||
if(CONFIG_WAKAAMA_EXAMPLE_CLIENT_DTLS) | ||
nuttx_add_application( | ||
NAME | ||
lwm2mclient_dtls | ||
SRCS | ||
${CLIENT_SOURCES} | ||
${SHARED_DIR}/dtlsconnection.c | ||
STACKSIZE | ||
${CONFIG_WAKAAMA_EXAMPLE_CLIENT_STACKSIZE} | ||
INCLUDE_DIRECTORIES | ||
${SHARED_DIR} | ||
DEFINITIONS | ||
WITH_TINYDTLS | ||
DEPENDS | ||
wakaama | ||
tinydtls) | ||
endif() | ||
|
||
if(CONFIG_WAKAAMA_EXAMPLE_CLIENT_LIGHT) | ||
nuttx_add_application( | ||
NAME | ||
lwm2mclient_light | ||
SRCS | ||
${CLIENT_LIGHT_SOURCES} | ||
${SHARED_DIR}/connection.c | ||
STACKSIZE | ||
${CONFIG_WAKAAMA_EXAMPLE_CLIENT_STACKSIZE} | ||
INCLUDE_DIRECTORIES | ||
${SHARED_DIR} | ||
DEPENDS | ||
wakaama) | ||
endif() |