Skip to content

Commit b12fcba

Browse files
committed
Anjay Lite 1.0.0-beta.1
0 parents  commit b12fcba

File tree

303 files changed

+97937
-0
lines changed

Some content is hidden

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

303 files changed

+97937
-0
lines changed

.clang-format

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
BasedOnStyle: llvm
2+
AccessModifierOffset: -4
3+
AlignEscapedNewlinesLeft: true
4+
AlignOperands: true
5+
AllowShortFunctionsOnASingleLine: Empty
6+
AlwaysBreakTemplateDeclarations: true
7+
AvoidMisleadingControlStatementContinuationIndent: true
8+
BinPackParameters: false
9+
BinPackArguments: true
10+
BreakBeforeBinaryOperators: NonAssignment
11+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
12+
ConstructorInitializerIndentWidth: 8
13+
ContinuationIndentWidth: 8
14+
Cpp11BracedListStyle: false
15+
IndentWidth: 4
16+
PenaltyBreakBeforeFirstCallParameter: 40
17+
SpaceAfterCStyleCast: true
18+
BreakDesignatedInitializers: true
19+
IndentPPDirectives: AfterHash
20+
CommentPragmas: "AVSYSTEM_ANJAY_COMMERCIAL.*"
21+
ExperimentalAutoDetectBinPacking: true

.github/workflows/build_docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright 2023-2025 AVSystem <avsystem@avsystem.com>
2+
# AVSystem Anjay Lite LwM2M SDK
3+
# All rights reserved.
4+
#
5+
# Licensed under AVSystem Anjay Lite LwM2M Client SDK - Non-Commercial License.
6+
# See the attached LICENSE file for details.
7+
8+
name: Build and Deploy Docs
9+
on: push
10+
11+
concurrency:
12+
group: "pages-${{ github.ref }}"
13+
cancel-in-progress: true
14+
15+
jobs:
16+
build:
17+
runs-on: ubuntu-latest
18+
container: avsystemembedded/anjay-lite-build-docs:1.0
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
submodules: 'recursive'
24+
- name: Build docs
25+
run: |
26+
mkdir build
27+
cd build
28+
cmake ..
29+
make doc
30+
- name: Move docs
31+
run: |
32+
mkdir build/pages
33+
cp -r doc/build/sphinx/* build/pages
34+
cp -r doc/build/doxygen/html build/pages/api
35+
- name: Configure Pages
36+
uses: actions/configure-pages@v5
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v3
39+
with:
40+
path: build/pages
41+
42+
deploy:
43+
if: github.ref == 'refs/heads/master'
44+
needs: build
45+
permissions:
46+
contents: read
47+
pages: write
48+
id-token: write
49+
runs-on: ubuntu-latest
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
steps:
54+
- name: Deploy to GitHub Pages
55+
id: deployment
56+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
docs/diagrams/out
2+
3+
# NetBeans Project
4+
nbproject
5+
6+
# VSCode
7+
.vscode/
8+
9+
# JetBrains IDEs
10+
.idea/
11+
12+
# vim
13+
*.swp
14+
tags
15+
16+
build/
17+
site/
18+
coverage/
19+
doxygen/
20+
21+
# make
22+
CMakeFiles/
23+
CMakeDoxyfile.in
24+
*.cmake
25+
!cmake/*.cmake
26+
CMakeCache.txt
27+
Makefile
28+
__pycache__/
29+
30+
libanj.a
31+
32+
/doc/sphinx/conf.py
33+
/anjay_lite_bc_initialization
34+
/anjay_lite_bc_mandatory_objects
35+
/anjay_lite_bc_send
36+
/anjay_lite_at_bootstrap
37+
/anjay_lite_firmware_update
38+
/dm_tests
39+
/io_tests
40+
/io_tests_without_extended
41+
/coap_tests
42+
/observe_tests
43+
/observe_without_composite_tests
44+
/dm_without_composite_tests
45+
/exchange_tests
46+
/core_tests
47+
/net_tests
48+
/anj_config
49+
/cxx_header_check

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "tools/doxygen-awesome-css"]
2+
path = tools/doxygen-awesome-css
3+
url = https://github.com/jothepro/doxygen-awesome-css.git

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## Anjay Lite 1.0.0-beta.1 (June 9th, 2025)
4+
5+
Initial release.

CMakeLists.txt

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Copyright 2023-2025 AVSystem <avsystem@avsystem.com>
2+
# AVSystem Anjay Lite LwM2M SDK
3+
# All rights reserved.
4+
#
5+
# Licensed under AVSystem Anjay Lite LwM2M Client SDK - Non-Commercial License.
6+
# See the attached LICENSE file for details.
7+
8+
cmake_minimum_required(VERSION 3.6.0)
9+
10+
# Core CMake code is located in cmake/anjay_lite-config.cmake and the library is
11+
# supposed to be imported using find_package() mechanism - this file only meant
12+
# to be a convenience wrapper for all example and test targets.
13+
14+
project(anjay_lite C)
15+
16+
set(CMAKE_C_STANDARD 99)
17+
set(CMAKE_C_EXTENSIONS OFF)
18+
19+
# Below find_package() call is meant for IDE indexing purposes.
20+
set(anjay_lite_DIR "cmake")
21+
find_package(anjay_lite REQUIRED)
22+
23+
find_program(VALGRIND_EXECUTABLE valgrind)
24+
25+
add_custom_target(run_tests)
26+
27+
function(add_standalone_target NAME PATH WITH_VALGRIND)
28+
set(workdir "${CMAKE_BINARY_DIR}/${NAME}")
29+
30+
string(REPLACE " " ";" unescaped_c_flags "${CMAKE_C_FLAGS}")
31+
string(REPLACE " " ";" unescaped_exe_linker_flags "${CMAKE_EXE_LINKER_FLAGS}")
32+
33+
add_custom_target(${NAME} ALL)
34+
add_custom_command(TARGET ${NAME} COMMAND ${CMAKE_COMMAND} -E make_directory
35+
"${workdir}")
36+
add_custom_command(
37+
TARGET ${NAME}
38+
COMMAND
39+
${CMAKE_COMMAND} -S "${CMAKE_CURRENT_SOURCE_DIR}/${PATH}" -B .
40+
-DCMAKE_C_COMPILER="${CMAKE_C_COMPILER}"
41+
-DCMAKE_C_FLAGS="${unescaped_c_flags}"
42+
-DCMAKE_EXE_LINKER_FLAGS="${unescaped_exe_linker_flags}"
43+
COMMAND ${CMAKE_COMMAND} --build . --target ${NAME} -- -j${NPROC}
44+
WORKING_DIRECTORY "${workdir}")
45+
46+
if(WITH_VALGRIND AND VALGRIND_EXECUTABLE)
47+
add_custom_target(
48+
${NAME}_with_valgrind
49+
DEPENDS ${NAME}
50+
COMMAND "${VALGRIND_EXECUTABLE}" --leak-check=full --track-origins=yes -q
51+
--error-exitcode=63 "${workdir}/${NAME}")
52+
endif()
53+
54+
if(${NAME} MATCHES "_tests")
55+
add_dependencies(run_tests ${NAME})
56+
add_custom_command(TARGET run_tests COMMAND "${workdir}/${NAME}")
57+
endif()
58+
endfunction()
59+
60+
# tests
61+
add_standalone_target(dm_tests tests/anj/dm ON)
62+
add_standalone_target(dm_without_composite_tests tests/anj/dm_without_composite ON)
63+
add_standalone_target(observe_tests tests/anj/observe ON)
64+
add_standalone_target(observe_without_composite_tests tests/anj/observe_without_composite ON)
65+
add_standalone_target(exchange_tests tests/anj/exchange ON)
66+
add_standalone_target(io_tests tests/anj/io ON)
67+
add_standalone_target(io_tests_without_extended tests/anj/io_without_extended ON)
68+
add_standalone_target(coap_tests tests/anj/coap ON)
69+
add_standalone_target(net_tests tests/anj/net ON)
70+
add_standalone_target(core_tests tests/anj/core ON)
71+
72+
# examples
73+
add_standalone_target(anjay_lite_firmware_update examples/tutorial/firmware-update OFF)
74+
75+
add_standalone_target(anjay_lite_bc_initialization examples/tutorial/BC-Initialization OFF)
76+
add_standalone_target(anjay_lite_bc_mandatory_objects examples/tutorial/BC-MandatoryObjects OFF)
77+
add_standalone_target(anjay_lite_bc_object_impl examples/tutorial/BC-BasicObjectImplementation OFF)
78+
add_standalone_target(anjay_lite_bc_notifications examples/tutorial/BC-Notifications OFF)
79+
add_standalone_target(anjay_lite_bc_send examples/tutorial/BC-Send OFF)
80+
81+
add_standalone_target(anjay_lite_at_bootstrap examples/tutorial/AT-Bootstrap OFF)
82+
add_standalone_target(anjay_lite_at_queue_mode examples/tutorial/AT-QueueMode OFF)
83+
add_standalone_target(anjay_lite_at_multi_instance_object examples/tutorial/AT-MultiInstanceObject OFF)
84+
add_standalone_target(anjay_lite_at_multi_instance_object_dynamic examples/tutorial/AT-MultiInstanceObjectDynamic OFF)
85+
add_standalone_target(anjay_lite_at_multi_instance_resource examples/tutorial/AT-MultiInstanceResource OFF)
86+
add_standalone_target(anjay_lite_at_multi_instance_resource_dynamic examples/tutorial/AT-MultiInstanceResourceDynamic OFF)
87+
88+
add_standalone_target(anjay_lite_minimal_network_api examples/custom-network/minimal OFF)
89+
add_standalone_target(anjay_lite_reuse_port examples/custom-network/reuse-port OFF)
90+
91+
# Sphinx and doxygen documentation
92+
add_subdirectory(doc)
93+
94+
# C++ header compatibility check
95+
add_standalone_target(cxx_header_check tests/cxx_header_check OFF)

CONTRIBUTING.rst

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
..
2+
Copyright 2023-2025 AVSystem <avsystem@avsystem.com>
3+
AVSystem Anjay Lite LwM2M SDK
4+
All rights reserved.
5+
6+
Licensed under AVSystem Anjay Lite LwM2M Client SDK - Non-Commercial License.
7+
See the attached LICENSE file for details.
8+
9+
Contributing to Anjay Lite
10+
==========================
11+
12+
Thank you for considering contributing to Anjay Lite!
13+
14+
Please take a moment to review this document in order to make the contribution process easy and effective for everyone involved.
15+
16+
17+
Following these guidelines shows that you value the time and effort of the AVSystem team maintaining and developing this project, which is released under a source-available dual license. While Anjay Lite is an AVSystem product, we welcome community contributions, suggestions, and improvements—and we aim to provide constructive feedback and support throughout the contribution process.
18+
19+
Reporting issues
20+
----------------
21+
22+
**If you find a security vulnerability, do NOT open an issue!** Please email `opensource@avsystem.com <mailto:opensource@avsystem.com>`_ instead. We will address the issue as soon as possible and will give you an estimate for when we have a fix and release available for an eventual public disclosure.
23+
24+
Use GitHub issue tracker for reporting other bugs. A great bug report should include:
25+
26+
- Affected library version.
27+
- Platform information:
28+
29+
- processor architecture,
30+
- operating system,
31+
- compiler version.
32+
- Minimal code example or a list of steps required to reproduce the bug.
33+
- In case of run-time errors, logs from ``strace``, ``valgrind`` and PCAP network traffic dumps are greatly appreciated.
34+
35+
Feature requests
36+
----------------
37+
38+
If you think some feature is missing, or that something can be improved, do not hesitate to suggest how we can make it better! When doing that, use GitHub issue tracker to post a description of the feature and some explanation why you need it.
39+
40+
Code contributions
41+
------------------
42+
43+
If you never submitted a pull request before, take a look at `this fantastic tutorial <https://egghead.io/courses/how-to-contribute-to-an-open-source-project-on-github>`_.
44+
45+
#. Fork the project.
46+
#. Work on your contribution - follow guidelines described below.
47+
#. Push changes to your fork.
48+
#. Make sure all ``make check`` tests still pass.
49+
#. `Create a pull request <https://help.github.com/articles/creating-a-pull-request-from-a-fork/>`_.
50+
#. Wait for someone from Anjay Lite team to review your contribution and give feedback.
51+
52+
Code style
53+
^^^^^^^^^^
54+
55+
All code should be fully C99-compliant and compile without warnings under ``gcc`` and ``clang``. Be sure you have enabled extra warnings by using ``cmake -DANJ_WITH_EXTRA_WARNINGS=ON``. Compiling and testing the code on multiple architectures (e.g. 32/64-bit x86, ARM, MIPS) is not required, but welcome.
56+
57+
General guidelines
58+
^^^^^^^^^^^^^^^^^^
59+
- Do not use GNU extensions.
60+
- Use ``UPPER_CASE`` for constants and ``snake_case`` in all other cases.
61+
- Prefer ``static`` functions. Use ``_anj_`` prefix for private functions shared between translation units and ``anj_`` prefix for types and public functions.
62+
- Do not use global variables. Only constants are allowed in global scope.
63+
- When using bitfields, make sure they are not saved to persistent storage nor sent over the network - their memory layout is implementation-defined, making them non-portable.
64+
- Avoid recursion - when writing code for an embedded platform, it is important to determine a hard limit on the stack space used by a program.
65+
- Include license information at the top of each file you add.
66+

0 commit comments

Comments
 (0)