Skip to content

Commit

Permalink
Anjay 3.1.2
Browse files Browse the repository at this point in the history
Improvements:
- Reduced code size of the Security object implementation
- Updated documentation, readme and examples to mention the new EU IoT Cloud platform
- Migrated GitHub Actions tests to ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, fedora-36 and macos-11
Bugfixes:
- Fixed various compilation warnings
- Fixed avs_realloc() usage in anjay_event_loop.c
  • Loading branch information
Mateusz Kwiatkowski authored and JZimnol committed Aug 24, 2022
1 parent eb19dca commit 8fe0db0
Show file tree
Hide file tree
Showing 79 changed files with 468 additions and 274 deletions.
141 changes: 125 additions & 16 deletions .github/workflows/anjay-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
name: Anjay tests
on: [push]
jobs:
ubuntu1604-compilers-test:
ubuntu1804-compilers-test:
runs-on: ubuntu-latest
container: avsystemembedded/anjay-travis:ubuntu-16.04
container: avsystemembedded/anjay-travis:ubuntu-18.04
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
steps:
# NOTE: workaround for https://github.com/actions/checkout/issues/760
- run: git config --global safe.directory '*'
# NOTE: v2 requires Git 2.18 for submodules, it's not present in the image
- uses: actions/checkout@v1
with:
Expand All @@ -25,22 +27,17 @@ jobs:
- run: env CC=gcc LC_ALL=C.UTF-8 make -j
- run: env CC=gcc LC_ALL=C.UTF-8 make check
strategy:
fail-fast: false
matrix:
include:
- CC: gcc-4.9
- CC: gcc-7
CXX: g++
- CC: gcc-5
CXX: g++-5
- CC: clang-3.6
CXX: clang++-3.6
- CC: clang-3.7
CXX: clang++-3.7
- CC: clang-3.8
CXX: clang++-3.8
- CC: clang-6.0
CXX: clang++-6.0

ubuntu1804-compilers-test:
ubuntu2004-compilers-test:
runs-on: ubuntu-latest
container: avsystemembedded/anjay-travis:ubuntu-18.04
container: avsystemembedded/anjay-travis:ubuntu-20.04
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
Expand All @@ -57,9 +54,121 @@ jobs:
- run: env CC=gcc LC_ALL=C.UTF-8 make -j
- run: env CC=gcc LC_ALL=C.UTF-8 make check
strategy:
fail-fast: false
matrix:
include:
- CC: gcc-7
- CC: gcc-8
CXX: g++-8
- CC: gcc-9
CXX: g++-9
- CC: gcc-10
CXX: g++-10
- CC: clang-10
CXX: clang++-10

ubuntu2204-compilers-test:
runs-on: ubuntu-latest
container: avsystemembedded/anjay-travis:ubuntu-22.04
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
MEM_CHECK_TOOL: ${{ matrix.MEM_CHECK_TOOL }}
steps:
# NOTE: workaround for https://github.com/actions/checkout/issues/760
- run: git config --global safe.directory '*'
# NOTE: v2 requires Git 2.18 for submodules, it's not present in the image
- uses: actions/checkout@v1
with:
submodules: recursive
- run: apt-get update
- run: apt-get -y install $CC $CXX
- run: ./devconfig $MEM_CHECK_TOOL --without-analysis -DWITH_VALGRIND_TRACK_ORIGINS=OFF -DWITH_URL_CHECK=OFF
- run: env CC=gcc LC_ALL=C.UTF-8 make -j
- run: env CC=gcc LC_ALL=C.UTF-8 make check
strategy:
fail-fast: false
matrix:
include:
- CC: gcc-11
CXX: g++-11
MEM_CHECK_TOOL: --with-valgrind
- CC: gcc-12
CXX: g++-12
MEM_CHECK_TOOL: --with-valgrind
- CC: clang-11
CXX: clang++-11
MEM_CHECK_TOOL: --with-valgrind
- CC: clang-12
CXX: clang++-12
MEM_CHECK_TOOL: --with-valgrind
- CC: clang-13
CXX: clang++-13
MEM_CHECK_TOOL: --with-valgrind
- CC: clang-14
CXX: clang++-14
MEM_CHECK_TOOL: --without-memcheck # NOTE: workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=1758782

fedora36-compilers-test:
runs-on: ubuntu-latest
container: avsystemembedded/anjay-travis:fedora-36
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
COMPILER_VERSION: ${{ matrix.COMPILER_VERSION }}
steps:
# NOTE: workaround for https://github.com/actions/checkout/issues/760
- run: git config --global safe.directory '*'
# NOTE: v2 requires Git 2.18 for submodules, it's not present in the image
- uses: actions/checkout@v1
with:
submodules: recursive
- run: dnf update -y
- run: dnf install -y $COMPILER_VERSION
- run: ./devconfig --with-valgrind --without-analysis -DWITH_VALGRIND_TRACK_ORIGINS=OFF -DWITH_URL_CHECK=OFF
- run: env CC=gcc LC_ALL=C.UTF-8 make -j
- run: env CC=gcc LC_ALL=C.UTF-8 make check
strategy:
fail-fast: false
matrix:
include:
- CC: gcc
CXX: g++
- CC: clang-6.0
CXX: clang++-6.0
COMPILER_VERSION: gcc-12.0.1
- CC: gcc
CXX: g++
COMPILER_VERSION: gcc-12.1.1
- CC: clang
CXX: clang++
COMPILER_VERSION: clang-14.0.0

macOS-compilers-test:
runs-on: macos-11
env:
CC: ${{ matrix.CC }}
CXX: ${{ matrix.CXX }}
COMPILER_VERSION: ${{ matrix.COMPILER_VERSION }}
steps:
# NOTE: v2 requires Git 2.18 for submodules, it's not present in the image
- uses: actions/checkout@v1
with:
submodules: recursive
- run: brew update && brew upgrade
# 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
- run: env JAVA_HOME="$JAVA_HOME_17_X64" ./devconfig --with-asan --without-analysis --no-examples -DWITH_VALGRIND_TRACK_ORIGINS=OFF -DWITH_URL_CHECK=OFF
- run: LC_ALL=C.UTF-8 make -j
- run: LC_ALL=C.UTF-8 make check
strategy:
fail-fast: false
matrix:
include:
- CC: gcc-11
CXX: g++-11
COMPILER_VERSION: gcc@11
- CC: gcc-12
CXX: g++-12
COMPILER_VERSION: gcc@12
- CC: cc
CXX: c++
COMPILER_VERSION: llvm
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 3.1.2 (August 24th, 2022)

### Improvements

- Reduced code size of the Security object implementation
- Updated documentation, readme and examples to mention the new EU IoT Cloud platform
- Migrated GitHub Actions tests to ubuntu-18.04, ubuntu-20.04, ubuntu-22.04, fedora-36 and macos-11

### Bugfixes

- Fixed various compilation warnings
- Fixed dangerous usage of `avs_realloc()` in the event loop implementation

## 3.1.1 (July 22nd, 2022)

### Improvements
Expand Down
7 changes: 5 additions & 2 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.1.1" CACHE STRING "Anjay library version")
set(ANJAY_VERSION "3.1.2" CACHE STRING "Anjay library version")
set(ANJAY_BINARY_VERSION 1.0.0)

set(ANJAY_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
Expand Down Expand Up @@ -802,7 +802,10 @@ if(WITH_FIND_UNUSED_CODE)
add_dependencies(check find_unused_code)
endif()

add_subdirectory(examples)
option(WITH_EXAMPLES "Compile and test examples" ON)
if(WITH_EXAMPLES)
add_subdirectory(examples)
endif()

################# INSTALL ######################################################

Expand Down
2 changes: 1 addition & 1 deletion README.Windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ make
The demo application can be run from the MINGW shell just like on any other Unix system, e.g.:

```
./output/bin/demo --endpoint-name $(hostname) --server-uri coap://try-anjay.avsystem.com:5683
./output/bin/demo --endpoint-name $(hostname) --server-uri coap://eu.iot.avsystem.cloud:5683
```
If you want to run the resulting application outside of the MINGW shell, you will likely need to copy the DLL dependencies, such as:
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ brew install cmake mbedtls

### Running the demo client

For initial development and testing of LwM2M clients, we recommend using the [Try Anjay platform](https://www.avsystem.com/try-anjay/) where you can use the basic LwM2M server functionality for free.
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.

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

Expand All @@ -180,13 +180,13 @@ git clone https://github.com/AVSystem/Anjay.git \
&& git submodule update --init \
&& cmake . \
&& make -j \
&& ./output/bin/demo --endpoint-name $(hostname) --server-uri coap://try-anjay.avsystem.com:5683
&& ./output/bin/demo --endpoint-name $(hostname) --server-uri coap://eu.iot.avsystem.cloud:5683
```
<!-- compile_instruction_end -->

**NOTE**: On some older systems like CentOS 7, you may need to use `cmake3` instead of `cmake`.

**NOTE**: We strongly recommend replacing `$(hostname)` with some actual unique hostname. Please see the [documentation](https://avsystem.github.io/Anjay-doc/LwM2M.html#clients-and-servers) for information on preferred endpoint name formats. Note that with the Try Anjay platform, you will need to enter the endpoint name into the server UI first.
**NOTE**: We strongly recommend replacing `$(hostname)` with some actual unique hostname. Please see the [documentation](https://avsystem.github.io/Anjay-doc/LwM2M.html#clients-and-servers) for information on preferred endpoint name formats. Note that with the Coiote IoT Device Management platform, you will need to enter the endpoint name into the server UI first.

### Detailed compilation guide

Expand Down Expand Up @@ -224,10 +224,10 @@ To start the demo client:

``` sh
# uses plain CoAP
./output/bin/demo --endpoint-name $(hostname) --server-uri coap://try-anjay.avsystem.com:5683
./output/bin/demo --endpoint-name $(hostname) --server-uri coap://eu.iot.avsystem.cloud:5683

# uses DTLS in PSK mode, with PSK identity "foo" and secret key "bar" (hex-encoded)
./output/bin/demo --endpoint-name $(hostname) --server-uri coaps://try-anjay.avsystem.com:5684 --security-mode psk --identity 666f6f --key 626172
./output/bin/demo --endpoint-name $(hostname) --server-uri coaps://eu.iot.avsystem.cloud: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://>".
Expand Down Expand Up @@ -282,7 +282,7 @@ Then, you can launch the built image and run the demo client:

```
docker run -it anjay
./output/bin/demo -e $(hostname) -u coap://try-anjay.avsystem.com:5683
./output/bin/demo -e $(hostname) -u coap://eu.iot.avsystem.cloud:5683
```

## Embedded operating systems ports
Expand Down
5 changes: 5 additions & 0 deletions devconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ MODULE_STATIC_LIBS='ON'
ANJAY_VERSION=$(git rev-parse --short HEAD)
DTLS_BACKEND="mbedtls"
WITH_STATIC_ANALYSIS='ON'
WITH_EXAMPLES='ON'

if valgrind --version >/dev/null 2>/dev/null; then
WITH_VALGRIND=ON
Expand Down Expand Up @@ -90,6 +91,9 @@ while [ $# -gt 0 ]; do
'--without-analysis')
WITH_STATIC_ANALYSIS=OFF
;;
'--no-examples')
WITH_EXAMPLES=OFF
;;
'--tiny')
EXTRA_FLAGS[${#EXTRA_FLAGS[@]}]="-DMAX_PK_OR_IDENTITY_SIZE=256"
EXTRA_FLAGS[${#EXTRA_FLAGS[@]}]="-DMAX_SECRET_KEY_SIZE=128"
Expand Down Expand Up @@ -142,6 +146,7 @@ ${CMAKE_COMMAND} \
-D WITH_STATIC_ANALYSIS=${WITH_STATIC_ANALYSIS} \
-D DTLS_BACKEND="${DTLS_BACKEND}" \
-D AVS_LOG_WITH_TRACE=ON \
-D WITH_EXAMPLES=${WITH_EXAMPLES} \
-D CMAKE_C_FLAGS="${C_FLAGS} ${EXTRA_C_FLAGS}" \
-D CMAKE_CXX_FLAGS="${EXTRA_C_FLAGS}" \
-D ANJAY_VERSION="${ANJAY_VERSION}" \
Expand Down
Loading

0 comments on commit 8fe0db0

Please sign in to comment.