Skip to content

Commit

Permalink
Anjay 1.12.0
Browse files Browse the repository at this point in the history
Breaking changes:
- Updated AvsCommons to 3.8.0, which requires CMake 3.4.0 or higher. This
  means that Anjay requires CMake 3.4.0 or higher as well.
- Running tests requires grequests (https://github.com/kennethreitz/grequests)
  now

Features:
- Allowed configuration of UDP DTLS Handshake transmission parameters by
  anjay_configuration_t::udp_dtls_hs_tx_params field
- Allowed configuration of firmware download CoAP transmission parameters
  by anjay_fw_update_handlers_t::get_coap_tx_params handler implemented by
  the user
- Added sequence diagrams for library operations in documentation chapter
  "4.4. A few notes on general usage"

Improvements:
- Reformatted the entire codebase with clang-format
- Added more tests verifying demo client's behavior in situations with
  network connectivity issues
- Explained in the demo application why file descriptors other than 0, 1, 2,
  are being closed

Bugfixes:
- Fixed the cause of "could not stringify socket address" error
  • Loading branch information
Mateusz Krawiec committed Sep 21, 2018
1 parent 0410f8f commit 0c384fc
Show file tree
Hide file tree
Showing 228 changed files with 9,393 additions and 8,503 deletions.
22 changes: 22 additions & 0 deletions .clang-format
@@ -0,0 +1,22 @@
BasedOnStyle: llvm
AccessModifierOffset: -4
AlignEscapedNewlinesLeft: true
AlignOperands: true
AllowShortFunctionsOnASingleLine: Empty
AlwaysBreakTemplateDeclarations: true
AvoidMisleadingControlStatementContinuationIndent: true
BinPackParameters: false
BinPackArguments: true
BreakBeforeBinaryOperators: NonAssignment
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: false
IndentWidth: 4
PenaltyBreakBeforeFirstCallParameter: 40
SpaceAfterCStyleCast: true
TypenameMacros: ['AVS_LIST', 'AVS_RBTREE', 'AVS_RBTREE_ELEM', 'AVS_VECTOR']
BreakDesignatedInitializers: true
IndentPPDirectives: AfterHash
CommentPragmas: "AVSYSTEM_ANJAY_COMMERCIAL.*"
ExperimentalAutoDetectBinPacking: true
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -61,6 +61,7 @@ compile_commands.json
/doc/sphinx/build /doc/sphinx/build
/doc/sphinx/html /doc/sphinx/html
/doc/doxygen /doc/doxygen
/doc/sphinx/source/.doctrees
!/doc/sphinx/Makefile !/doc/sphinx/Makefile


# built tutorials # built tutorials
Expand Down
31 changes: 11 additions & 20 deletions CMakeLists.txt
Expand Up @@ -15,7 +15,7 @@
cmake_minimum_required(VERSION 2.8.12) cmake_minimum_required(VERSION 2.8.12)


project(anjay C) project(anjay C)
set(ANJAY_VERSION "1.11.0" CACHE STRING "Anjay library version") set(ANJAY_VERSION "1.12.0" CACHE STRING "Anjay library version")
set(ANJAY_BINARY_VERSION 1.0.0) set(ANJAY_BINARY_VERSION 1.0.0)


set(ANJAY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(ANJAY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down Expand Up @@ -75,9 +75,6 @@ endif()
include(${CMAKE_CURRENT_LIST_DIR}/cmake/PosixFeatures.cmake) include(${CMAKE_CURRENT_LIST_DIR}/cmake/PosixFeatures.cmake)


option(WITH_LIBRARY_SHARED "Compile Anjay as shared library" "${UNIX}") option(WITH_LIBRARY_SHARED "Compile Anjay as shared library" "${UNIX}")
cmake_dependent_option(WITH_STATIC_DEPS_LINKED
"Directly link shared library with its static dependencies such as avs_commons (e.g. for interpreted language bindings)"
OFF WITH_LIBRARY_SHARED OFF)


option(WITH_ACCESS_CONTROL "Enable core support for Access Control mechanism" ON) option(WITH_ACCESS_CONTROL "Enable core support for Access Control mechanism" ON)
option(WITH_ATTR_STORAGE "Enable Attribute storage module" ON) option(WITH_ATTR_STORAGE "Enable Attribute storage module" ON)
Expand All @@ -93,7 +90,7 @@ if(WITH_OBSERVE)
endif() endif()
option(WITH_LEGACY_CONTENT_FORMAT_SUPPORT option(WITH_LEGACY_CONTENT_FORMAT_SUPPORT
"Enable support for pre-LwM2M 1.0 CoAP Content-Format values (1541-1543)" OFF) "Enable support for pre-LwM2M 1.0 CoAP Content-Format values (1541-1543)" OFF)
option(WITH_JSON "Enable support for JSON content format (output only)" OFF) option(WITH_JSON "Enable support for JSON content format (output only)" ON)
option(WITH_AVS_PERSISTENCE "Enable support for persisting objects data" ON) option(WITH_AVS_PERSISTENCE "Enable support for persisting objects data" ON)




Expand Down Expand Up @@ -187,11 +184,12 @@ set(CORE_SOURCES
src/raw_buffer.c src/raw_buffer.c
src/sched.c src/sched.c
src/servers/activate.c src/servers/activate.c
src/servers/connection_info.c src/servers/connections.c
src/servers/connection_udp.c src/servers/connection_udp.c
src/servers/offline.c src/servers/offline.c
src/servers/register_internal.c src/servers/register_internal.c
src/servers/reload.c src/servers/reload.c
src/servers/server_connections.c
src/servers/servers_internal.c src/servers/servers_internal.c
src/servers_utils.c src/servers_utils.c
src/utils_core.c) src/utils_core.c)
Expand Down Expand Up @@ -227,7 +225,7 @@ if(WITH_OBSERVE)
src/observe/observe_core.c src/observe/observe_core.c
src/observe/observe_io.c) src/observe/observe_io.c)
endif() endif()
if(WITH_JSON) if(WITH_JSON OR WITH_SENML_JSON)
set(CORE_SOURCES ${CORE_SOURCES} set(CORE_SOURCES ${CORE_SOURCES}
src/io/json_out.c) src/io/json_out.c)
endif() endif()
Expand Down Expand Up @@ -268,10 +266,11 @@ set(CORE_PRIVATE_HEADERS
src/sched_internal.h src/sched_internal.h
src/servers.h src/servers.h
src/servers/activate.h src/servers/activate.h
src/servers/connection_info.h src/servers/connections.h
src/servers/connections_internal.h src/servers/connections_internal.h
src/servers/register_internal.h src/servers/register_internal.h
src/servers/reload.h src/servers/reload.h
src/servers/server_connections.h
src/servers/servers_internal.h src/servers/servers_internal.h
src/servers_utils.h src/servers_utils.h
src/utils_core.h) src/utils_core.h)
Expand Down Expand Up @@ -441,8 +440,6 @@ else()
add_subdirectory(avs_commons/git) add_subdirectory(avs_commons/git)
endif() endif()


set(DEPS_INCLUDE_DIRS ${DEPS_INCLUDE_DIRS} ${avs_commons_INCLUDE_DIRS})

if(WITH_AVS_LOG) if(WITH_AVS_LOG)
set(DEPS_LIBRARIES_WEAK ${DEPS_LIBRARIES_WEAK} avs_log) set(DEPS_LIBRARIES_WEAK ${DEPS_LIBRARIES_WEAK} avs_log)
endif() endif()
Expand All @@ -452,7 +449,6 @@ endif()
set(PUBLIC_INCLUDE_DIRS ${PUBLIC_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/include_public") set(PUBLIC_INCLUDE_DIRS ${PUBLIC_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/include_public")
set(MODULES_INCLUDE_DIRS ${MODULES_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/include_modules") set(MODULES_INCLUDE_DIRS ${MODULES_INCLUDE_DIRS} "${CMAKE_CURRENT_SOURCE_DIR}/include_modules")


include_directories(SYSTEM ${DEPS_INCLUDE_DIRS})
include_directories(${PUBLIC_INCLUDE_DIRS} include_directories(${PUBLIC_INCLUDE_DIRS}
${MODULES_INCLUDE_DIRS}) ${MODULES_INCLUDE_DIRS})


Expand Down Expand Up @@ -505,16 +501,11 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/config")


if(WITH_LIBRARY_SHARED) if(WITH_LIBRARY_SHARED)
add_library(${PROJECT_NAME} SHARED ${ABSOLUTE_SOURCES}) add_library(${PROJECT_NAME} SHARED ${ABSOLUTE_SOURCES})
if(WITH_STATIC_DEPS_LINKED) target_link_libraries(${PROJECT_NAME} PRIVATE ${DEPS_LIBRARIES})
target_link_libraries(${PROJECT_NAME} ${DEPS_LIBRARIES} ${DEPS_LIBRARIES_WEAK}) target_link_libraries(${PROJECT_NAME} PUBLIC ${DEPS_LIBRARIES_WEAK})
else()
target_link_libraries(${PROJECT_NAME} ${DEPS_LIBRARIES})
target_link_libraries(${PROJECT_NAME} LINK_INTERFACE_LIBRARIES ${DEPS_LIBRARIES_WEAK})
anjay_emit_deps(${PROJECT_NAME} ${DEPS_LIBRARIES_WEAK})
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${ANJAY_BINARY_VERSION}) VERSION ${ANJAY_BINARY_VERSION})
if(HAVE_VISIBILITY AND NOT WITH_STATIC_DEPS_LINKED) if(HAVE_VISIBILITY)
get_property(LINK_FLAGS TARGET ${PROJECT_NAME} PROPERTY LINK_FLAGS) get_property(LINK_FLAGS TARGET ${PROJECT_NAME} PROPERTY LINK_FLAGS)
set_property(TARGET ${PROJECT_NAME} PROPERTY LINK_FLAGS "${LINK_FLAGS} -Wl,--exclude-libs,ALL") set_property(TARGET ${PROJECT_NAME} PROPERTY LINK_FLAGS "${LINK_FLAGS} -Wl,--exclude-libs,ALL")
endif() endif()
Expand Down Expand Up @@ -659,7 +650,7 @@ if(WITH_TEST)
# Symbol validation # Symbol validation
add_custom_target(symbols_check COMMAND ${CMAKE_CTEST_COMMAND} -R "'^test_.*_symbols$$'" --output-on-failure) add_custom_target(symbols_check COMMAND ${CMAKE_CTEST_COMMAND} -R "'^test_.*_symbols$$'" --output-on-failure)


if(WITH_LIBRARY_SHARED AND NOT WITH_STATIC_DEPS_LINKED) if(WITH_LIBRARY_SHARED)
add_test(NAME test_so_symbols COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_symbols.sh $<TARGET_FILE:${PROJECT_NAME}> anjay_ ANJAY_) add_test(NAME test_so_symbols COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/test_symbols.sh $<TARGET_FILE:${PROJECT_NAME}> anjay_ ANJAY_)
add_dependencies(symbols_check ${PROJECT_NAME}) add_dependencies(symbols_check ${PROJECT_NAME})
endif() endif()
Expand Down
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -114,6 +114,7 @@ More details about OMA LwM2M: [Brief introduction to LwM2M](https://AVSystem.git
sudo apt-get install git build-essential cmake libmbedtls-dev zlib1g-dev sudo apt-get install git build-essential cmake libmbedtls-dev zlib1g-dev
# Optionally for tests: # Optionally for tests:
sudo apt-get install libpython3-dev libssl-dev python3 python3-cryptography python3-jinja2 python3-sphinx python3-requests clang valgrind clang-tools sudo apt-get install libpython3-dev libssl-dev python3 python3-cryptography python3-jinja2 python3-sphinx python3-requests clang valgrind clang-tools
pip3 install grequests
``` ```


#### CentOS 7 #### CentOS 7
Expand All @@ -129,7 +130,7 @@ sudo yum install -y valgrind valgrind-devel openssl openssl-devel python35u pyth
# Use update-alternatives to create a /usr/bin/python3 symlink with priority 0 # Use update-alternatives to create a /usr/bin/python3 symlink with priority 0
# (lowest possible) # (lowest possible)
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 0 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.5 0
sudo python3 -m pip install cryptography jinja2 requests sudo python3 -m pip install cryptography jinja2 requests grequests
``` ```


#### macOS Sierra with [Homebrew](https://brew.sh/) #### macOS Sierra with [Homebrew](https://brew.sh/)
Expand All @@ -138,7 +139,7 @@ sudo python3 -m pip install cryptography jinja2 requests
brew install cmake mbedtls brew install cmake mbedtls
# Optionally for tests: # Optionally for tests:
brew install python3 openssl llvm brew install python3 openssl llvm
pip3 install cryptography sphinx sphinx_rtd_theme requests pip3 install cryptography sphinx sphinx_rtd_theme requests grequests
``` ```


#### Windows #### Windows
Expand Down

0 comments on commit 0c384fc

Please sign in to comment.