Skip to content

Commit cf75166

Browse files
committed
feat : Release SDK v2.2.4
Signed-off-by: Junyoun <[email protected]>
1 parent 87d9bfd commit cf75166

File tree

71 files changed

+5226
-1164
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+5226
-1164
lines changed

CHANGELOG

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,53 @@
11
# HISTORY
22

3+
## 2.2.4 : Changes for version 2.2.4
4+
5+
Bug fixed:
6+
7+
- Fix that mn data is null in ble adv packet
8+
9+
## 2.2.3 : Changes for version 2.2.3
10+
11+
New Improvements or features:
12+
13+
- Add Porting code for BK7236 board
14+
- Add BLE onboarding feature for raspberry example
15+
16+
Enhancements or amendments:
17+
18+
- Refactoring BLE porting APIs
19+
-- Remove BLE adv manufacturer type internal format (Move to SDK core)
20+
-- Integrate BLE porting callbacks to one struct
21+
22+
Bug fixed:
23+
24+
- Make SDK not proceed next step if the device isn't confined during onboarding
25+
26+
## 2.2.2 : Changes for version 2.2.2
27+
28+
Bug fixed:
29+
30+
- ESP32 wifi reconnect to AP on wifi failure
31+
- Add ESP32 wifi error handling
32+
- Resolve stuck issue after sending MQTT publish packet
33+
- Add write timeout in MQTT client
34+
35+
## 2.2.1 : Changes for version 2.2.1
36+
37+
Enhancements or amendments:
38+
39+
- Replace wifi update Capability from custom to standard
40+
41+
## 2.2.0 : Changes for version 2.2.0
42+
43+
New Improvements or features:
44+
45+
- Add Wifi update feature.(Device can change Wifi after onboarding)
46+
47+
Enhancements or amendments:
48+
49+
- Add antiSnoringPillow Capability helper header
50+
351
## 2.1.1 : Changes for version 2.1.1
452

553
Bug fixed:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ For more information, please review the following documents:
6565

6666
- [Getting Started](./doc/getting_started.md) : It covers the overall workflow and detailed steps for starters to work with SDK.
6767
- [API References](./doc/APIs.md) : It provide all API reference that SDK offers.
68-
- [Commercialization Guide](./doc/Commercialization_Guide) : It provides guide for ones who consider commercializing their IoT products with SDK.
68+
- [Commercialization Guide](./doc/Commercialization_Guide.md) : It provides guide for ones who consider commercializing their IoT products with SDK.
6969
- [Capabilities Reference](https://developer.smartthings.com/docs/devices/capabilities/capabilities-reference) : This page serves as a reference for the supported capabilities.
7070
- [Developer Workspace](https://developer.smartthings.com/workspace/) : It provides functions related to device information registration and device integration in the SmartThings cloud.
7171

doc/STDK_Config.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
## Common
2+
3+
#### CONFIG_STDK_IOT_CORE
4+
- Type : Bool
5+
- Description : Enable SmartThings Device SDK block
6+
7+
## Target Porting System
8+
9+
#### CONFIG_STDK_IOT_CORE_BSP_SUPPORT_ESP32
10+
- Type : Bool
11+
- Description : Choose esp32 board as target bsp board
12+
13+
#### CONFIG_STDK_IOT_CORE_BSP_SUPPORT_ESP32S2
14+
- Type : Bool
15+
- Description : Choose esp32s2 board as target bsp board
16+
17+
#### CONFIG_STDK_IOT_CORE_BSP_SUPPORT_ESP32C3
18+
- Type : Bool
19+
- Description : Choose esp32c3 board as target bsp board
20+
21+
#### CONFIG_STDK_IOT_CORE_OS_SUPPORT_FREERTOS
22+
- Type : Bool
23+
- Description : Choose freertos as target os system
24+
25+
#### CONFIG_STDK_IOT_CORE_OS_SUPPORT_POSIX
26+
- Type : Bool
27+
- Description : Choose posix compatible system as target os system
28+
29+
## Onboarding
30+
#### CONFIG_STDK_IOT_CORE_EASYSETUP_HTTP
31+
- Type : Bool
32+
- Description : STDK will use HTTP(softAP) method for onboarding.
33+
34+
#### CONFIG_STDK_IOT_CORE_EASYSETUP_BLE
35+
- Type : Bool
36+
- Description : STDK will use BLE method for onboarding.
37+
38+
#### CONFIG_STDK_IOT_CORE_EASYSETUP_DISCOVERY_ADVERTISER
39+
- Type : Bool
40+
- Description : STDK will use BLE advertisement for onboarding.
41+
42+
## Log Level
43+
#### CONFIG_STDK_IOT_CORE_LOG_LEVEL_ERROR
44+
- Type : Bool
45+
- Description : Print error level message log.
46+
47+
#### CONFIG_STDK_IOT_CORE_LOG_LEVEL_WARN
48+
- Type : Bool
49+
- Description : Print warn level message log.
50+
51+
#### CONFIG_STDK_IOT_CORE_LOG_LEVEL_INFO
52+
- Type : Bool
53+
- Description : Print info level message log.
54+
55+
#### CONFIG_STDK_IOT_CORE_LOG_LEVEL_DEBUG
56+
- Type : Bool
57+
- Description : Print debug level message log.
58+
59+
## Security
60+
#### CONFIG_STDK_IOT_CORE_USE_MBEDTLS
61+
- Type : Bool
62+
- Description : STDK will use thin wrappers around mbedTLS for Crypto (sha, sign, ...) operations.
63+
64+
#### CONFIG_STDK_IOT_CORE_CRYPTO_SUPPORT_RSA
65+
- Type : Bool
66+
- Description : STDK support RSA device key type.
67+
68+
#### CONFIG_STDK_IOT_CORE_CRYPTO_SUPPORT_ECDSA
69+
- Type : Bool
70+
- Description : STDK support ECDSA device key type.
71+
72+
#### CONFIG_STDK_IOT_CORE_CRYPTO_SUPPORT_ED25519
73+
- Type : Bool
74+
- Description : STDK support ED25519 device key type.
75+
76+
#### CONFIG_STDK_IOT_CORE_SUPPORT_STNV_PARTITION
77+
- Type : Bool
78+
- Description : STDK load device key from stnv partition.
79+
80+
#### CONFIG_STDK_IOT_CORE_SECURITY_BACKEND_SOFTWARE
81+
- Type : Bool
82+
- Description : SW based security block like mbedtls is used for security operation.
83+
84+
#### CONFIG_STDK_IOT_CORE_SECURITY_BACKEND_HARDWARE
85+
- Type : Bool
86+
- Description : HW based security block like SE is used for security operation.
87+
88+
## Feature
89+
#### CONFIG_STDK_IOT_CORE_EASYSETUP_WIFI_UPDATE
90+
- Type : Bool
91+
- Description : Enable wifi update functionality.

doc/getting_started.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,14 @@ void app_main(void)
342342
343343
&nbsp;
344344
345+
### Configuration
346+
347+
Regarding configuration, we provide [samples](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/tree/main/apps) in STDK Reference.
348+
Please determine the required configuration based on the product specifications and refer to [samples](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/tree/main/apps) for usage.
349+
For explanations related to STDK configuration, please refer to [the provided link](./STDK_Config.md).
350+
351+
&nbsp;
352+
345353
### Build the App
346354
347355
There are README files in each example foler. And it explains how to build the example in each chipset environment with SmartThings Device SDK.

doc/porting_guide.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ For additional information about API parameters, please refer to the [API docume
162162
163163
| APIs | Description |
164164
| ------------------------------------------------------------ | -------------------------- |
165-
| iot_error_t iot_bsp_system_get_time_in_sec ( char * buf, unsigned int buf_len ) | Get system time in second. |
165+
| iot_error_t iot_bsp_system_get_time_in_sec ( time_t * time_in_sec ) | Get system time in second. |
166166
| void iot_bsp_system_poweroff ( ) | Shutdown system. |
167167
| void iot_bsp_system_reboot ( ) | Restart system. |
168-
| iot_error_t iot_bsp_system_set_time_in_sec ( const char * time_in_sec ) | Set system time in second. |
168+
| iot_error_t iot_bsp_system_set_time_in_sec ( time_t time_in_sec ) | Set system time in second. |
169169
| const char *iot_bsp_get_bsp_name ( ) | Get bsp name. |
170170
| const char *iot_bsp_get_bsp_version_string ( ) | Get bsp version string. |
171171
@@ -188,15 +188,12 @@ For additional information about API parameters, please refer to the [API docume
188188

189189
| APIs | Description |
190190
| ------------------------------------------------------------ | ------------------------------------------------------------ |
191-
| void iot_bsp_ble_init(CharWriteCallback cb) | Initialize BLE function. |
191+
| iot_error_t iot_bsp_ble_init( iot_ble_cbs_t * ble_cbs) | Initialize BLE function. |
192192
| void iot_bsp_ble_deinit(void) | Deinitizlize BLE function. |
193-
| void iot_bsp_send_indication(uint8_t *buf, uint32_t len) | Send indication. |
194-
| void iot_bsp_create_advertise_packet(char *mnid, char *setupid, char *serial) | Create Advertise packet. |
195-
| void iot_bsp_create_scan_response_packet(char *device_onboarding_id, char *serial) | Create Scan Response packet. |
196-
| void iot_bsp_gatt_init(void) | Initialize Gatt function. |
197-
| uint32_t iot_bsp_ble_get_mtu(void) | Get MTU size. |
198-
| iot_error_t iot_bsp_ble_register_event_cb(iot_bsp_ble_event_cb_t cb) | Register BLE event callback. |
199-
| void iot_bsp_ble_clear_event_cb(void) | Clear BLE event callback. |
193+
| int iot_send_indication( uint8_t * buf, uint32_t len ) | Send indication. |
194+
| uint32_t iot_bsp_ble_get_mtu( ) | Get MTU size. |
195+
| int iot_bsp_ble_start_adv( uint16_t mn_code, uint8_t * mn_data, size_t mn_data_len, char * local_name ) | Start BLE advertiserment. |
196+
| int iot_bsp_ble_get_mac_address( uint8_t mac_address[6] ) | Get BLE MAC address. |
200197

201198
#### Debug
202199

@@ -223,11 +220,6 @@ These APIs are related to operating system.
223220
| int iot_os_mutex_lock ( iot_os_mutex * mutex ) | This function will lock mutex before critical section |
224221
| int iot_os_mutex_unlock ( iot_os_mutex * mutex ) | This function will unlock mutex after critical section |
225222
| iot_os_mutex_destroy(iot_os_mutex* mutex) | This function will destroy mutex |
226-
| iot_os_queue* iot_os_queue_create ( int queue_length, <br/> int item_size ) | This function create queue and return queue handle |
227-
| void iot_os_queue_delete ( iot_os_queue * queue_handle ) | This function delete queue |
228-
| int iot_os_queue_receive ( iot_os_queue * queue_handle, <br/> void * data, <br/> unsigned int wait_time_ms ) | This function will receive item from the front of queue |
229-
| int iot_os_queue_reset ( iot_os_queue * queue_handle ) | This function reset queue |
230-
| int iot_os_queue_send ( iot_os_queue * queue_handle, <br/> void * data, <br/> unsigned int wait_time_ms ) | This function will send item to the back of queue |
231223
| int iot_os_thread_create ( void * thread_function, <br/> const char * name, <br/> int stack_size, <br/> void * data, <br/> int priority, <br/> iot_os_thread * thread_handle ) | This function create and run thread |
232224
| void iot_os_thread_delete ( iot_os_thread thread_handle ) | This function delete thread |
233225
| void iot_os_thread_yield ( ) | This function yields task |

example/raspberry/README.md

Lines changed: 76 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,93 @@
44

55
1. Raspberry Pi 4 Model B
66

7-
2. Raspberry Pi OS(32-bit) Released : 2023-02-21
7+
2. Raspberry Pi OS (64-bit) - Debian ver: 12 (bookworm), Kernel ver: 6.6.74+rpt-rpi-v8
88

99
3. apt-get install git cmake libglib2.0-dev
1010

1111
4. Stop Network Manager service. (systemctl stop NetworkManager)
1212
(Because we manipulate wlan0 with wpa_supplicant, need to stop other network interference)
1313

14-
5. Run `git submodule update --init --recursive` on the SDK to download all modules.
14+
5. Download all dependent submodules
1515

1616
```sh
1717
$ cd st-device-sdk-c/
1818
$ git submodule update --init --recursive
1919
```
2020

21-
## How to build example
21+
## Update RPi BLE stack
2222

23-
1. Move to example/raspberry directory, run cmake and build example.
23+
I. Custom scan response:
24+
25+
The BlueZ BLE stack package needs to be updated to add custom data in ble scan response packet
26+
27+
> **_NOTE:_**
28+
> The following steps have been verified on RPi with Bluez v5.66
29+
30+
1. Get the bluez source code
31+
32+
```sh
33+
$ apt-get source bluez
34+
```
35+
36+
2. Move to bluez `patches` directory (eg: bluez-5.66) and copy bluez patches from `st-device-sdk-c` repo
37+
38+
```sh
39+
$ cd bluez-xxx/debian/patches
40+
$ cp <st-device-sdk-c dir path>/example/raspberry/patches/bluez/*.patch .
41+
```
42+
43+
3. In the same bluez `patches` folder, update `series` file to mention names of the 3 bluez patches
44+
45+
```sh
46+
0001-add-manufacturer-data-for-scan-response.patch
47+
0002-add-documentation-for-property-ManufacturerDataSR.patch
48+
0003-add-manufacturer-data-at-the-end.patch
49+
```
50+
51+
4. Move to bluez main directory and rebuild bluez package
52+
53+
```sh
54+
$ cd bluez-xxx/
55+
$ debuild -us -uc -b
56+
```
57+
58+
> **_NOTE:_**
59+
> If there are build errors:\
60+
> a. For build error that mentions installation of dependencies
61+
> ```sh
62+
> $ sudo apt install flex bison libdw-dev libudw-dev
63+
> ```
64+
> b. For other build errors, try with '-d' option
65+
> ```sh
66+
> $ sudo debuild -us -uc -b -d
67+
> ```
68+
69+
5. Install the updated bluez package (eg: bluez_5.66-1+deb12u2_armhf.deb)
70+
71+
```sh
72+
$ sudo dpkg -i ../bluez_xxx-deb12u2-xxx.deb
73+
```
74+
75+
6. Restart Bluetooth service
76+
77+
```sh
78+
$ sudo systemctl restart bluetooth.service
79+
```
80+
81+
II. Prevent pairing popups:
82+
83+
Configure BlueZ to prevent pairing popups and to stop reverse service discovery
84+
85+
1. Edit `/etc/bluetooth/main.conf` file to disable `ReverseServiceDiscovery` flag
86+
```sh
87+
- #ReverseServiceDiscovery = true
88+
+ ReverseServiceDiscovery = false
89+
```
90+
91+
## How to build and run example
92+
93+
1. Move to `st-device-sdk-c` example directory, run cmake and build example.
2494

2595
```sh
2696
$ cd st-device-sdk-c/example/raspberry
@@ -29,9 +99,9 @@
2999
$ make
30100
```
31101

32-
2. To test your registered devices on DevWS, replace onboarding_config.json and device.json with yours before build. (Refer [Getting Started](../..//doc/getting_started.md))
102+
2. To test your registered devices on DevWS, replace `onboarding_config.json` and `device_info.json` with yours before build. (Refer [Getting Started](../..//doc/getting_started.md))
33103

34-
3. Excute example with root right and test (sudo ./example)
104+
3. Execute example with root rights and test
35105

36106
```sh
37107
$ sudo ./example

0 commit comments

Comments
 (0)