Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gh 14/UI c 3082/phcoval/node/main #14

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 4 additions & 4 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"slc_cli_linux.zip" filter=lfs diff=lfs merge=lfs -text
"zap_apack_linux.zip" filter=lfs diff=lfs merge=lfs -text
"zap_2022.1.10_amd64.deb" filter=lfs diff=lfs merge=lfs -text
"bridge_binaries.zip" filter=lfs diff=lfs merge=lfs -text
"zap-2022.1.10.dmg" filter=lfs diff=lfs merge=lfs -text
"slc_cli_mac.zip" filter=lfs diff=lfs merge=lfs -text
"zap_apack_mac.zip" filter=lfs diff=lfs merge=lfs -text
"zap-2022.1.10.dmg" filter=lfs diff=lfs merge=lfs -text
"slc_cli_linux.zip" filter=lfs diff=lfs merge=lfs -text
"zap_apack_linux.zip" filter=lfs diff=lfs merge=lfs -text
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ set(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/include/"
# ##############################################################################
# Include Configurations
# ##############################################################################
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "default build type: Debug" FORCE)
endif()

message(STATUS "Building Unify with BUILD_TYPE=${CMAKE_BUILD_TYPE}")

include(cmake/include/version.cmake)
Expand Down
57 changes: 57 additions & 0 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
@@@UnifyCore @naagarwa @mamehta @sushanka @sabollim
@@@UnifyZWave @phcoval
# Temporarily adding core team as reviewer for Zigbee
@@@UnifyZigbee @naagarwa @sushanka @sabollim
@@@UnifyBT @tabenyhe @tahornos
@@@Documentation @naagarwa @mamehta @phcoval @nibertol @tabenyhe @jutiron @bolabbe
@@@UnifyFwkServices @naagarwa @mamehta @sushanka @sabollim
@@@UnifyIoTServices @naagarwa @sushanka @sabollim
@@@CICD @naagarwa @dethammi @sushanka
@@@UnifyMultiProtcol @nibertol @supratap @frkillee @ismaghni @alautott

# Pipeline rule and scripts
Jenkinsfile @@CICD
scripts/ @@CICD

# Documentations
**/*.md @@Documentation
doc/ @@Documentation

components/ @@UnifyCore
docker/ @@UnifyCore
cmake/ @@UnifyCore
portable_runtime/ @@UnifyCore
applications/aox/ @@UnifyBT
applications/bt_host_empty/ @@UnifyBT
applications/cpc-hci-bridge/ @@UnifyBT
applications/cpcd/ @@UnifyMultiProtcol
applications/dev_ui/ @@UnifyIoTServices
applications/examples/ @@UnifyCore
applications/gms/ @@UnifyFwkServices
applications/home_assistant/ @@UnifyIoTServices
applications/image_provider/ @@UnifyFwkServices
applications/nal/ @@UnifyFwkServices
applications/openthread_border_router/ @@UnifyMultiProtcol
applications/upti_cap/ @@UnifyFwkServices
applications/upti_writer/ @@UnifyFwkServices
applications/upvl/ @@UnifyFwkServices
applications/zigbeed/ @@UnifyZigbee
applications/zigpc/ @@UnifyZigbee
applications/zpc/ @@UnifyZWave

CODEOWNERS @@UnifyCore



# If a group is involved, at least one reviewer of the group must approve
(Check(@@UnifyCore >= 1))
(Check(@@UnifyZigbee >= 1))
(Check(@@UnifyZWave >= 1))
(Check(@@UnifyBT >= 1))
(Check(@@UnifyFwkServices >= 1))
(Check(@@UnifyIoTServices >= 1))
(Check(@@UnifyMultiProtcol >= 1))
(Check(@@CICD >= 1))
(Check(@@Documentation >= 1))

OverallCheck(2)
96 changes: 96 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Contributing to UnifySDK

## Reporting issues

Currently there is no way to report issue in the github project,
however supported @SiliconLabs customers can report cases individually.

## Git Branch naming conventions

There is no strong requirement for now, but user are encouraged to
track their changes by prefixing branch names with meaningful prefixes
such as "feature" or "bugfix".

If the change refers to existing context id, feel free to add it.

| Sl No | Type of Branch | Use Case | Example |
| ----- | -------------- | -------- |-------- |
| 1 | Feature Branches | For developing new features or functionalities. These branches are often used for longer-lived work and may be merged into the main branch when completed. |feature/user-authentication
| 2 | Bugfix Branches | For addressing specific issues or bugs. Bugfix branches are created to isolate and fix a problem, and they're often merged back into the main branch (or a release branch) once the fix is verified. | bugfix/GH-1234-fix-for-UMB-crash
| 3 | Experimental Branches | For highly experimental or uncertain work that may or may not make it into the main codebase. These branches allow team members to collaborate on new ideas without affecting the main development flow | experimental/GH-1234-migration-of-core
| 4 | Documentation Branches | For creating or updating documentation, such as README files, user guides, or API documentation. Separate documentation branches make it easier to manage documentation changes independently from code changes | docs/GH-1234-updates-readme
| 5 | Refactoring Branches | For making significant changes to the codebase that don't add new features or fix bugs but improve the code's structure, readability, or maintainability. Separate refactoring branches help keep refactoring efforts organized | refactor/GH-1234-refactors-authentication-module
| 6 | Test Branches | For adding or modifying test cases. These branches allow for the isolation of test-related changes and help maintain a robust testing suit | test/adds -thermostat-test-cases

## Commit message format

Commit message should not exceed 50 characters.

Within your commits, you can include a commit description,
allowing to add even more detail / context as to what you did.

Add an empty line underneath the commit message,
and begin writing a description from line 3.

Example:

```
GH-XYZ: Fix issue with login button not showing.

- Update login form validation
- Update login styling for showing the button
```

| Sl No | Commit Message Examples |
| ----- | ----------------------- |
| 1 | Add support for thermostat cluster |
| 2 | Remove python2 deprecated dependencies |
| 3 | Update rust dependencies to latest version |
| 4 | Fix portable runtime crash |
| 5 | Refactor core components into rust |
| 6 | Add unit tests for thermostat cluster |

## Pull request guidelines

### As a Developer

What to consider while raising a Pull Request

* Pull request naming

```
Context: <message clearing explaining what commit does>
```

* Write a useful description in the “details” section of the pull request. i.e, mention the root cause of problem and approach of the solution.
* Max size of Pull request should be < 300 lines (excluding autogenerated code)
* If Changes are greater than 300 lines, split the changes into logical groups using multiple PRs.
* Pull Request should be raised only after successful execution of the existing unit Test cases.
* One Pull Request should address only one issues (don’t combine multiple changes, this applies for indentation changes as well)
* Don’t change the code while reviewing, use "Draft" state for asking developers not to review the code or to block merging of code.
* Design the code in a modular fashion that allows functional tesing.

### As a Reviewer

What to consider while reviewing a Pull Request

* Does the code has successful build?
* Does the code follow unify coding guidelines?
* Does the code meet its objective / acceptance criteria?
* Does the code have unit test and documentation included?
* Does the code need any refactoring, considering security, performance or simply ease of reading?
* Use "Suggestion" feature which allows you to add a code suggestion directly into the comment, which can instantly be accepted and committed from within the PR.
* Write clear comments. Describe the issue, why you don’t agree (mistakes, errors, violations against conventions, performance risk, security issues, etc.), and propose other solutions to simplify and improve the code.
* If any of the comments need to be addressed mandatorily, mark the pull request as “Draft”

## Unit tests

All contributors have to manually run the unit test locally before raising the Pull request.

* Inside docker, build with -DBUILD_TESTING=ON.
* Then “ninja” and “ninja test” (this command runs all the tests.)

If you want to test individually
you can do by running test executables from shell

Build and unit tests are run from contributor fork using github actions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:bullseye
FROM debian:bookworm

ENV DEBIAN_FRONTEND noninteractive
ENV LC_ALL en_US.UTF-8
Expand Down
2 changes: 1 addition & 1 deletion applications/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Fetch dependencies if forced
if(FETCH_GSDK MATCHES ON)
find_package(GeckoSDK 4.3.0 REQUIRED)
find_package(GeckoSDK 2024.6.0 REQUIRED)
endif()

# Build options will determine if the applications will be included and build
Expand Down
2 changes: 1 addition & 1 deletion applications/aox/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
find_package(GeckoSDK 4.3.0 REQUIRED)
find_package(GeckoSDK 2024.6.0 REQUIRED)

add_subdirectory(components)
add_subdirectory(applications)
4 changes: 3 additions & 1 deletion applications/aox/applications/aoxpc/aoxpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ void aoa_db_on_tag_added(aoa_db_entry_t *tag)
return;
}

ec = aoa_init_rtl((aoa_state_t *)tag->user_data, locator_unid);
ec = aoa_init_rtl((aoa_state_t *)tag->user_data,
locator_unid,
sl_log_get_level() == SL_LOG_DEBUG);
if (ec != SL_RTL_ERROR_SUCCESS) {
sl_log_critical(LOG_TAG, "aoa_init_rtl failed: %d", ec);
panic();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ PROCESS_THREAD(ncp_process, ev, data)
while (1) {
switch (ev) {
case PROCESS_EVENT_INIT:
sl_log_info(LOG_TAG, "Reset NCP");
sl_bt_system_reset(sl_bt_system_boot_mode_normal);
ncp_flush();
sl_log_info(LOG_TAG, "Reset NCP");
sl_bt_system_reboot();
break;
case BT_EVENT:
if (NULL != ncp_bt_on_event) {
Expand All @@ -62,7 +62,7 @@ PROCESS_THREAD(ncp_process, ev, data)
free(data);
break;
case BT_RESET:
sl_bt_system_reset(sl_bt_system_boot_mode_normal);
sl_bt_system_reboot();
break;
}
PROCESS_WAIT_EVENT();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,17 @@ static void update_progress(size_t uploaded_size, size_t total_size)
printf("\r%zu/%zu (%d%%)", uploaded_size, total_size, percentage);
}

static sl_status_t system_reset(uint8_t boot_mode) {
static sl_status_t system_reset(bool dfu) {
sl_status_t sc;
sl_bt_msg_t evt;
uint32_t expected_event, received_event;

switch (boot_mode) {
case sl_bt_system_boot_mode_normal:
expected_event = sl_bt_evt_system_boot_id;
sl_bt_system_reset(boot_mode);
break;
case sl_bt_system_boot_mode_uart_dfu:
expected_event = sl_bt_evt_dfu_boot_id;
sl_bt_user_reset_to_dfu();
break;
default:
// Unsupported boot mode
return SL_STATUS_INVALID_PARAMETER;
break;
if (dfu) {
expected_event = sl_bt_evt_dfu_boot_id;
sl_bt_user_reset_to_dfu();
} else {
expected_event = sl_bt_evt_system_boot_id;
sl_bt_system_reboot();
}

sc = sl_bt_wait_event(&evt);
Expand Down Expand Up @@ -90,10 +83,10 @@ sl_status_t aoxpc_ncp_update_fixt_setup()

if (do_ncp_update || ncp_version) {
// Just print the firmware version
(void)system_reset(sl_bt_system_boot_mode_normal);
(void)system_reset(false);

if (do_ncp_update) {
if (system_reset(sl_bt_system_boot_mode_uart_dfu) != SL_STATUS_OK) {
if (system_reset(true) != SL_STATUS_OK) {
return SL_STATUS_FAIL;
}
sl_log_info(LOG_TAG, "Pressing Crtl+C aborts the update process.");
Expand All @@ -105,7 +98,7 @@ sl_status_t aoxpc_ncp_update_fixt_setup()

if (sc == SL_STATUS_OK) {
sl_log_info(LOG_TAG, "DFU finished successfully. Resetting the device.");
if (system_reset(sl_bt_system_boot_mode_normal) != SL_STATUS_OK) {
if (system_reset(false) != SL_STATUS_OK) {
return SL_STATUS_FAIL;
}
} else {
Expand Down
6 changes: 5 additions & 1 deletion applications/aox/applications/aoxpc/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# AoXPC Release Notes

## [1.3.2] - Jun 2023

## [1.6.0] - Aug 2024

* Reference platform updated to Bookworm 64-bit based Raspberry Pi OS.
* Migrated to [Bluetooth SDK](https://www.silabs.com/documents/public/release-notes/bt-software-release-notes-8.0.0.0.pdf) and [Bluetooth Location Services] (https://www.silabs.com/documents/public/release-notes/bt-rtl-library-release-notes-8.0.0.0.pdf)

## [1.3.1] - Mar 2023

Expand Down
5 changes: 5 additions & 0 deletions applications/aox/applications/positioning/release_notes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# AoX Positioning application Release Notes

## [1.6.0] - Aug 2023

* Reference platform updated to Bookworm 64-bit based Raspberry Pi OS.
* Migrated to [Bluetooth SDK](https://www.silabs.com/documents/public/release-notes/bt-software-release-notes-8.0.0.0.pdf) and [Bluetooth Location Services] (https://www.silabs.com/documents/public/release-notes/bt-rtl-library-release-notes-8.0.0.0.pdf)

## [1.3.2] - Jun 2023

## [1.3.1] - Mar 2023
Expand Down
25 changes: 24 additions & 1 deletion applications/aox/components/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
add_subdirectory(app_log_wrapper)
add_subdirectory(rtl_lib)
add_subdirectory(ucl_mqtt_helper)

# Components from GSDK
Expand Down Expand Up @@ -85,3 +84,27 @@ target_compile_options(aoa_cjson
)

set_target_properties(aoa_cjson PROPERTIES OUTPUT_NAME "cjson")

# ##############################################################################
# Real-Time Locationing library
# ##############################################################################
add_library(rtl_lib STATIC IMPORTED GLOBAL)

target_link_libraries(rtl_lib INTERFACE stdc++)
target_link_options(rtl_lib INTERFACE $<$<C_COMPILER_ID:GNU>:-no-pie>)

# Find library for current platform
string(TOLOWER ${CMAKE_SYSTEM_NAME} SYSTEM_NAME)
string(TOLOWER ${CMAKE_SYSTEM_PROCESSOR} SYSTEM_PROCESSOR)
# TODO: remove this workaround once CMAKE_SYSTEM_PROCESSOR is fixed for RPI.
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armhf")
set(SYSTEM_PROCESSOR "armv7l")
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
set(SYSTEM_PROCESSOR "aarch64")
endif()

set_target_properties(rtl_lib PROPERTIES
IMPORTED_LOCATION ${GeckoSDK_ROOT_DIR}/util/silicon_labs/aox/lib/release/gcc/${SYSTEM_PROCESSOR}/${SYSTEM_NAME}/libaox_static.a
INTERFACE_INCLUDE_DIRECTORIES ${GeckoSDK_ROOT_DIR}/util/silicon_labs/aox/inc
INTERFACE_COMPILE_DEFINITIONS "RTL_LIB"
)
23 changes: 0 additions & 23 deletions applications/aox/components/rtl_lib/CMakeLists.txt

This file was deleted.

5 changes: 0 additions & 5 deletions applications/aox/components/rtl_lib/inc/license.txt

This file was deleted.

Loading