Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CLA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
CLAssistant:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: "CLA Assistant"
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ on:
jobs:
make_android:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
make_linux_java:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
JUNIT4=./junit-4.13.jar HAMCREST_CORE=./hamcrest-core-1.3.jar ./run-unit-tests.sh

ctt_build:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -76,7 +76,7 @@ jobs:

build_esp32:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/check-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
# This workflow contains a single job called "check-formatting"
check-formatting:
# The type of runner that the job will run on
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand All @@ -32,14 +32,14 @@ jobs:
with:
submodules: "true"

- name: Install clang-format-17
- name: Install clang-format-19
run: |
sudo apt-get update -y
sudo apt-get install curl
curl -sL https://apt.llvm.org/llvm.sh > llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-format-17
sudo ./llvm.sh 19
sudo apt-get install clang-format-19

# Runs a set of commands using the runners shell
- name: format-check
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/cmake-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ jobs:
- name: Clang64
msystem: CLANG64
build_type: Debug
build_args: "-DOC_ASAN_ENABLED=ON -DOC_UBSAN_ENABLED=ON"
# TODO: remove once GTest library is updated to version with newer CMake
build_args: "-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DOC_ASAN_ENABLED=ON -DOC_UBSAN_ENABLED=ON"
cc: clang
cxx: clang++
build_testing: ON
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
coverity:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ctt-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
info-comment:
name: Info comment
if: github.event.action == 'opened'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Generate token
id: generate_token
Expand All @@ -33,7 +33,7 @@ jobs:
remove-label:
name: Remove label
if: github.event.action == 'synchronize'
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Generate token
id: generate_token
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-build-publish-with-cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:

jobs:
build-and-push-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doxygen-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
doxygen-publish:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
if: (github.event_name == 'pull_request' && github.event.pull_request.merged) || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
doxygen:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ghcr-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
check_package:
name: Check released packages
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ghcr-cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
pull-request-ghcr-cleanup:
if: ${{ github.event_name == 'pull_request' }}
name: Delete images related to closed PR
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Delete images related to closed PR (1)
id: run-pr-1
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
nightly-ghcr-cleanup:
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
name: Delete stale or untagged images
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
steps:
- name: Checkout local actions
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plgd-device-test-with-cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ env:
jobs:
plgd-device-test-with-cfg:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plgd-dps-test-with-cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ env:
jobs:
plgd-hub-test-with-cfg:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/plgd-hub-test-with-cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ env:
jobs:
plgd-hub-test-with-cfg:
if: ${{ !inputs.skip }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
format:
name: Format the pull request if the '~format' comment is made
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '~format') }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: octokit/[email protected]
id: get_branch
Expand Down Expand Up @@ -50,8 +50,8 @@ jobs:
sudo apt-get install curl
curl -sL https://apt.llvm.org/llvm.sh > llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-format-17
sudo ./llvm.sh 19
sudo apt-get install clang-format-19
cmake -S ${{ github.workspace }}/iotivity-lite -B ${{ github.workspace }}/build-format
make -C ${{ github.workspace }}/build-format format

Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/sonar-cloud-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
# don't run for forks
if: github.event_name == 'push' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)
name: Sonar Cloud scan
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
env:
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed
needs: [unit-tests, plgd-device-tests, plgd-hub-tests, plgd-dps-tests]
Expand Down Expand Up @@ -131,12 +131,13 @@ jobs:
run: |
sudo apt-get update -y
sudo apt-get install -y gcovr
gcovr --version

- name: Create single coverage file in sonarqube format
run: |
cd tools
# ls -lR .
gcovr --add-tracefile "coverage/*coverage*.json" --sonarqube --output "coverage.xml" --verbose
gcovr --merge-mode-functions=separate --add-tracefile "coverage/*coverage*.json" --sonarqube --output "coverage.xml" --verbose

- name: Run sonar-scanner
env:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,25 @@ jobs:
- build_args: -DPLGD_DEV_TIME_ENABLED=ON -DPLGD_DEV_DEVICE_PROVISIONING_ENABLED=ON
- build_args: -DOC_DYNAMIC_ALLOCATION_ENABLED=OFF -DOC_PUSH_ENABLED=OFF -DOC_JSON_ENCODER_ENABLED=OFF -DOC_DEBUG_ENABLED=ON

runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: "true"

- name: Install clang-17 and clang-tidy-17
- name: Install clang-19 and clang-tidy-19
run: |
sudo apt-get update -y
sudo apt-get install curl
curl -sL https://apt.llvm.org/llvm.sh > llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-17 clang-tidy-17
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 200
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-17 200
sudo ./llvm.sh 19
sudo apt-get install clang-19 clang-tidy-19
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 200
sudo update-alternatives --install /usr/bin/clang-tidy clang-tidy /usr/bin/clang-tidy-19 200
update-alternatives --verbose --display clang

- name: Build with clang and analyze with clang-tidy
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/unit-test-with-cfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ on:
default: false
jobs:
unit-test-with-cfg:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

steps:
- name: Checkout repository
Expand All @@ -57,17 +57,17 @@ jobs:
repository: wolfcw/libfaketime
path: libfaketime

- name: Install clang-17
- name: Install clang-19
if: ${{ inputs.clang }}
run: |
sudo apt-get update -y
sudo apt-get install curl
curl -sL https://apt.llvm.org/llvm.sh > llvm.sh
chmod u+x llvm.sh
sudo ./llvm.sh 17
sudo apt-get install clang-17
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-17 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-17 200
sudo ./llvm.sh 19
sudo apt-get install clang-19
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-19 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-19 200

- name: Install libfaketime
if: ${{ inputs.install_faketime }}
Expand Down
18 changes: 14 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,17 @@ if(WIN32 AND (MSVC OR OC_COMPILER_IS_CLANG))
endif()

if(OC_COVERAGE_ENABLED)
list(APPEND PRIVATE_COMPILE_OPTIONS "--coverage")
set(COVERAGE_COMPILE_OPTIONS "--coverage")
set(COVERAGE_LINK_OPTIONS "--coverage")
if(OC_COMPILER_IS_GCC)
set(COVERAGE_COMPILE_OPTIONS -ftest-coverage -fprofile-arcs -fprofile-values -fprofile-abs-path)
check_c_compiler_flag(-fprofile-update=atomic HAVE_ATOMIC_PROFILE_UPDATE)
if(HAVE_ATOMIC_PROFILE_UPDATE)
list(APPEND COVERAGE_COMPILE_OPTIONS -fprofile-update=atomic)
endif()
set(COVERAGE_LINK_OPTIONS -lgcov -fprofile-arcs)
endif()
list(APPEND PRIVATE_COMPILE_OPTIONS ${COVERAGE_COMPILE_OPTIONS})
endif()

# ####### Gather source files ########
Expand Down Expand Up @@ -628,7 +638,7 @@ else()
endif()

if(OC_COVERAGE_ENABLED)
list(APPEND PRIVATE_LINK_LIBS "--coverage")
list(APPEND PRIVATE_LINK_LIBS ${COVERAGE_LINK_OPTIONS})
endif()

# ####### Object libraries ########
Expand Down Expand Up @@ -881,8 +891,8 @@ if(OC_SECURITY_ENABLED)
endif()

if(OC_COVERAGE_ENABLED)
target_compile_options(client-server-static PRIVATE "--coverage")
target_link_libraries(client-server-static PRIVATE "--coverage")
target_compile_options(client-server-static PRIVATE ${COVERAGE_COMPILE_OPTIONS})
target_link_libraries(client-server-static PRIVATE ${COVERAGE_LINK_OPTIONS})
endif()

set_target_properties(client-server-static PROPERTIES
Expand Down
12 changes: 2 additions & 10 deletions api/cloud/oc_cloud_resource_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,9 @@ extern "C" {
/// Default sid value from OCF Device to Cloud Services Specification,
/// equivalent to "00000000-0000-0000-0000-000000000000"
#ifdef __cplusplus
#define OCF_COAPCLOUDCONF_DEFAULT_SID \
oc_uuid_t \
{ \
0 \
}
#define OCF_COAPCLOUDCONF_DEFAULT_SID oc_uuid_t{ 0 }
#else /* !__cplusplus */
#define OCF_COAPCLOUDCONF_DEFAULT_SID \
(oc_uuid_t) \
{ \
0 \
}
#define OCF_COAPCLOUDCONF_DEFAULT_SID (oc_uuid_t){ 0 }
#endif /* __cplusplus */

#define OCF_COAPCLOUDCONF_PROP_ACCESSTOKEN "at"
Expand Down
8 changes: 3 additions & 5 deletions api/cloud/oc_cloud_schedule.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@
#include <assert.h>

#define OC_CLOUD_DEFAULT_RETRY_TIMEOUTS \
{ \
2 * MILLISECONDS_PER_SECOND, 4 * MILLISECONDS_PER_SECOND, \
8 * MILLISECONDS_PER_SECOND, 16 * MILLISECONDS_PER_SECOND, \
32 * MILLISECONDS_PER_SECOND, 64 * MILLISECONDS_PER_SECOND \
}
{ 2 * MILLISECONDS_PER_SECOND, 4 * MILLISECONDS_PER_SECOND, \
8 * MILLISECONDS_PER_SECOND, 16 * MILLISECONDS_PER_SECOND, \
32 * MILLISECONDS_PER_SECOND, 64 * MILLISECONDS_PER_SECOND }

static uint16_t g_retry_timeout_ms[OC_CLOUD_RETRY_TIMEOUTS_SIZE] =
OC_CLOUD_DEFAULT_RETRY_TIMEOUTS;
Expand Down
6 changes: 4 additions & 2 deletions api/oc_rep_encode_cbor_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ extern "C" {
.get_buffer_size = &cbor_encoder_get_buffer_size, \
.get_extra_bytes_needed = &cbor_encoder_get_extra_bytes_needed, \
\
.encode_null = &cbor_encode_null, .encode_boolean = &cbor_encode_boolean, \
.encode_int = &cbor_encode_int, .encode_uint = &cbor_encode_uint, \
.encode_null = &cbor_encode_null, \
.encode_boolean = &cbor_encode_boolean, \
.encode_int = &cbor_encode_int, \
.encode_uint = &cbor_encode_uint, \
.encode_floating_point = &cbor_encode_floating_point, \
.encode_double = &cbor_encode_double, \
.encode_text_string = &cbor_encode_text_string, \
Expand Down
Loading