Skip to content

Commit

Permalink
Anjay 3.5.0
Browse files Browse the repository at this point in the history
BREAKING CHANGES
- Reversed the order of calling the ``delivery_handler`` callback vs. canceling
  the observation when sending notifications with 4.xx or 5.xx code; this change
  is breaking only for direct users of ``avs_coap`` API

Features
- Added APIs for suspending and resuming standalone downloads as well as
  Firmware Update and Advanced Firmware Update PULL-mode downloads
- Added standalone versions of the Security and Server object implementations,
  that can be customized by the end users
- Added definitions for common Core Object IDs in the public API
- Removed potentially faulty assertion in code generated by anjay_codegen.py
- (commercial feature only) added ``anjay_sim_bootstrap_calculate_md5()``
  function that allows verification whether SIM Bootstrap data has been changed
  (e.g. as a result of SIM OTA)

Improvements
- Rewritten Send-based reporting in Advanced Firmware Update in such a way that
  it will now work with custom implementations of the Server object
- Simplified the CoAP downloader implementation so that the
  ``get_remote_hostname`` socket operation is no longer necessary for download
  resumption
- Made handling of initial peer CSM messages in CoAP+TCP asynchronous
- Updated the documentation with more descriptive warnings about functions that
  require extra care to maintain thread safety
- Removed ``const`` qualifier from ``MAKE_URI_PATH()`` compound literal which
  triggers a plausible compiler bug on IAR EWARM v9.30

Bugfixes
- Fixed a critical bug that caused Anjay to crash when sending notifications
  with 4.xx or 5.xx code over TCP
- Fixed a regression introduced in 2.13.0 that prevented the Firmware Update
  and Advanced Firmware Update from compiling without the
  ``ANJAY_WITH_DOWNLOADER`` configuration option enabled
- Fixed a condition where the Register or Update messages could be erroneously
  regenerated when refreshing server connections while already performing a
  Register or Update request
- Fixed a condition where the connection could be erroneously retried
  automatically when a fatal failure was expected
- Decoupled the ``WITH_AVS_COAP_TCP`` and ``ANJAY_WITH_LWM2M11`` configuration
  options so that they can be set independently as intended
- Fixed the ``devconfig`` script and Github Actions configuration for better
  compatibility with building on macOS
- Refactored TCP binding handling in integration tests for more reliability
- Fixed the case where CoAP+TCP Abort message could erroneously be sent multiple
  times
- Loosened some time constraints in Advanced Firmware Update tests
- Fixed supplemental iid sort in Advanced Firmware Update
- Fixed too early restart while performing an upgrade using Advanced Firmware
  Update module in Anjay demo app
- Fixed too early persistence write while performing an upgrade using Advanced
  Firmware Update module in Anjay demo app
  • Loading branch information
Kucmasz committed Sep 7, 2023
1 parent a92b146 commit 0acafc4
Show file tree
Hide file tree
Showing 139 changed files with 9,800 additions and 1,202 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/anjay-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on: [push]
jobs:
ubuntu1804-compilers-test:
runs-on: ubuntu-latest
container: avsystemembedded/anjay-travis:ubuntu-18.04-1.1
container: avsystemembedded/anjay-travis:ubuntu-18.04-1.2
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
Expand All @@ -37,7 +37,7 @@ jobs:

ubuntu2004-compilers-test:
runs-on: ubuntu-latest
container: avsystemembedded/anjay-travis:ubuntu-20.04-1.1
container: avsystemembedded/anjay-travis:ubuntu-20.04-1.2
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:

ubuntu2204-compilers-test:
runs-on: ubuntu-latest
container: avsystemembedded/anjay-travis:ubuntu-22.04-1.1
container: avsystemembedded/anjay-travis:ubuntu-22.04-1.2
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:

rockylinux9-compilers-test:
runs-on: ubuntu-latest
container: avsystemembedded/anjay-travis:rockylinux-9-1.1
container: avsystemembedded/anjay-travis:rockylinux-9-1.2
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
CXX: clang++

macOS-compilers-test:
runs-on: macos-11
runs-on: macos-12
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
Expand All @@ -149,12 +149,14 @@ jobs:
with:
submodules: recursive
- run: brew update
# NOTE: latest known compatible versions are [email protected] and mbedtls--3.2.1
- run: brew install openssl mbedtls $COMPILER_VERSION
- run: pip3 install sphinx sphinx-rtd-theme cbor2 aiocoap cryptography packaging requests wheel
# NOTE: latest known compatible versions are [email protected] and mbedtls--3.4.0
# NOTE: try the brew install command twice to work around "brew link" errors
- run: INSTALL_CMD="brew install openssl mbedtls $COMPILER_VERSION"; $INSTALL_CMD || $INSTALL_CMD
# NOTE: The above command may have installed a new version of Python, that's why we launch it weirdly
- run: /usr/bin/env python3 -m pip install sphinx sphinx-rtd-theme linuxdoc cbor2 aiocoap cryptography packaging requests wheel
- run: env JAVA_HOME="$JAVA_HOME_17_X64" ./devconfig --with-asan --without-analysis --no-examples -DWITH_VALGRIND_TRACK_ORIGINS=OFF -DWITH_URL_CHECK=OFF -DWITH_IPV6=OFF
- run: LC_ALL=C.UTF-8 make -j
- run: LC_ALL=C.UTF-8 make check
- run: LC_ALL=en_US.UTF-8 make -j
- run: LC_ALL=en_US.UTF-8 make check
strategy:
fail-fast: false
matrix:
Expand Down
59 changes: 59 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,64 @@
# Changelog

## 3.5.0 (September 7th, 2023)

### BREAKING CHANGES

- Reversed the order of calling the ``delivery_handler`` callback vs. canceling
the observation when sending notifications with 4.xx or 5.xx code; this change
is breaking only for direct users of ``avs_coap`` API

### Features

- Added APIs for suspending and resuming standalone downloads as well as
Firmware Update and Advanced Firmware Update PULL-mode downloads
- Added standalone versions of the Security and Server object implementations,
that can be customized by the end users
- Added definitions for common Core Object IDs in the public API
- Removed potentially faulty assertion in code generated by anjay_codegen.py
- (commercial feature only) added ``anjay_sim_bootstrap_calculate_md5()``
function that allows verification whether SIM Bootstrap data has been changed
(e.g. as a result of SIM OTA)

### Improvements

- Rewritten Send-based reporting in Advanced Firmware Update in such a way that
it will now work with custom implementations of the Server object
- Simplified the CoAP downloader implementation so that the
``get_remote_hostname`` socket operation is no longer necessary for download
resumption
- Made handling of initial peer CSM messages in CoAP+TCP asynchronous
- Updated the documentation with more descriptive warnings about functions that
require extra care to maintain thread safety
- Removed ``const`` qualifier from ``MAKE_URI_PATH()`` compound literal which
triggers a plausible compiler bug on IAR EWARM v9.30

### Bugfixes

- Fixed a critical bug that caused Anjay to crash when sending notifications
with 4.xx or 5.xx code over TCP
- Fixed a regression introduced in 2.13.0 that prevented the Firmware Update
and Advanced Firmware Update from compiling without the
``ANJAY_WITH_DOWNLOADER`` configuration option enabled
- Fixed a condition where the Register or Update messages could be erroneously
regenerated when refreshing server connections while already performing a
Register or Update request
- Fixed a condition where the connection could be erroneously retried
automatically when a fatal failure was expected
- Decoupled the ``WITH_AVS_COAP_TCP`` and ``ANJAY_WITH_LWM2M11`` configuration
options so that they can be set independently as intended
- Fixed the ``devconfig`` script and Github Actions configuration for better
compatibility with building on macOS
- Refactored TCP binding handling in integration tests for more reliability
- Fixed the case where CoAP+TCP Abort message could erroneously be sent multiple
times
- Loosened some time constraints in Advanced Firmware Update tests
- Fixed supplemental iid sort in Advanced Firmware Update
- Fixed too early restart while performing an upgrade using Advanced Firmware
Update module in Anjay demo app
- Fixed too early persistence write while performing an upgrade using Advanced
Firmware Update module in Anjay demo app

## 3.4.1 (June 23rd, 2023)

### Features
Expand Down
16 changes: 8 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
cmake_minimum_required(VERSION 3.6.0)

project(anjay C)
set(ANJAY_VERSION "3.4.1" CACHE STRING "Anjay library version")
set(ANJAY_VERSION "3.5.0" CACHE STRING "Anjay library version")
set(ANJAY_BINARY_VERSION 1.0.0)

set(ANJAY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down Expand Up @@ -105,7 +105,10 @@ set(ANJAY_DEFAULT_SEND_FORMAT AVS_COAP_FORMAT_NONE CACHE STRING

################# FEATURES THAT REQUIRE LIBRARY CONFIGURATION ##################

option(WITH_AVS_PERSISTENCE "Enable support for persisting objects data" ON)

option(WITH_BOOTSTRAP "Enable LwM2M Bootstrap Interface support" ON)
option(WITHOUT_TLV "Disable support for TLV content format" OFF)
option(WITH_DOWNLOADER "Enable support for downloader API" ON)
cmake_dependent_option(WITH_HTTP_DOWNLOAD "Enable support for HTTP(S) downloads" OFF "WITH_DOWNLOADER" OFF)
option(WITH_LWM2M11 "Enable support for LwM2M 1.1" ON)
Expand All @@ -128,6 +131,9 @@ endif()
if(WITH_AVS_PERSISTENCE)
list(APPEND AVS_COMMONS_COMPONENTS persistence)
endif()
if(WITH_MODULE_sim_bootstrap)
list(APPEND AVS_COMMONS_COMPONENTS stream_md5)
endif()
if(NOT DEFINED WITH_AVS_RBTREE OR WITH_AVS_RBTREE)
set(WITH_AVS_RBTREE ON CACHE INTERNAL "")
endif()
Expand Down Expand Up @@ -203,18 +209,13 @@ else()
message(STATUS "DTLS backend: ${_DTLS_BACKEND_LOWERCASE}")
endif()

if(NOT WITH_LWM2M11)
set(WITH_AVS_COAP_TCP OFF CACHE "" INTERNAL)
endif()

cmake_dependent_option(WITH_AVS_COAP_TCP "Enable CoAP over TCP support" ON WITH_LWM2M11 OFF)
option(WITH_AVS_COAP_TCP "Enable CoAP over TCP support" "${WITH_LWM2M11}")



set(ENABLE_ADVANCED_CRYPTO OFF)

option(WITH_AVS_LOG "Enable logging support" ON)
option(WITH_AVS_PERSISTENCE "Enable support for persisting objects data" ON)

if(NOT WITH_LOCAL_AVS_COMMONS)
set(WITH_SCHEDULER_THREAD_SAFE "${WITH_THREAD_SAFETY}" CACHE INTERNAL "")
Expand Down Expand Up @@ -264,7 +265,6 @@ cmake_dependent_option(WITH_CON_ATTR "Enable support for the Confirmable Notific
option(WITH_LEGACY_CONTENT_FORMAT_SUPPORT
"Enable support for pre-LwM2M 1.0 CoAP Content-Format values (1541-1543)" OFF)
option(WITH_LWM2M_JSON "Enable support for LwM2M 1.0 JSON (output only)" ON)
option(WITHOUT_TLV "Disable support for TLV content format" OFF)
option(WITHOUT_PLAINTEXT "Disable support for Plain Text content format" OFF)
option(WITHOUT_DEREGISTER "Disable use of the Deregister message" OFF)
option(WITHOUT_IP_STICKINESS "Disable support for IP stickiness" OFF)
Expand Down
16 changes: 16 additions & 0 deletions demo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
cmake_minimum_required(VERSION 3.1)
project(lwm2m_demo C)

option(WITH_DEMO_USE_STANDALONE_OBJECTS "Use standalone versions of built-in objects in demo" OFF)

set(SOURCES
demo.c
demo_args.c
Expand All @@ -29,6 +31,11 @@ set(SOURCES
objects/portfolio.c
objects/test.c)

if(WITH_DEMO_USE_STANDALONE_OBJECTS)
file(GLOB STANDALONE_SOURCES ../standalone/*/*.c)
set(SOURCES ${SOURCES} ${STANDALONE_SOURCES})
endif()

if (${ANJAY_WITH_MODULE_FW_UPDATE})
set(SOURCES ${SOURCES} firmware_update.c)
endif()
Expand All @@ -52,6 +59,11 @@ set(HEADERS
demo_utils.h
objects.h)

if(WITH_DEMO_USE_STANDALONE_OBJECTS)
file(GLOB STANDALONE_HEADERS ../standalone/*/*.h)
set(HEADERS ${HEADERS} ${STANDALONE_HEADERS})
endif()

if (${ANJAY_WITH_MODULE_FW_UPDATE})
set(HEADERS ${HEADERS} firmware_update.h)
endif()
Expand All @@ -71,6 +83,10 @@ find_package(Threads REQUIRED)
add_executable(demo ${ALL_SOURCES})
target_link_libraries(demo PRIVATE anjay m ${CMAKE_THREAD_LIBS_INIT})

if(WITH_DEMO_USE_STANDALONE_OBJECTS)
target_compile_definitions(demo PRIVATE WITH_DEMO_USE_STANDALONE_OBJECTS)
endif()


add_custom_target(demo_firmware
COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/../tests/integration/framework/firmware_package.py
Expand Down
19 changes: 14 additions & 5 deletions demo/advanced_firmware_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,9 @@ int fw_update_common_write(anjay_iid_t iid,
static int stream_finish(anjay_iid_t iid, void *fw_) {
advanced_fw_update_logic_t *fw_table = (advanced_fw_update_logic_t *) fw_;
advanced_fw_update_logic_t *fw = &fw_table[iid];
if (fw->auto_suspend) {
anjay_advanced_fw_update_pull_suspend(fw->anjay);
}
if (!fw->stream) {
demo_log(ERROR, "stream not open");
return -1;
Expand Down Expand Up @@ -937,6 +940,9 @@ void fw_update_common_reset(anjay_iid_t iid, void *fw_) {
conflicting_instances_count);
}
}
if (fw->auto_suspend) {
anjay_advanced_fw_update_pull_suspend(fw->anjay);
}
}

int fw_update_common_perform_upgrade(
Expand Down Expand Up @@ -1056,12 +1062,11 @@ int advanced_firmware_update_install(
const avs_coap_udp_tx_params_t *tx_params,
anjay_advanced_fw_update_result_t delayed_result,
bool prefer_same_socket_downloads,
const char *original_img_file_path
const char *original_img_file_path,
#ifdef ANJAY_WITH_SEND
,
bool use_lwm2m_send
bool use_lwm2m_send,
#endif // ANJAY_WITH_SEND
) {
bool auto_suspend) {
advanced_fw_update_logic_t *fw_logic_app = NULL;
int result = -1;

Expand Down Expand Up @@ -1167,7 +1172,8 @@ int advanced_firmware_update_install(
maybe_delete_firmware_file(fw_logic_app);
}
result = advanced_firmware_update_application_install(
anjay, fw_table, &state, security_info, tx_params);
anjay, fw_table, &state, security_info, tx_params,
auto_suspend);
if (result) {
demo_log(ERROR, "AFU instance %u install failed",
FW_UPDATE_IID_APP);
Expand Down Expand Up @@ -1211,6 +1217,9 @@ int advanced_firmware_update_install(
}

if (!result) {
if (auto_suspend) {
anjay_advanced_fw_update_pull_suspend(anjay);
}
demo_log(INFO, "AFU object install success");
}

Expand Down
12 changes: 7 additions & 5 deletions demo/advanced_firmware_update.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ struct advanced_fw_update_logic {
const char *persistence_file;
FILE *stream;
avs_net_security_info_t security_info;
avs_coap_udp_tx_params_t coap_tx_params;
bool auto_suspend;
int (*check_yourself)(struct advanced_fw_update_logic *);
int (*update_yourself)(struct advanced_fw_update_logic *);
avs_sched_handle_t update_job;
Expand All @@ -85,7 +87,8 @@ int advanced_firmware_update_application_install(
advanced_fw_update_logic_t *fw_logic,
anjay_advanced_fw_update_initial_state_t *init_state,
const avs_net_security_info_t *security_info,
const avs_coap_udp_tx_params_t *tx_params);
const avs_coap_udp_tx_params_t *tx_params,
bool auto_suspend);
int advanced_firmware_update_app_perform(advanced_fw_update_logic_t *fw);
const char *advanced_firmware_update_app_get_pkg_version(anjay_iid_t iid,
void *fw_);
Expand Down Expand Up @@ -114,12 +117,11 @@ int advanced_firmware_update_install(
const avs_coap_udp_tx_params_t *tx_params,
anjay_advanced_fw_update_result_t delayed_result,
bool prefer_same_socket_downloads,
const char *original_img_file_path
const char *original_img_file_path,
#ifdef ANJAY_WITH_SEND
,
bool use_lwm2m_send
bool use_lwm2m_send,
#endif // ANJAY_WITH_SEND
);
bool auto_suspend);

void advanced_firmware_update_uninstall(advanced_fw_update_logic_t *fw_table);
int fw_update_common_open(anjay_iid_t iid, void *fw_);
Expand Down
Loading

0 comments on commit 0acafc4

Please sign in to comment.