port: sisdk: add Hubble Device SDK as SiLabs extension - #339
HongNguyen635 wants to merge 2 commits into
Conversation
0ea1dd9 to
ae9dba1
Compare
|
|
||
| // <<< end of configuration section >>> | ||
|
|
||
| /* |
There was a problem hiding this comment.
I don't like these block bellow very much. I would rather have symbols used defined and options not selected can be comments if you want.
There was a problem hiding this comment.
I also thought about just reuse the config.h header from FreeRTOS port, but this is the style that SiLabs use, which will show up in the Configurator UI like so:
Whereas the plain #define block doesn't show up. An example reference I used is this file from SiSDK.
| #endif | ||
|
|
||
| /* Matching the counter source selection to the right config symbol */ | ||
| #if CONFIG_HUBBLE_COUNTER_SOURCE |
There was a problem hiding this comment.
This is does not look correct, we have it to group possible options in Kconfig, here you have make an implicit association CONFIG_HUBBLE_COUNTER_SOURCE == 1 == CONFIG_HUBBLE_COUNTER_SOURCE_DEVICE_UPTIME.
There was a problem hiding this comment.
I spent some time trying to find a workaround for this. But this is the best I could come up with.
I can make it like this:
// <o CONFIG_HUBBLE_COUNTER_SOURCE> Counter source
// <HUBBLE_COUNTER_SOURCE_UNIX_TIME=> Unix time
// <HUBBLE_COUNTER_SOURCE_DEVICE_UPTIME=> Device uptime
#define CONFIG_HUBBLE_COUNTER_SOURCE HUBBLE_COUNTER_SOURCE_UNIX_TIME
but I can't compare #if CONFIG_HUBBLE_COUNTER_SOURCE == HUBBLE_COUNTER_SOURCE_UNIX_TIME unless I assigned value to it, which goes back to the implicit value association.
I can name the symbol different than CONFIG_HUBBLE_COUNTER_SOURCE to prevent the confusion, but that is the best way I could think of.
| - name: SL_BOARD_ENABLE_VCOM | ||
| value: "1" | ||
| - name: SL_IOSTREAM_EUSART_VCOM_CONVERT_BY_DEFAULT_LF_TO_CRLF | ||
| value: "1" |
There was a problem hiding this comment.
Shouldn't the SDK options be defined like this instead of using the header ?
There was a problem hiding this comment.
This way allows you to define arbitrary configs or override existing one, while having the header ties it to the SDK extension, so it can show up in the UI and have default values. We can remove the header, but then user have to manually copy/add these options on every new project.
ae9dba1 to
5de2da7
Compare
| sl_status_t status; | ||
|
|
||
| if (!app_log_check_level(app_level[level])) { | ||
| return 0; |
There was a problem hiding this comment.
Shouldn't it return -EINVAL ?
There was a problem hiding this comment.
This is not an error though, if your level is only upto info, and the caller is debug type, it should be supressed. The zephyr port also do something similar.
ceolin
left a comment
There was a problem hiding this comment.
Few comments to review, it is so simple, that is awesome :)
5de2da7 to
6c263fd
Compare
In order to use Hubble Device SDK with SiLabs toolchain, we need to add it as an extension. This commit adds the necessary files to make the Hubble SDK works as a SiSDK extension. Currently, the port only supports the BLE (Terrestrial) network. Signed-off-by: Hong Nguyen <hong@hubble.com>
Add basic BLE beacon sample to demonstrate Hubble SDK as an extension for SiSDK (FreeRTOS). Signed-off-by: Hong Nguyen <hong@hubble.com>
6c263fd to
1424282
Compare
Overview:
ble-beaconsample.Currently, the project works with Simplicity Studio 6 and the cli tool (
slt,slc-cli). Documentation for quick start, guide, and CI will be added in future PR.