diff --git a/.github/coding-convention-tool b/.github/coding-convention-tool deleted file mode 160000 index bd0d672..0000000 --- a/.github/coding-convention-tool +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bd0d672ee66ada2787bfc3b58e8b64e933b2c777 diff --git a/.github/formatting_config/ignore-words.txt b/.github/formatting_config/ignore-words.txt deleted file mode 100644 index ca74f93..0000000 --- a/.github/formatting_config/ignore-words.txt +++ /dev/null @@ -1 +0,0 @@ -doubleClick diff --git a/.github/workflows/00-Check-Code-Convention.yml b/.github/workflows/00-Check-Code-Convention.yml index 5c7f503..1ac3f78 100644 --- a/.github/workflows/00-Check-Code-Convention.yml +++ b/.github/workflows/00-Check-Code-Convention.yml @@ -8,88 +8,38 @@ on: workflow_dispatch: inputs: branch: - description: 'Branch to test' + description: "Branch to test" type: string - default: 'master' + default: "main" jobs: job1: name: Check coding convention - runs-on: ubuntu-22.04 #uncrustify 0.64 can not be compiled on ubuntu-24.04 + runs-on: ubuntu-24.04 steps: - - name: Trigger - run: echo "Triggered by ${{github.event_name}} event" - - name: Check Branch Input - run: | - if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then - if [ -z "${{ github.event.inputs.branch }}" ]; then - echo "Branch input is required for manual trigger." - exit 1 - fi + - name: Trigger + run: echo "Triggered by ${{github.event_name}} event" + - name: Check Branch Input + run: | + if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then + if [ -z "${{ github.event.inputs.branch }}" ]; then + echo "Branch input is required for manual trigger." + exit 1 fi - - name: Checkout - uses: actions/checkout@v4.1.7 - with: - ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" - submodules: true - fetch-depth: 0 - - name: Log Current Branch and Commit - run: | + fi + - name: Checkout + uses: actions/checkout@v4.1.7 + with: + ref: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.branch || github.ref }}" + submodules: true + fetch-depth: 0 + - name: Log Current Branch and Commit + run: | echo "Current branch: $(git rev-parse --abbrev-ref HEAD)" echo "Current commit: $(git rev-parse HEAD)" - - name: Install commit check tools - run: | - echo "Installing pre-commit ..." - python3 -m pip install pre-commit - echo "Installing uncrustify 0.64 from source code ..." - sudo apt-get install --no-install-recommends -y\ - binutils ca-certificates git cmake make \ - gcc g++ binutils libc6-dev - echo "Cloning Uncrustify repository..." - git clone -b uncrustify-0.64 --single-branch https://github.com/uncrustify/uncrustify.git - echo "Building and installing Uncrustify..." - mkdir ./uncrustify/build && cd ./uncrustify/build - cmake -D CMAKE_INSTALL_PREFIX=/usr/local -D CMAKE_BUILD_TYPE=RelWithDebInfo ../ - sudo make -j "$(nproc)" - sudo make install - echo "Uncrustify has been installed successfully!" - cd ../../ - sudo cp ./.github/coding-convention-tool/tools/uncrustify/uncrustify.cfg ./uncrustify/uncrustify.cfg - echo "Install clang-tidy" - sudo apt-get install clang-tidy - - name: Apply custom formatting configuration - run: | - echo "Applying custom formatting configuration..." - chmod +x ./.github/coding-convention-tool/project_custom_config_handler.sh - ./.github/coding-convention-tool/project_custom_config_handler.sh - - - name: Run test - run: | - pre-commit install --config .github/coding-convention-tool/.pre-commit-config.yaml - pre-commit run --config .github/coding-convention-tool/.pre-commit-config.yaml --all-files 2>&1 | tee CodingConventionTool.txt - git diff > code-fix.patch || echo "No changes to patch." - ls -lah code-fix.patch - - - name: Upload Result - uses: actions/upload-artifact@v4.3.4 - with: - name: CodingConventionResult - path: CodingConventionTool.txt - retention-days: 90 - - name: Upload Patch - uses: actions/upload-artifact@v4.3.4 - with: - name: code-fix.patch - path: code-fix.patch - retention-days: 90 - - name: Check log file to set status of the job - run: | - keywords=("Failed") - for keyword in "${keywords[@]}"; do - if grep -q "$keyword" CodingConventionTool.txt; then - echo "Keyword '$keyword' found in the file." - exit 1 - else - echo "Keyword '$keyword' not found in the file." - fi - done + - name: Check Code Convention + uses: SiliconLabsSoftware/devs-coding-convention-tool@master + with: + exclude-regex: "" + codespell-ignore-words: "doubleClick" + codespell-skip-paths: "" diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 519e2e8..0000000 --- a/.gitmodules +++ /dev/null @@ -1,3 +0,0 @@ -[submodule ".github/coding-convention-tool"] - path = .github/coding-convention-tool - url = https://github.com/SiliconLabsSoftware/devs-coding-convention-tool diff --git a/models/switch_ncp_host/KBA_BT_0507 Bluetooth Mesh Host Switch Example.md b/models/switch_ncp_host/KBA_BT_0507 Bluetooth Mesh Host Switch Example.md index bcb64e2..1330180 100644 --- a/models/switch_ncp_host/KBA_BT_0507 Bluetooth Mesh Host Switch Example.md +++ b/models/switch_ncp_host/KBA_BT_0507 Bluetooth Mesh Host Switch Example.md @@ -6,9 +6,9 @@ This example duplicates the functionalities of the SDK example - soc-btmesh-swit ## Hardware & SDK Requirements -- IDE – [Simplicity Studio 5](https://www.silabs.com/developers/simplicity-studio) -- SDK – Bluetooth Mesh SDK 2.0.0 GA or newer, the latest version is always recommended. Included with the Gecko SDK 3.1.0 or later. -- NCP target – At least 1 Bluetooth Mesh compatible boards - EFR32xG12, EFR32xG13 or EFR32xG21 (x= M, B) based, SLWRB4104A and SLWRB4103A are recommended. +- IDE: [Simplicity Studio 5](https://www.silabs.com/developers/simplicity-studio) +- SDK: Bluetooth Mesh SDK 2.0.0 GA or newer, the latest version is always recommended. Included with the Gecko SDK 3.1.0 or later. +- NCP target: At least 1 Bluetooth Mesh compatible boards - EFR32xG12, EFR32xG13 or EFR32xG21 (x= M, B) based, SLWRB4104A and SLWRB4103A are recommended. - NCP host - **POSIX compatible** machine to run the host application. Running the application on Windows needs some porting afford, this has only been tested with Linux and Cygwin. ## How to Use It diff --git a/models/switch_ncp_host/app.c b/models/switch_ncp_host/app.c index b56c6a9..ea83293 100644 --- a/models/switch_ncp_host/app.c +++ b/models/switch_ncp_host/app.c @@ -1302,7 +1302,7 @@ int str2uint(const char *input, } /** - * @brief int2str - Conver unsigned integer to string + * @brief int2str - Converts unsigned integer to string * * @param input - Integer to convert * @param base_type - Hex or Dec diff --git a/network/mesh_channel_sounding/README.md b/network/mesh_channel_sounding/README.md index a32571b..e8088f9 100644 --- a/network/mesh_channel_sounding/README.md +++ b/network/mesh_channel_sounding/README.md @@ -66,4 +66,4 @@ This project README assumes that the reader is familiar with the usage of Silico ![cs_measurements](images/cs_measurements.png) - While the measurements are running, the Nodes can be provisioned into the same network (skipping some measurement cycles) with the Initiator having the functionality of the Light Lightness Server while the Reflector getting Light Lightness Client. After all this, the Light Node can be controlled via the buttons of the Switch Node: - ![mesh_app](images/mesh_app.png) \ No newline at end of file + ![mesh_app](images/mesh_app.png) diff --git a/network/mesh_channel_sounding/initiator_light/src/app.c b/network/mesh_channel_sounding/initiator_light/src/app.c index 1c14676..e9c126f 100644 --- a/network/mesh_channel_sounding/initiator_light/src/app.c +++ b/network/mesh_channel_sounding/initiator_light/src/app.c @@ -830,7 +830,7 @@ void sl_bt_on_event(sl_bt_msg_t * evt) } case sl_bt_evt_connection_parameters_id: // Only Reflector connections are handled by the Peer Manager - if(ble_peer_manager_is_conn_handle_in_array(evt->data.evt_connection_parameters.connection)) { + if (ble_peer_manager_is_conn_handle_in_array(evt->data.evt_connection_parameters.connection)) { sc = get_instance_number(evt->data.evt_connection_parameters.connection, &instance_num); // Initiator instance not created yet if (sc != SL_STATUS_OK) { @@ -943,7 +943,7 @@ void sl_bt_on_event(sl_bt_msg_t * evt) } case sl_bt_evt_connection_opened_id: // Only Reflector connections are handled by the Peer Manager - if(ble_peer_manager_is_conn_handle_in_array(evt->data.evt_connection_opened.connection)) { + if (ble_peer_manager_is_conn_handle_in_array(evt->data.evt_connection_opened.connection)) { log_info(APP_INSTANCE_PREFIX "Connection opened as central with CS Reflector" " '%02X:%02X:%02X:%02X:%02X:%02X'" NL, evt->data.evt_connection_opened.connection, @@ -970,7 +970,7 @@ void sl_bt_on_event(sl_bt_msg_t * evt) case sl_bt_evt_connection_closed_id: // Only Reflector connections are handled by the Peer Manager - if(ble_peer_manager_is_conn_handle_in_array(evt->data.evt_connection_closed.connection)) { + if (ble_peer_manager_is_conn_handle_in_array(evt->data.evt_connection_closed.connection)) { sc = cs_initiator_delete(evt->data.evt_connection_closed.connection); if ((sc == SL_STATUS_NOT_FOUND) || (sc == SL_STATUS_INVALID_HANDLE)) { log_info(APP_INSTANCE_PREFIX "Initiator instance not found" NL, evt->data.evt_connection_closed.connection); @@ -989,11 +989,11 @@ void sl_bt_on_event(sl_bt_msg_t * evt) break; case sl_bt_evt_scanner_legacy_advertisement_report_id: - match = !ble_peer_manager_is_bt_address_already_connected(&(evt->data.evt_scanner_legacy_advertisement_report.address)) && - ble_peer_manager_find_match(&(evt->data.evt_scanner_legacy_advertisement_report.address), - evt->data.evt_scanner_legacy_advertisement_report.address_type, - evt->data.evt_scanner_legacy_advertisement_report.rssi, - &(evt->data.evt_scanner_legacy_advertisement_report.data)); + match = !ble_peer_manager_is_bt_address_already_connected(&(evt->data.evt_scanner_legacy_advertisement_report.address)) + && ble_peer_manager_find_match(&(evt->data.evt_scanner_legacy_advertisement_report.address), + evt->data.evt_scanner_legacy_advertisement_report.address_type, + evt->data.evt_scanner_legacy_advertisement_report.rssi, + &(evt->data.evt_scanner_legacy_advertisement_report.data)); if (match) { log_info(APP_PREFIX "Match found" NL); log_info(APP_PREFIX "Bluetooth %s address: %02X:%02X:%02X:%02X:%02X:%02X\n", @@ -1025,11 +1025,11 @@ void sl_bt_on_event(sl_bt_msg_t * evt) break; case sl_bt_evt_scanner_extended_advertisement_report_id: - match = !ble_peer_manager_is_bt_address_already_connected(&(evt->data.evt_scanner_extended_advertisement_report.address)) && - ble_peer_manager_find_match(&(evt->data.evt_scanner_extended_advertisement_report.address), - evt->data.evt_scanner_extended_advertisement_report.address_type, - evt->data.evt_scanner_extended_advertisement_report.rssi, - &(evt->data.evt_scanner_extended_advertisement_report.data)); + match = !ble_peer_manager_is_bt_address_already_connected(&(evt->data.evt_scanner_extended_advertisement_report.address)) + && ble_peer_manager_find_match(&(evt->data.evt_scanner_extended_advertisement_report.address), + evt->data.evt_scanner_extended_advertisement_report.address_type, + evt->data.evt_scanner_extended_advertisement_report.rssi, + &(evt->data.evt_scanner_extended_advertisement_report.data)); if (match) { log_info(APP_PREFIX "Match found" NL); log_info(APP_PREFIX "Bluetooth %s address: %02X:%02X:%02X:%02X:%02X:%02X\n", @@ -1071,8 +1071,8 @@ void sl_bt_on_event(sl_bt_msg_t * evt) default: log_info("unhandled evt: %8.8x class %2.2x method %2.2x\r\n", (unsigned int)SL_BT_MSG_ID(evt->header), - (unsigned int)((SL_BT_MSG_ID(evt->header) >> 16) & 0xFF), - (unsigned int)((SL_BT_MSG_ID(evt->header) >> 24) & 0xFF) ); + (unsigned int)((SL_BT_MSG_ID(evt->header) >> 16) & 0xFF), + (unsigned int)((SL_BT_MSG_ID(evt->header) >> 24) & 0xFF) ); break; } } @@ -1149,8 +1149,8 @@ void sl_btmesh_on_event(sl_btmesh_msg_t *evt) // Default event handler. default: log_info("unhandled evt: %8.8x class %2.2x method %2.2x\r\n", (unsigned int)SL_BT_MSG_ID(evt->header), - (unsigned int)((SL_BT_MSG_ID(evt->header) >> 16) & 0xFF), - (unsigned int)((SL_BT_MSG_ID(evt->header) >> 24) & 0xFF) ); + (unsigned int)((SL_BT_MSG_ID(evt->header) >> 16) & 0xFF), + (unsigned int)((SL_BT_MSG_ID(evt->header) >> 24) & 0xFF) ); break; } } diff --git a/network/mesh_channel_sounding/reflector_switch/src/app.c b/network/mesh_channel_sounding/reflector_switch/src/app.c index 01d89ce..2ba583b 100644 --- a/network/mesh_channel_sounding/reflector_switch/src/app.c +++ b/network/mesh_channel_sounding/reflector_switch/src/app.c @@ -275,8 +275,8 @@ void sl_bt_on_event(sl_bt_msg_t *evt) // Default event handler default: app_log("unhandled evt: %8.8x class %2.2x method %2.2x\r\n", (unsigned int)SL_BT_MSG_ID(evt->header), - (unsigned int)((SL_BT_MSG_ID(evt->header) >> 16) & 0xFF), - (unsigned int)((SL_BT_MSG_ID(evt->header) >> 24) & 0xFF) ); + (unsigned int)((SL_BT_MSG_ID(evt->header) >> 16) & 0xFF), + (unsigned int)((SL_BT_MSG_ID(evt->header) >> 24) & 0xFF) ); break; } } @@ -317,8 +317,8 @@ void sl_btmesh_on_event(sl_btmesh_msg_t *evt) app_log_info(APP_PREFIX "sl_btmesh_evt_node_provisioned_id" APP_LOG_NL); /*cs_initiator_display_start_scanning(); - // Start scanning for reflector connections - log_info(APP_PREFIX "Scanning started for reflector connections..." NL);*/ + // Start scanning for reflector connections + log_info(APP_PREFIX "Scanning started for reflector connections..." NL);*/ } break; case sl_btmesh_evt_proxy_connected_id: { app_log_info(APP_PREFIX "sl_btmesh_evt_proxy_connected_id" APP_LOG_NL); @@ -329,8 +329,8 @@ void sl_btmesh_on_event(sl_btmesh_msg_t *evt) // Default event handler. default: app_log_info("unhandled evt: %8.8x class %2.2x method %2.2x\r\n", (unsigned int)SL_BT_MSG_ID(evt->header), - (unsigned int)((SL_BT_MSG_ID(evt->header) >> 16) & 0xFF), - (unsigned int)((SL_BT_MSG_ID(evt->header) >> 24) & 0xFF) ); + (unsigned int)((SL_BT_MSG_ID(evt->header) >> 16) & 0xFF), + (unsigned int)((SL_BT_MSG_ID(evt->header) >> 24) & 0xFF) ); break; } } diff --git a/network/mesh_node_removal_KBA/KBA_BT_0510 Removing Nodes From Bluetooth Mesh Network.md b/network/mesh_node_removal_KBA/KBA_BT_0510 Removing Nodes From Bluetooth Mesh Network.md index fdb30bc..c80b209 100644 --- a/network/mesh_node_removal_KBA/KBA_BT_0510 Removing Nodes From Bluetooth Mesh Network.md +++ b/network/mesh_node_removal_KBA/KBA_BT_0510 Removing Nodes From Bluetooth Mesh Network.md @@ -18,7 +18,7 @@ There are 2 ways for Bluetooth Mesh network to remove one or more nodes from the *Table 1. Comparison between Config Node Reset and Key Refresh* -In addition to excluding node(s) from the network, the key refresh procedure is also capatible to refresh the application key(s), which results in excluding node(s) from some specific group(s) but remaining in the network. One note for refreshing the application keys, it's impossible to refresh only the application keys without refresh the bound network key. +In addition to excluding node(s) from the network, the key refresh procedure is also capable of refreshing the application key(s), which results in excluding node(s) from some specific group(s) but remaining in the network. One note for refreshing the application keys, it's impossible to refresh only the application keys without refresh the bound network key. ## How Key Refresh Works