Permalink
Browse files

Anjay 1.1.0

Features:
* Demo client loads certificates from files
* Added Bootstrap Awareness tutorial
* Added Access Control tutorial
* Added DTLS tutorial
* Refactored Attribute handling to meet current LwM2M standard requirements
* Improved out of source build support
* Improved test coverage

Bugfixes:
* Fixed coverage script
* Fixed fuzz tests compilation & running on some configurations
* Fixed mbedTLS detection in integration tests
* Fixed a case where mismatched Resource ID was accepted in the TLV payload
* Fixed compilation of tests under gcc-4.6
* Fixed detection of the required python version

Other:
* Added missing license headers
* Lowered loglevel of some less important messages
* Refactored some of the macros and replaced them with real C code
* Replaced all "LWM2M" with "LwM2M"
* Other minor fixes
  • Loading branch information...
kFYatek committed Feb 22, 2017
1 parent 7f3c8b5 commit 90390061cbf30fe9b17889bbd1db8c37d98a6eb6
Showing with 5,632 additions and 1,818 deletions.
  1. +1 −8 .gitignore
  2. +55 −34 CMakeLists.txt
  3. +15 −0 CONTRIBUTING.rst
  4. +1 −1 Doxyfile.in
  5. +6 −6 README.md
  6. +1 −1 avs_commons/git
  7. +14 −0 cmake/anjay-config.cmake.in
  8. +14 −0 cmake/anjay-version.cmake.in
  9. +14 −0 cmake/install_utils.cmake
  10. +14 −0 cmake/sphinx.cmake
  11. +18 −0 config/config.h.in
  12. +14 −0 covconfig
  13. +14 −10 demo/CMakeLists.txt
  14. +2 −3 demo/demo.c
  15. +122 −51 demo/demo_args.c
  16. +1 −1 demo/demo_args.h
  17. +5 −5 demo/demo_cmds.c
  18. +14 −0 devconfig
  19. +15 −0 doc/sphinx/extensions/builders/__init__.py
  20. +22 −0 doc/sphinx/extensions/builders/dummy.py
  21. +30 −17 doc/sphinx/extensions/builders/snippet_source_linter.py
  22. +17 −4 doc/sphinx/extensions/builders/snippet_source_list_references.py
  23. +24 −5 doc/sphinx/extensions/file_dirtiness_checker.py
  24. +17 −2 doc/sphinx/extensions/snippet_source.py
  25. +15 −0 doc/sphinx/source/AdvancedTutorial.rst
  26. +17 −2 doc/sphinx/source/AdvancedTutorial/AT1.rst
  27. +15 −0 doc/sphinx/source/AdvancedTutorial/AT2.rst
  28. +280 −0 doc/sphinx/source/AdvancedTutorial/AT3.rst
  29. +205 −0 doc/sphinx/source/AdvancedTutorial/AT4.rst
  30. +15 −0 doc/sphinx/source/BasicTutorial.rst
  31. +16 −1 doc/sphinx/source/BasicTutorial/BT1.rst
  32. +15 −0 doc/sphinx/source/BasicTutorial/BT2.rst
  33. +15 −0 doc/sphinx/source/BasicTutorial/BT3.rst
  34. +15 −0 doc/sphinx/source/BasicTutorial/BT4_CustomObject.rst
  35. +16 −1 doc/sphinx/source/BasicTutorial/BT4_CustomObject/BT_CO1_SingleInstanceReadOnly.rst
  36. +15 −0 doc/sphinx/source/BasicTutorial/BT4_CustomObject/BT_CO2_MultiInstanceReadOnlyFixed.rst
  37. +15 −0 doc/sphinx/source/BasicTutorial/BT4_CustomObject/BT_CO3_FixedInstanceWritable.rst
  38. +16 −1 doc/sphinx/source/BasicTutorial/BT4_CustomObject/BT_CO4_MultiInstanceDynamic.rst
  39. +15 −0 doc/sphinx/source/BasicTutorial/BT4_CustomObject/BT_CO5_MultipleResourceInstances.rst
  40. +137 −0 doc/sphinx/source/BasicTutorial/BT4_CustomObject/BT_CO6_BootstrapAwareness.rst
  41. +15 −0 doc/sphinx/source/Commercial_support.rst
  42. +15 −0 doc/sphinx/source/Compiling_client_applications.rst
  43. +15 −0 doc/sphinx/source/Embedded_IP.rst
  44. +15 −0 doc/sphinx/source/Introduction.rst
  45. +18 −1 doc/sphinx/source/LwM2M.rst
  46. +14 −4 src/dm/common.c → doc/sphinx/source/_static/theme_overrides.css
  47. +8 −3 doc/sphinx/source/conf.py.in
  48. +15 −0 doc/sphinx/source/index.rst
  49. +14 −10 examples/test_examples.md5
  50. +4 −4 examples/tutorial/AT1/CMakeLists.txt
  51. +4 −4 examples/tutorial/AT2/CMakeLists.txt
  52. +14 −0 examples/tutorial/AT3-cert/CMakeLists.txt
  53. +202 −0 examples/tutorial/AT3-cert/src/main.c
  54. +14 −0 examples/tutorial/AT3-psk/CMakeLists.txt
  55. +152 −0 examples/tutorial/AT3-psk/src/main.c
  56. +15 −0 examples/tutorial/AT4/CMakeLists.txt
  57. +168 −0 examples/tutorial/AT4/src/main.c
  58. +1 −0 examples/tutorial/AT4/src/test_object.c
  59. +1 −0 examples/tutorial/AT4/src/test_object.h
  60. +4 −4 examples/tutorial/BT1/CMakeLists.txt
  61. +4 −4 examples/tutorial/BT2/CMakeLists.txt
  62. +4 −4 examples/tutorial/BT3/CMakeLists.txt
  63. +3 −0 examples/tutorial/CMakeLists.txt
  64. +1 −0 examples/tutorial/custom-object/CMakeLists.txt
  65. +13 −0 examples/tutorial/custom-object/bootstrap-awareness/CMakeLists.txt
  66. +318 −0 examples/tutorial/custom-object/bootstrap-awareness/src/main.c
  67. +26 −17 include_modules/anjay_modules/dm.h
  68. +21 −9 include_public/anjay/anjay.h
  69. +14 −0 ltoconfig
  70. +14 −0 modules/access_control/CMakeLists.txt
  71. +1 −1 modules/access_control/include_public/anjay/access_control.h
  72. +14 −0 modules/attr_storage/CMakeLists.txt
  73. +5 −5 modules/attr_storage/include_public/anjay/attr_storage.h
  74. +171 −123 modules/attr_storage/src/attr_storage.c
  75. +33 −4 modules/attr_storage/src/attr_storage.h
  76. +38 −13 modules/attr_storage/src/persistence.c
  77. +119 −152 modules/attr_storage/src/test/attr_storage.c
  78. +33 −28 modules/attr_storage/src/test/attr_storage_test.h
  79. +22 −50 modules/attr_storage/src/test/persistence.c
  80. +14 −0 modules/module_common.cmake
  81. +14 −0 modules/persistence/CMakeLists.txt
  82. +14 −0 modules/security/CMakeLists.txt
  83. +1 −1 modules/security/include_public/anjay/security.h
  84. +14 −0 modules/server/CMakeLists.txt
  85. +12 −9 src/anjay.c
  86. +21 −23 src/coap/msg_info.c
  87. +18 −12 src/coap/msg_info.h
  88. +18 −30 src/coap/opt.c
  89. +8 −8 src/coap/opt.h
  90. +19 −6 src/coap/stream.h
  91. +2 −2 src/coap/stream/out.c
  92. +13 −13 src/coap/stream/server.c
  93. +43 −35 src/coap/stream/stream.c
  94. +6 −6 src/coap/test/msg_builder.c
  95. +3 −3 src/coap/test/servers.c
  96. +2 −2 src/coap/test/stream.c
  97. +51 −18 src/dm.c
  98. +4 −1 src/dm.h
  99. +19 −41 src/dm/attributes.c
  100. +7 −17 src/dm/attributes.h
  101. +15 −14 src/dm/discover.c
  102. +5 −5 src/dm/discover.h
  103. +2 −2 src/dm/handlers.c
  104. +13 −4 src/interface/bootstrap.c
  105. +4 −4 src/interface/register.c
  106. +49 −0 src/interface/test/bootstrap.c
  107. +2 −2 src/io/tlv_in.c
  108. +14 −13 src/observe.c
  109. +5 −5 src/servers/connection_info.c
  110. +18 −28 src/test/anjay.c
  111. +133 −154 src/test/dm.c
  112. +2 −5 src/test/mock_coap_stream.h
  113. +29 −26 src/test/mock_coap_stream_impl.h
  114. +42 −26 src/test/observe.c
  115. +46 −0 src/test/utils.c
  116. +18 −4 test/fuzz/CMakeLists.txt
  117. +3 −0 test/fuzz/coap/stream.c
  118. +3 −0 test/fuzz/coap/stream_request.c
  119. +3 −0 test/fuzz/coap/stream_response.c
  120. +1 −1 test/include/anjay_test/dm.h
  121. +9 −4 test/include/anjay_test/mock_dm.h
  122. +24 −3 test/integration/CMakeLists.txt
  123. +15 −0 test/integration/framework/__init__.py
  124. +27 −12 test/integration/framework/asserts.py
  125. +22 −7 test/integration/framework/firmware_package.py
  126. +16 −0 test/integration/framework/lwm2m_test.py
  127. +15 −0 test/integration/framework/nsh-lwm2m/lwm2m/__init__.py
  128. +26 −0 test/integration/framework/nsh-lwm2m/lwm2m/coap/__init__.py
  129. +19 −1 test/integration/framework/nsh-lwm2m/lwm2m/coap/code.py
  130. +18 −0 test/integration/framework/nsh-lwm2m/lwm2m/coap/content_format.py
  131. +49 −21 test/integration/framework/nsh-lwm2m/lwm2m/coap/option.py
  132. +43 −18 test/integration/framework/nsh-lwm2m/lwm2m/coap/packet.py
  133. +28 −11 test/integration/framework/nsh-lwm2m/lwm2m/coap/server.py
  134. +18 −0 test/integration/framework/nsh-lwm2m/lwm2m/coap/type.py
  135. +18 −0 test/integration/framework/nsh-lwm2m/lwm2m/coap/utils.py
  136. +153 −111 test/integration/framework/nsh-lwm2m/lwm2m/messages.py
  137. +22 −1 test/integration/framework/nsh-lwm2m/lwm2m/path.py
  138. +18 −1 test/integration/framework/nsh-lwm2m/lwm2m/server.py
  139. +36 −17 test/integration/framework/nsh-lwm2m/lwm2m/tlv.py
  140. +21 −5 test/integration/framework/nsh-lwm2m/pymbedtls/setup.py
  141. +16 −0 test/integration/framework/nsh-lwm2m/pymbedtls/src/pymbedtls.cpp
  142. +31 −11 test/integration/framework/pretty_test_runner.py
  143. +30 −10 test/integration/framework/test_suite.py
  144. +25 −5 test/integration/framework/test_utils.py
  145. +27 −8 test/integration/runtest.py
  146. +15 −0 test/integration/suites/__init__.py
  147. +15 −0 test/integration/suites/default/__init__.py
  148. +23 −6 test/integration/suites/default/access_control.py
  149. +35 −6 test/integration/suites/default/block_response.py
  150. +48 −18 test/integration/suites/default/block_write.py
  151. +25 −7 test/integration/suites/default/bootstrap_client.py
  152. +38 −19 test/integration/suites/default/bootstrap_discover.py
  153. +17 −1 test/integration/suites/default/bootstrap_factory.py
  154. +22 −4 test/integration/suites/default/bootstrap_server.py
  155. +16 −0 test/integration/suites/default/bootstrap_sync.py
  156. +17 −0 test/integration/suites/default/bootstrap_transaction.py
  157. +35 −10 test/integration/suites/default/buffer_sizes.py
  158. +26 −15 test/integration/suites/default/client_block_request.py
  159. +21 −5 test/integration/suites/default/crash.py
  160. +16 −0 test/integration/suites/default/create.py
  161. +17 −0 test/integration/suites/default/critical_opts.py
  162. +18 −1 test/integration/suites/default/disable_server.py
  163. +23 −6 test/integration/suites/default/empty.py
  164. +35 −12 test/integration/suites/default/firmware_update.py
  165. +18 −2 test/integration/suites/default/modify_servers.py
  166. +23 −57 test/integration/suites/default/observe_attributes.py
  167. +26 −6 test/integration/suites/default/offline.py
  168. +28 −3 test/integration/suites/default/plaintext_base64.py
  169. +17 −0 test/integration/suites/default/reboot.py
  170. +44 −25 test/integration/suites/default/register.py
  171. +17 −2 test/integration/suites/default/request_too_large.py
  172. +20 −3 test/integration/suites/default/separate_response.py
  173. +27 −7 test/integration/suites/default/test_object.py
  174. +23 −2 test/integration/suites/default/update.py
  175. +18 −3 test/integration/suites/default/uri_change_update.py
  176. +15 −0 test/integration/suites/long/__init__.py
  177. +31 −15 test/integration/suites/long/register.py
  178. +26 −9 test/integration/suites/long/update.py
  179. +15 −0 test/integration/suites/testfest/__init__.py
  180. +15 −0 test/integration/suites/testfest/dm/__init__.py
  181. +17 −0 test/integration/suites/testfest/dm/connectivity_monitoring.py
  182. +16 −1 test/integration/suites/testfest/dm/connectivity_statistics.py
  183. +16 −0 test/integration/suites/testfest/dm/device.py
  184. +22 −6 test/integration/suites/testfest/dm/firmware_update.py
  185. +18 −3 test/integration/suites/testfest/dm/location.py
  186. +21 −6 test/integration/suites/testfest/dm/server.py
  187. +28 −11 test/integration/suites/testfest/dm/utils.py
  188. +30 −6 test/integration/suites/testfest/management.py
  189. +29 −8 test/integration/suites/testfest/register.py
  190. +17 −4 test/integration/suites/testfest/reporting.py
  191. +20 −6 test/integration/suites/testfest/security.py
  192. +30 −21 test/src/mock_dm.c
  193. +16 −0 test_duplicates.py
  194. +15 −0 test_symbols.sh
  195. +15 −0 test_visibility.sh
  196. +14 −0 tools/CMakeLists.txt
  197. +157 −0 tools/check-license-headers.py
  198. +0 −35 tools/chex
  199. +17 −0 tools/coverage
  200. +2 −2 tools/dtls_echo.c
  201. +23 −3 tools/generate-certs.sh
  202. +0 −103 tools/import-certs.sh
  203. +14 −0 tools/utils.sh
View
@@ -4,10 +4,6 @@
*.so.*
/demo/demo
# generated files
/certs
/demo/ssl_key.h
# NetBeans Project
nbproject
@@ -16,8 +12,7 @@ nbproject
# build configuration autogenerated files
/build
/bin
/lib
/output
*.swp
CMakeFiles/
CMakeTmp/
@@ -44,8 +39,6 @@ Makefile
tags
.ycm_extra_conf.py
.ycm_extra_conf.pyc
/test/fuzz/findings
/test/fuzz/bin
/test/integration/build
__pycache__/
.gdb_history
View
@@ -1,21 +1,38 @@
# Copyright 2017 AVSystem <avsystem@avsystem.com>
#
# Licensed 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.
cmake_minimum_required(VERSION 2.8.8)
option(WITH_FUZZ_TESTS "Compile fuzz tests using the AFL fuzzer" OFF)
if(WITH_FUZZ_TESTS)
if(AFL_FUZZER_DIR)
set(CMAKE_C_COMPILER "${AFL_FUZZER_DIR}/afl-gcc")
set(AFL_FUZZ_EXECUTABLE "${AFL_FUZZER_DIR}/afl-fuzz")
else()
set(CMAKE_C_COMPILER "afl-gcc")
set(AFL_FUZZ_EXECUTABLE "afl-fuzz")
endif()
endif()
project(anjay C)
set(ANJAY_VERSION "1.0.0" CACHE STRING "Anjay library version")
set(ANJAY_VERSION "##version##" CACHE STRING "Anjay library version")
set(ANJAY_BINARY_VERSION 1.0.0)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/lib")
set(ANJAY_BUILD_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/output")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${ANJAY_BUILD_OUTPUT_DIR}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${ANJAY_BUILD_OUTPUT_DIR}/lib")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${ANJAY_BUILD_OUTPUT_DIR}/lib")
# new policy in CMake 2.8.12 for link interface
if(NOT CMAKE_VERSION VERSION_LESS "2.8.12")
@@ -45,8 +62,8 @@ option(WITH_LIBRARY_SHARED "Compile Anjay as shared library" ON)
option(WITH_ACCESS_CONTROL "Enable core support for Access Control mechanism" ON)
option(WITH_BLOCK_RECEIVE "Enable support for receiving CoAP BLOCK transfers" ON)
option(WITH_BLOCK_SEND "Enable support for sending data in CoAP BLOCK mode" ON)
option(WITH_BOOTSTRAP "Enable LWM2M Bootstrap Interface support" ON)
option(WITH_DISCOVER "Enable support for LWM2M Discover operation" ON)
option(WITH_BOOTSTRAP "Enable LwM2M Bootstrap Interface support" ON)
option(WITH_DISCOVER "Enable support for LwM2M Discover operation" ON)
option(WITH_OBSERVE "Enable support for Information Reporting interface (Observe)" ON)
option(WITH_LEGACY_CONTENT_FORMAT_SUPPORT
"Enable support for pre-LwM2M 1.0 CoAP Content-Format values (1541-1543)" OFF)
@@ -127,7 +144,6 @@ set(CORE_SOURCES
src/io/tlv_out.c
src/dm.c
src/dm/attributes.c
src/dm/common.c
src/dm/execute.c
src/dm/handlers.c
src/dm/query.c
@@ -384,9 +400,10 @@ anjay_emit_deps(${PROJECT_NAME}_static ${DEPS_LIBRARIES} ${DEPS_LIBRARIES_WEAK})
if(WITH_DEMO)
find_program(OPENSSL_EXECUTABLE openssl)
if(OPENSSL_EXECUTABLE)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/demo/ssl_key.h")
if(NOT EXISTS "${ANJAY_BUILD_OUTPUT_DIR}/certs/client.crt.der")
execute_process(COMMAND
"${CMAKE_CURRENT_SOURCE_DIR}/tools/generate-certs.sh"
"${ANJAY_BUILD_OUTPUT_DIR}/certs"
RESULT_VARIABLE RES)
if(NOT ${RES} EQUAL 0)
message(FATAL_ERROR "could not generate SSL certificates")
@@ -418,13 +435,13 @@ macro(add_anjay_test NAME)
"-Wno-pedantic -Wno-overlength-strings")
if(VALGRIND)
set(VALGRIND_LOG ${VALGRIND} --log-file=VALGRIND.${NAME}.log)
set(VALGRIND_LOG ${VALGRIND} --log-file=${ANJAY_BUILD_OUTPUT_DIR}/VALGRIND.${NAME}.log)
else()
set(VALGRIND_LOG)
endif()
add_test(NAME ${NAME}_test
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND ${VALGRIND_LOG} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${NAME}_test)
add_custom_target(${NAME}_check COMMAND ${CMAKE_CTEST_COMMAND} -R "^${NAME}_test$$" -V DEPENDS ${NAME}_test)
@@ -513,11 +530,11 @@ if(WITH_FUZZ_TESTS)
message(STATUS "Adding fuzz test target: fuzz_${FUZZ_TEST_NAME}: ${${FUZZ_TEST_ARG_LIST_NAME}}")
add_custom_target(fuzz_${FUZZ_TEST_NAME}
COMMAND mkdir -p "${FUZZ_TEST_FINDINGS_DIR}"
COMMAND "${AFL_FUZZER_DIR}/afl-fuzz" -i "${FUZZ_TEST_CASE_DIR}"
-o "${FUZZ_TEST_FINDINGS_DIR}"
-t ${AFL_FUZZ_TIMEOUT_MS}
"${${FUZZ_TEST_ARG_LIST_NAME}}"
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/test/fuzz")
COMMAND "${AFL_FUZZ_EXECUTABLE}" -i "${FUZZ_TEST_CASE_DIR}"
-o "${FUZZ_TEST_FINDINGS_DIR}"
-t ${AFL_FUZZ_TIMEOUT_MS}
"${${FUZZ_TEST_ARG_LIST_NAME}}"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/test/fuzz")
endforeach()
endif()
@@ -532,13 +549,14 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/source/conf.py.in")
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/sphinx.cmake)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/source/conf.py.in
${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/source/conf.py
${ANJAY_BUILD_OUTPUT_DIR}/doc/sphinx/conf.py
@ONLY)
add_custom_target(doc_sphinx
COMMAND ${SPHINX_BUILD_EXECUTABLE}
-b html
-c ${ANJAY_BUILD_OUTPUT_DIR}/doc/sphinx
${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/source
${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/html
${ANJAY_BUILD_OUTPUT_DIR}/doc/sphinx/html
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx)
add_dependencies(doc doc_sphinx)
@@ -547,8 +565,9 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/source/conf.py.in")
add_test(NAME test_examples
COMMAND ${SPHINX_BUILD_EXECUTABLE}
-Q -b snippet_source_lint
-c ${ANJAY_BUILD_OUTPUT_DIR}/doc/sphinx
${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/source
${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx/build/lint
${ANJAY_BUILD_OUTPUT_DIR}/doc/sphinx/lint
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/doc/sphinx)
endif()
@@ -560,12 +579,14 @@ if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in")
# semicolon-separated strings
string(REPLACE ";" " " DOXYGEN_INPUT_PATHS "${DOXYGEN_INPUT_PATHS}")
set(DOXYGEN_OUTPUT_DIR ${ANJAY_BUILD_OUTPUT_DIR}/doc/doxygen)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in
${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile
${ANJAY_BUILD_OUTPUT_DIR}/doc/doxygen/Doxyfile
@ONLY)
add_custom_target(doc_doxygen
COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile
COMMAND ${DOXYGEN_EXECUTABLE} ${ANJAY_BUILD_OUTPUT_DIR}/doc/doxygen/Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
@@ -577,32 +598,32 @@ endif()
################# EXAMPLES #####################################################
set(TUTORIALS_BUILD_DIR "${CMAKE_BINARY_DIR}/examples/build")
set(TUTORIALS_ANJAY_BUILD_DIR "${TUTORIALS_BUILD_DIR}/anjay-build")
set(TUTORIALS_ANJAY_INSTALL_DIR "${TUTORIALS_BUILD_DIR}/anjay")
set(ANJAY_EXAMPLES_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/examples/build")
set(ANJAY_TUTORIALS_ANJAY_BUILD_DIR "${ANJAY_EXAMPLES_BUILD_DIR}/anjay-build")
set(ANJAY_TUTORIALS_ANJAY_INSTALL_DIR "${ANJAY_EXAMPLES_BUILD_DIR}/anjay")
add_custom_target(examples)
add_custom_command(TARGET examples
COMMAND ${CMAKE_COMMAND} -E make_directory "${TUTORIALS_BUILD_DIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${TUTORIALS_ANJAY_INSTALL_DIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${TUTORIALS_ANJAY_BUILD_DIR}")
COMMAND ${CMAKE_COMMAND} -E make_directory "${ANJAY_EXAMPLES_BUILD_DIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${ANJAY_TUTORIALS_ANJAY_INSTALL_DIR}"
COMMAND ${CMAKE_COMMAND} -E make_directory "${ANJAY_TUTORIALS_ANJAY_BUILD_DIR}")
add_custom_command(TARGET examples
COMMAND ${CMAKE_COMMAND}
-H${CMAKE_CURRENT_SOURCE_DIR}
-B.
-DCMAKE_INSTALL_PREFIX="${TUTORIALS_ANJAY_INSTALL_DIR}"
-DCMAKE_INSTALL_PREFIX="${ANJAY_TUTORIALS_ANJAY_INSTALL_DIR}"
COMMAND ${CMAKE_COMMAND} --build . --target install -- -j$(nproc)
WORKING_DIRECTORY ${TUTORIALS_ANJAY_BUILD_DIR})
WORKING_DIRECTORY ${ANJAY_TUTORIALS_ANJAY_BUILD_DIR})
add_custom_command(TARGET examples
COMMAND ${CMAKE_COMMAND}
-H${CMAKE_CURRENT_SOURCE_DIR}/examples/tutorial/
-B.
-DCMAKE_PREFIX_PATH="${TUTORIALS_ANJAY_INSTALL_DIR}"
-DCMAKE_PREFIX_PATH="${ANJAY_TUTORIALS_ANJAY_INSTALL_DIR}"
-DCMAKE_RUNTIME_OUTPUT_DIRECTORY="${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/examples"
COMMAND ${CMAKE_COMMAND} --build . -- -j$(nproc)
WORKING_DIRECTORY "${TUTORIALS_BUILD_DIR}")
WORKING_DIRECTORY "${ANJAY_EXAMPLES_BUILD_DIR}")
add_dependencies(check examples)
@@ -631,14 +652,14 @@ endforeach()
# install CMake package
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/anjay-config.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}-config.cmake
${ANJAY_BUILD_OUTPUT_DIR}/cmake/${PROJECT_NAME}-config.cmake
@ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/anjay-version.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}-version.cmake
${ANJAY_BUILD_OUTPUT_DIR}/cmake/${PROJECT_NAME}-version.cmake
@ONLY)
install(EXPORT ${PROJECT_NAME}-targets DESTINATION ${LIB_INSTALL_DIR}/${PROJECT_NAME})
install(FILES
${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}-config.cmake
${CMAKE_CURRENT_BINARY_DIR}/cmake/${PROJECT_NAME}-version.cmake
${ANJAY_BUILD_OUTPUT_DIR}/cmake/${PROJECT_NAME}-config.cmake
${ANJAY_BUILD_OUTPUT_DIR}/cmake/${PROJECT_NAME}-version.cmake
DESTINATION ${LIB_INSTALL_DIR}/${PROJECT_NAME})
View
@@ -1,3 +1,18 @@
..
Copyright 2017 AVSystem <avsystem@avsystem.com>
Licensed 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.
Contributing to Anjay
=====================
View
@@ -52,7 +52,7 @@ PROJECT_LOGO =
# If a relative path is entered, it will be relative to the location
# where doxygen was started. If left blank the current directory will be used.
OUTPUT_DIRECTORY = doc/doxygen
OUTPUT_DIRECTORY = @DOXYGEN_OUTPUT_DIR@
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
# 4096 sub-directories (in 2 levels) under the output directory of each output
View
@@ -1,4 +1,4 @@
# Anjay LWM2M library [<img align="right" height="50px" src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSoiMy6rnzARUEdR0OjHmPGxTeiAMLBFlUYwIB9baWYWmuUwTbo">](http://www.avsystem.com/)
# Anjay LwM2M library [<img align="right" height="50px" src="https://encrypted-tbn2.gstatic.com/images?q=tbn:ANd9GcSoiMy6rnzARUEdR0OjHmPGxTeiAMLBFlUYwIB9baWYWmuUwTbo">](http://www.avsystem.com/)
## What is Anjay?
@@ -73,7 +73,7 @@ More details about OMA LwM2M: [Brief introduction to LwM2M](https://AVSystem.git
### "One"-liner for Ubuntu 16.04 LTS
To install all necessary packages, compile Anjay demo client and connect it to a local LWM2M server listening on default 5683 port:
To install all necessary packages, compile Anjay demo client and connect it to a local LwM2M server listening on default 5683 port:
``` sh
sudo apt-get install git build-essential gcc cmake libmbedtls-dev \
@@ -82,7 +82,7 @@ sudo apt-get install git build-essential gcc cmake libmbedtls-dev \
&& git submodule update --init \
&& cmake . \
&& make -j$(nproc) \
&& ./bin/demo --server-uri coap://127.0.0.1:5683
&& ./output/bin/demo --server-uri coap://127.0.0.1:5683
```
### Dependencies
@@ -112,18 +112,18 @@ To compile the library and demo application:
cmake . && make -j$(nproc)
```
Compiled executables, including demo client, can be found in bin subdirectory.
Compiled executables, including demo client, can be found in output/bin subdirectory.
For a detailed guide on configuring and compiling the project (including cross-compiling), see [Compiling client applications](https://AVSystem.github.io/Anjay-doc/Compiling_client_applications.html).
To start the demo client:
``` sh
# uses plain CoAP
./bin/demo --server-uri coap://127.0.0.1:5683
./output/bin/demo --server-uri coap://127.0.0.1:5683
# uses DTLS in PSK mode, with PSK identity "foo" and secret key "bar" (hex-encoded)
./bin/demo --server-uri coaps://127.0.0.1:5684 --security-mode psk --identity 666f6f --key 626172
./output/bin/demo --server-uri coaps://127.0.0.1:5684 --security-mode psk --identity 666f6f --key 626172
```
**NOTE**: When establishing a DTLS connection, the URI MUST use "coaps://". In NoSec mode (default), the URI MUST use "<coap://>".
@@ -1,3 +1,17 @@
# Copyright 2017 AVSystem <avsystem@avsystem.com>
#
# Licensed 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(ANJAY_VERSION "@ANJAY_VERSION@")
get_filename_component(CURR_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
@@ -1,3 +1,17 @@
# Copyright 2017 AVSystem <avsystem@avsystem.com>
#
# Licensed 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(PACKAGE_VERSION "@ANJAY_VERSION@")
if (${PACKAGE_VERSION} VERSION_LESS ${PACKAGE_FIND_VERSION})
View
@@ -1,3 +1,17 @@
# Copyright 2017 AVSystem <avsystem@avsystem.com>
#
# Licensed 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.
macro(anjay_emit_deps TNAME)
list(APPEND ANJAY_TARGET_DEPS_${TNAME} ${ARGN})
endmacro()
View
@@ -1,3 +1,17 @@
# Copyright 2017 AVSystem <avsystem@avsystem.com>
#
# Licensed 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.
function(sphinx_generate
OUTBASE
OUTTITLE
Oops, something went wrong.

0 comments on commit 9039006

Please sign in to comment.