Skip to content
Merged
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
1 change: 0 additions & 1 deletion .github/coding-convention-tool
Submodule coding-convention-tool deleted from bd0d67
1 change: 0 additions & 1 deletion .github/formatting_config/ignore-words.txt

This file was deleted.

102 changes: 26 additions & 76 deletions .github/workflows/00-Check-Code-Convention.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion models/switch_ncp_host/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion network/mesh_channel_sounding/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
![mesh_app](images/mesh_app.png)
34 changes: 17 additions & 17 deletions network/mesh_channel_sounding/initiator_light/src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand All @@ -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);
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down
12 changes: 6 additions & 6 deletions network/mesh_channel_sounding/reflector_switch/src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading