Skip to content

Commit 9aa6d80

Browse files
authored
Merge pull request #135 from SmartThingsCommunity/develop
Release v 1 8 12
2 parents 662f1aa + 484f667 commit 9aa6d80

File tree

61 files changed

+3472
-1387
lines changed

Some content is hidden

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

61 files changed

+3472
-1387
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
cmake_minimum_required(VERSION 3.13)
22
project(st_device_sdk_c C)
33

4-
set(CMAKE_C_STANDARD 99)
5-
64
set(CMAKE_CXX_FLAGS_UNITTEST "-g --coverage -DSUPPORT_TC_ON_STATIC_FUNC" CACHE STRING
75
"Flags used by the C++ compiler during unit test builds."
86
FORCE)

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ For more information, please review the following documents:
7878
- [Capabilities Reference](https://developer.smartthings.com/docs/devices/capabilities/capabilities) : This page serves as a reference for the supported capabilities.
7979
- [Developer Workspace](https://smartthings.developer.samsung.com/workspace/) : It provides functions related to device information registration and device integration in the SmartThings cloud.
8080

81+
## Contact
82+
83+
If you have any issue, or want to commercialize your IoT devices using this SDK, please contact [email protected] or open new issue.
84+
8185
## License
8286

8387
This library is licensed under the [Apache License Ver2.0](LICENSE).

doc/STDK_QR.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
# How to create QR code for SmartThings Device SDK
1+
# How to create QR code for SmartThings SDK for Direct Connected Devices
22

33
### Introduction
4-
SmartThings Device SDK allows users to pair their devices with the SmartThings App through a process called device onboarding.
4+
SmartThings SDK for Direct Connected Devices allows users to pair their devices with the SmartThings App through a process called device onboarding.
55
This "device onboarding" process involves confirming whether this device is owned by the user through the user's operation.
6-
STDK provides four methods for this. These four methods are Just Works, Button Confirm, Pin Code Confirm, and QR Code Confirm.
6+
SmartThings SDK provides four methods for this. These are `Just Works`, `Button Confirm`, `Pin Code Confirm`, and `QR Code Confirm`.
77
When registering an onboarding profile in Developer Workspace, the developer can select methods will be used to check whether the device to be paired with the SmartThings App is owned by the user during onboarding.
88
Using QR code is not only used for user verification, but also helps user to onboarding user's device quickly and accurately.
9-
In the "Add device" menu of the SmartThings App, the onboarding process starts by only scanning QR provided through the "Scan QR code".
9+
10+
In the "Add device" menu of the SmartThings App, the onboarding process starts by only scanning QR provided through the "Scan QR code".
11+
12+
:warning: **QR code is required while pairing device when user uses iOS version of SmartThings app, regardless of ownership confirm type.**
13+
1014

1115
### Information included in QR code
1216
The QR code includes the following three pieces of information, and the manufacturer can generate the QR code with the information of each device and provide it to the user.

doc/getting_started.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ The device onboarding guides device owners when their device is first registerin
6363

6464
The product info defines how this device is shown at SmartThings mobile app catalog.
6565
You can define device’s category and its regional availability.
66+
> **_NOTE:_** If user or tester samsung account country is not in availability list, they can't onboard the device. Please check the regional availability before device test or production.
6667
6768
![create product info](./res/add-product-info.gif)
6869

@@ -91,7 +92,7 @@ Key generator utility (keygen.py) is located at `st-device-sdk-c/tools/keygen/`.
9192
Serial number for testing device would be randomly generated by this tool which has STDK + 12-digit alphanumberic format.
9293

9394
```sh
94-
$ cd ~/st-device-sdk-c-ref/iot-core/tools/keygen/
95+
$ cd {SDK_ROOT}/tools/keygen/
9596
$ python3 stdk-keygen.py --firmware switch_example_001
9697
Use following serial number and public key
9798
for the identity of your device in Developer Workspace.

example/esp32/README.md

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,49 @@
22

33
## Build environment
44

5-
1. Download ESP IDF v4.3.1 SDK version(git commit : 2e74914051d14ec2290fc751a8486fb51d73a31e)
5+
1. Download ESP IDF v5.0 SDK version from [espressif github](https://github.com/espressif/esp-idf) (checkout release/5.0 branch)
66

7-
2. Setup ESP32 build environment [guide](https://docs.espressif.com/projects/esp-idf/en/release-v4.3/esp32/get-started/index.html)
7+
```sh
8+
$ mkdir -p ~/esp
9+
$ cd ~/esp
10+
$ git clone -b release/v5.0 --recursive https://github.com/espressif/esp-idf.git
11+
```
812

9-
## How to build example
13+
2. Setup ESP32 build environment according to [guide](https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/get-started/index.html)
14+
15+
> **_NOTE:_** You can also setup other esp32 series like ESP32-S series, ESP32-C series according to their setup guide.
1016
11-
1. 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))
17+
3. Acquire SmartThings Device SDK workflow reading [Getting Started](../../doc/getting_started.md) Document
1218

13-
2. Build this example and flash image on esp32 board.
19+
## How to build example
20+
21+
1. Build this example and flash image on esp32 board. (Please refer [espressif guide](https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/get-started/linux-macos-setup.html#build-the-project))
1422

1523
```sh
1624
$ cd st-device-sdk-c/example/esp32
1725
$ idf.py build
1826
$ idf.py flash
1927
```
20-
3. Run and monitor esp32
28+
> **_NOTE:_** The examples's default sdkconfig is for esp32 board. To run the example on other esp32 series, change `CONFIG_IDF_TARGET` in sdkconfig with desired target board before build.
29+
>
30+
> For example, to run the example on esp32s3 board, change `CONFIG_IDF_TARGET` in sdkconfig file like below.
31+
>```vim
32+
>... (Skip) ...
33+
>CONFIG_IDF_TARGET="esp32s3"
34+
>... (Skip) ...
35+
>```
36+
>You may need to run fullclean to remove previous target board build configuration before building different target.
37+
>```sh
38+
>$ idf.py fullclean
39+
>```
40+
41+
2. Run and monitor esp32. (Please refer [espressif guide](https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/get-started/linux-macos-setup.html#monitor-the-output))
2142
2243
```sh
2344
$ idf.py monitor
2445
```
2546
26-
Please refer [Getting Started](../../doc/getting_started.md) guide for testing example with ST app.
47+
3. To test your registered devices on DevWS, replace onboarding_config.json and device.json under `main` folder with yours before build. (Refer [Getting Started](../..//doc/getting_started.md#update-device-information))
48+
49+
50+
Please refer [Getting Started](../../doc/getting_started.md#test) guide for testing example with ST app.

example/esp32/custom_partitions.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ nvs, data, nvs, , 0x4000,
44
otadata, data, ota, , 0x2000,
55
phy_init, data, phy, , 0x1000,
66
nvs_key, data, nvs_keys, , 0x1000, encrypted
7-
ota_0, app, ota_0, , 2M,
8-
ota_1, app, ota_1, , 1M,
7+
ota_0, app, ota_0, , 0x150000,
8+
ota_1, app, ota_1, , 0x150000,

example/esp32/main/CMakeLists.txt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,5 @@ idf_component_register(SRCS "main.c"
77
)
88

99
set(stdk_config ${CMAKE_CURRENT_LIST_DIR}/stdkconfig.cmake)
10-
11-
set(STDK_LINK_LIBRARY
12-
__idf_libsodium
13-
__idf_json
14-
)
15-
16-
set(STDK_INCLUDE_PATH
17-
"$ENV{IDF_PATH}/components/freertos/include/freertos"
18-
"$ENV{IDF_PATH}/components/nvs_flash/include"
19-
"$ENV{IDF_PATH}/components/spi_flash/include"
20-
"$ENV{IDF_PATH}/components/bootloader_support/include"
21-
)
22-
2310
add_subdirectory(../../.. iotcore)
2411
target_link_libraries(${COMPONENT_LIB} PUBLIC iotcore)

example/esp32/main/device_control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ int get_button_event(int* button_event_type, int* button_event_count)
4949
vTaskDelay( pdMS_TO_TICKS(BUTTON_DEBOUNCE_TIME_MS) );
5050
gpio_level = gpio_get_level(GPIO_INPUT_BUTTON);
5151
if (button_last_state != gpio_level) {
52-
printf("Button event, val: %d, tick: %u\n", gpio_level, (uint32_t)xTaskGetTickCount());
52+
printf("Button event, val: %ld, tick: %lu\n", gpio_level, (uint32_t)xTaskGetTickCount());
5353
button_last_state = gpio_level;
5454
if (gpio_level == BUTTON_GPIO_PRESSED) {
5555
button_count++;

example/esp32/main/idf_component.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## IDF Component Manager Manifest File
2+
dependencies:
3+
espressif/libsodium: "^1.0.20"
4+
## Required IDF version
5+
idf:
6+
version: ">=4.1.0"
7+
# # Put list of dependencies here
8+
# # For components maintained by Espressif:
9+
# component: "~1.0.0"
10+
# # For 3rd party components:
11+
# username/component: ">=1.0.0,<2.0.0"
12+
# username2/component2:
13+
# version: "~1.0.0"
14+
# # For transient dependencies `public` flag can be set.
15+
# # `public` flag doesn't have an effect dependencies of the `main` component.
16+
# # All dependencies of `main` are public by default.
17+
# public: true

example/esp32/main/iot_uart_cli.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ static void esp_uart_cli_task()
215215
memset(data, 0, UART_BUF_SIZE);
216216

217217
// Read data from the UART
218-
int len = uart_read_bytes(UART_NUM_0, data, UART_BUF_SIZE, 20 / portTICK_RATE_MS);
218+
int len = uart_read_bytes(UART_NUM_0, data, UART_BUF_SIZE, 20 / portTICK_PERIOD_MS);
219219
for (int i = 0; i < len; i++) {
220220
switch(data[i])
221221
{

example/esp32/main/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static void update_switch_attribute(int state)
5959
if (sequence_no < 0)
6060
printf("fail to send switch value\n");
6161
else
62-
printf("Sequence number return : %d\n", sequence_no);
62+
printf("Sequence number return : %ld\n", sequence_no);
6363
}
6464

6565
static void cap_switch_init_cb(IOT_CAP_HANDLE *handle, void *usr_data)

0 commit comments

Comments
 (0)