Skip to content

Commit 80189c4

Browse files
committed
Anjay 3.8.1
Improvements - Improved the coverage script and switched to lcov. - In case when the LwM2M server answers with an RST message to a notification that is yielding an error value (e.g. failure to read), which effectively cancels the notification, Anjay is not infinitely trying to transmit that message with error value once again. New behavior is enabled by default, and controlled with `WITH_AVS_COAP_OBSERVE_FORCE_CANCEL_ON_UNACKED_ERROR` option of `avs_coap`. Existing projects have to opt-in explicitly. - Added `--nobest` flag to `dnf update` in Rockylinux image preparation for tests to solve installation candidates conflicts. Bugfixes - Actually fixed compatibility with Mbed TLS 3.6. - Fixed compatibility of integration test framework with Mbed TLS versions that enabled TLS 1.3, but didn't use `MBEDTLS_USE_PSA_CRYPTO`. - The -Wformat warning appearing in some compilers has been fixed. - Fixed LwM2M CBOR parser incorrectly accepting inputs containing empty arrays as keys - Prevent from generating non unique session tokens when the monotonic system clock granulation is not fine enough. - Refactored how timeouts are handled in pymbedtls to be in line with use of mbedTLS in avs_commons.
1 parent 3ba32ac commit 80189c4

File tree

106 files changed

+2682
-1003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+2682
-1003
lines changed

.github/workflows/anjay-tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- uses: actions/checkout@v1
122122
with:
123123
submodules: recursive
124-
- run: dnf update -y
124+
- run: dnf update -y --nobest
125125
- run: dnf install -y $CC
126126
# Solve issues with EPERM when running dumpcap
127127
- run: setcap '' $(which dumpcap)
@@ -149,9 +149,13 @@ jobs:
149149
with:
150150
submodules: recursive
151151
- run: brew update
152-
# NOTE: latest known compatible versions are [email protected] and mbedtls--3.4.0
153152
# NOTE: try the brew install command twice to work around "brew link" errors
154-
- run: INSTALL_CMD="brew install openssl mbedtls $COMPILER_VERSION"; $INSTALL_CMD || $INSTALL_CMD
153+
- run: INSTALL_CMD="brew install openssl $COMPILER_VERSION"; $INSTALL_CMD || $INSTALL_CMD
154+
# NOTE: Some tests don't pass on mbedTLS 3.6.2 now, so we need to install an older version
155+
# Homebrew only specifiers major version of mbedTLS, so let's pin the version to 3.6.0 manually
156+
- run: curl -f https://raw.githubusercontent.com/Homebrew/homebrew-core/219dabf6cab172fb8b62b4d8598e016e190c3c20/Formula/m/mbedtls.rb > /tmp/mbedtls.rb
157+
- run: brew install --formula /tmp/mbedtls.rb
158+
- run: brew pin mbedtls
155159
# NOTE: The above command may have installed a new version of Python, that's why we launch it weirdly
156160
- run: /usr/bin/env python3 -m pip install -r requirements.txt
157161
- 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

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ nbproject
1515

1616
# build configuration autogenerated files
1717
/build
18+
/coverage
1819
/output
1920
*.swp
2021
CMakeFiles/

CHANGELOG.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,32 @@
11
# Changelog
22

3+
## 3.8.1 (November 13th, 2024)
4+
5+
### Improvements
6+
7+
- Improved the coverage script and switched to lcov.
8+
- In case when the LwM2M server answers with an RST message to a notification
9+
that is yielding an error value (e.g. failure to read), which effectively
10+
cancels the notification, Anjay is not infinitely trying to transmit that
11+
message with error value once again. New behavior is enabled by default, and
12+
controlled with `WITH_AVS_COAP_OBSERVE_FORCE_CANCEL_ON_UNACKED_ERROR` option
13+
of `avs_coap`. Existing projects have to opt-in explicitly.
14+
- Added `--nobest` flag to `dnf update` in Rockylinux image preparation for
15+
tests to solve installation candidates conflicts.
16+
17+
### Bugfixes
18+
19+
- Actually fixed compatibility with Mbed TLS 3.6.
20+
- Fixed compatibility of integration test framework with Mbed TLS versions that
21+
enabled TLS 1.3, but didn't use `MBEDTLS_USE_PSA_CRYPTO`.
22+
- The -Wformat warning appearing in some compilers has been fixed.
23+
- Fixed LwM2M CBOR parser incorrectly accepting inputs containing empty arrays
24+
as keys
25+
- Prevent from generating non unique session tokens when the monotonic system
26+
clock granulation is not fine enough.
27+
- Refactored how timeouts are handled in pymbedtls to be in line with use of
28+
mbedTLS in avs_commons.
29+
330
## 3.8.0 (May 28th, 2024)
431

532
### BREAKING CHANGES

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
cmake_minimum_required(VERSION 3.6.0)
99

1010
project(anjay C)
11-
set(ANJAY_VERSION "3.8.0" CACHE STRING "Anjay library version")
11+
set(ANJAY_VERSION "3.8.1" CACHE STRING "Anjay library version")
1212
set(ANJAY_BINARY_VERSION 1.0.0)
1313

1414
set(ANJAY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
@@ -433,6 +433,8 @@ add_library(anjay
433433
src/core/io/anjay_cbor_out.c
434434
src/core/io/anjay_common.c
435435
src/core/io/anjay_common.h
436+
src/core/io/anjay_corelnk.c
437+
src/core/io/anjay_corelnk.h
436438
src/core/io/anjay_dynamic.c
437439
src/core/io/anjay_input_buf.c
438440
src/core/io/anjay_json_encoder.c
@@ -617,7 +619,7 @@ if(WITH_TEST)
617619
add_custom_target(check)
618620
add_custom_target(anjay_unit_check)
619621
add_dependencies(check anjay_unit_check)
620-
622+
621623
# anjay_test
622624
add_executable(anjay_test EXCLUDE_FROM_ALL
623625
$<TARGET_PROPERTY:anjay,SOURCES>

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ pip3 install -U -r requirements.txt
179179

180180
### Running the demo client
181181

182-
For initial development and testing of LwM2M clients, we recommend using the [Coiote IoT Device Management](https://www.avsystem.com/products/coiote-iot-device-management-platform/) where you can use the basic LwM2M server functionality for free.
182+
For initial development and testing of LwM2M clients, we recommend using the [Coiote IoT Device Management](https://avsystem.com/coiote-iot-device-management-platform/) where you can use the basic LwM2M server functionality for free.
183183

184184
After setting up an account and adding the device entry, you can compile Anjay demo client and connect it to the platform by running:
185185

@@ -322,11 +322,11 @@ See [LICENSE](LICENSE) file.
322322

323323
### Commercial support
324324

325-
Anjay LwM2M library comes with the option of [full commercial support, provided by AVSystem](https://www.avsystem.com/products/anjay/).
325+
Anjay LwM2M library comes with the option of [full commercial support, provided by AVSystem](https://avsystem.com/anjay-iot-sdk/).
326326

327327
The list of features available commercially is [available here](https://AVSystem.github.io/Anjay-doc/CommercialFeatures.html).
328328

329-
If you're interested in LwM2M Server, be sure to check out the [Coiote IoT Device Management](https://www.avsystem.com/products/coiote-iot-dm/) platform by AVSystem. It also includes the [interoperability test module](https://www.avsystem.com/lwm2m-interoperability-test/) that you can use to test your LwM2M client implementation. Our automated tests and testing scenarios enable you to quickly check how interoperable your device is with LwM2M.
329+
If you're interested in LwM2M Server, be sure to check out the [Coiote IoT Device Management](https://www.avsystem.com/products/coiote-iot-dm/) platform by AVSystem. It also includes the [interoperability test module](https://avsystem.com/coiote-iot-device-management-platform/lwm2m-interoperability-test/) that you can use to test your LwM2M client implementation. Our automated tests and testing scenarios enable you to quickly check how interoperable your device is with LwM2M.
330330

331331
## Contributing
332332

covconfig

Lines changed: 0 additions & 10 deletions
This file was deleted.

demo/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ if (${ANJAY_WITH_MODULE_FW_UPDATE})
4040
set(SOURCES ${SOURCES} firmware_update.c)
4141
endif()
4242

43+
4344
if (${ANJAY_WITH_MODULE_ADVANCED_FW_UPDATE})
4445
set(SOURCES ${SOURCES}
4546
advanced_firmware_update.c
@@ -52,6 +53,7 @@ if (${ANJAY_WITH_MODULE_SW_MGMT})
5253
set(SOURCES ${SOURCES} software_mgmt.c)
5354
endif()
5455

56+
5557
if(NOT WIN32)
5658
set(SOURCES ${SOURCES} objects/ip_ping.c)
5759
endif()

deps/avs_coap/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ _CPack_Packages/
3636
Testing/
3737
/cmake/avs_coap-config.cmake
3838
/build*
39+
/coverage/
3940
/examples/build
4041
/include_public/avsystem/coap/avs_coap_config.h
4142
/tools/__pycache__

deps/avs_coap/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ option(WITH_AVS_COAP_TCP "Enable CoAP over TCP support" ON)
3838
option(WITH_AVS_COAP_STREAMING_API "Enable streaming API" ON)
3939
option(WITH_AVS_COAP_OBSERVE "Enable support for observations" ON)
4040
option(WITH_AVS_COAP_OBSERVE_CANCEL_ON_TIMEOUT "Turn on cancelling observation on a timeout " OFF)
41+
option(WITH_AVS_COAP_OBSERVE_FORCE_CANCEL_ON_UNACKED_ERROR "Force cancelling observation on unacked error" ON)
4142
cmake_dependent_option(WITH_AVS_COAP_OBSERVE_PERSISTENCE "Enable observations persistence" ON "WITH_AVS_COAP_OBSERVE" OFF)
4243
option(WITH_AVS_COAP_BLOCK "Enable support for BLOCK/BERT transfers" ON)
4344

deps/avs_coap/include_public/avsystem/coap/avs_coap_config.h.in

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,18 @@
8080
*/
8181
#cmakedefine WITH_AVS_COAP_OBSERVE_CANCEL_ON_TIMEOUT
8282

83+
/**
84+
* Force cancelling observation, even if a confirmable notification yielding
85+
* an error response is not acknowledged or rejected with RST by the observer.
86+
*
87+
* This is a circumvention for some non-compliant servers that respond with an
88+
* RST message to a confirmable notification yielding an error response. This
89+
* setting makes the library cancel the observation in such cases, even though
90+
* the notification is formally rejected. Additionally, it will also make the
91+
* library cancel the observation if no response is received at all.
92+
*/
93+
#cmakedefine WITH_AVS_COAP_OBSERVE_FORCE_CANCEL_ON_UNACKED_ERROR
94+
8395
/**
8496
* Enable support for observation persistence (<c>avs_coap_observe_persist()</c>
8597
* and <c>avs_coap_observe_restore()</c> calls).

0 commit comments

Comments
 (0)