Skip to content

Commit 679a1bf

Browse files
authored
Merge pull request #72 from SmartThingsCommunity/master_rel_1_5_3
Master rel 1 5 3
2 parents ca43c5e + 233bb57 commit 679a1bf

Some content is hidden

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

47 files changed

+478
-165
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# SmartThings SDK for Direct Connected Devices for C
1+
# SmartThings SDK Reference for Direct Connected Devices for C
22

33
[![License](https://img.shields.io/badge/licence-Apache%202.0-brightgreen.svg?style=flat)](LICENSE)
44

55
Direct-connected devices connect directly to the SmartThings cloud. The SDK for Direct Connected Devices is equipped to manage all MQTT topics and onboarding requirements, freeing you to focus on the actions and attributes of your device. To facilitate the development of device application in an original chipset SDK, the core device library and the examples were separated into two git repositories. That is, if you want to use the core device library in your original chipset SDK that installed before, you may simply link it to develop a device application in your existing development environment.
66

7-
It is distributed in source form and written in C99 for the purpose of portability to most platforms. If you want to know the overall workflow of using this SDK, please refer to the [Getting Started](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/blob/master/doc/getting_started.md).
7+
It is distributed in source form and written in C99 for the purpose of portability to most platforms. If you want to know the overall workflow of using this SDK, please refer to the [Getting Started](./doc/getting_started.md).
88

99
## Directory layout
1010

apps/emw3080/light_example/sdkconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
#define CONFIG_MBEDTLS_TLS_CLIENT_ONLY 1
3030
#define CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN 6144
3131
#define CONFIG_STDK_MQTT_USE_SSL
32+
#define CONFIG_STDK_IOT_CORE_EASYSETUP_HTTP_USE_SOCKET_API
3233

3334
#endif

apps/emw3080/switch_example/sdkconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
#define CONFIG_MBEDTLS_TLS_CLIENT_ONLY 1
3030
#define CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN 6144
3131
#define CONFIG_STDK_MQTT_USE_SSL
32+
#define CONFIG_STDK_IOT_CORE_EASYSETUP_HTTP_USE_SOCKET_API
3233

3334
#endif
Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,53 @@
1-
# SmartThings Device SDK Switch Example
1+
# SmartThings SDK for Direct Connected Devices for C - Light Example
22

33
## Introduction
44

55
SmartThings direct-connected device is Wi-Fi enabled device that uses the SmartThings cloud as its primary cloud infrastructure. And this device will use the MQTT protocol for communication.
66

77
## Getting started
88

9-
For information on detailed workflow, please refer to the [Getting Started](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/blob/master/doc/getting_started.md)
9+
For information on detailed workflow, please refer to the [Getting Started](../../../doc/getting_started.md)
1010

1111
## Components and Capabilities
1212

1313
SmartThings Device is defined using components and capabilities. Capabilities define the features of the device, and capabilities are grouped into components.
1414
Components and Capabilities are contained in device profile. You can create a device profile in Developer Workspace and associate it with an integration.
1515

16-
This example assumes the following components and capabilities are used. :
16+
This example assumes the following components and capabilities are used:
1717

18-
'main' component
19-
- 'healthCheck' capability
20-
- 'switch' capability
21-
- 'switchLevel' capability
22-
- 'colorTemperature' capability
23-
- 'activityLightingMode' capability
18+
'main' component
19+
- 'healthCheck' capability
20+
- 'switch' capability
21+
- 'switchLevel' capability
22+
- 'colorTemperature' capability
23+
- 'activityLightingMode' capability
2424

25-
'monitor' component
26-
- 'dustSensor' capability
25+
'monitor' component
26+
- 'dustSensor' capability
2727

2828
('healthCheck' capability is automatically added by Developer Workspace. It doesn't need handler at device side)
2929

30-
## SmartThings Device SDK config
31-
If you want to use specific SmartThings Device SDK build options, you can directly modify the build configuration file. For this example, SmartThings Device SDK config is saved in 'sdkconfig.h' file.
32-
30+
## SmartThings SDK for Direct Connected Devices - Config
31+
If you want to use specific SmartThings Device SDK build options, you can directly modify the build configuration file. For this example, SmartThings Device SDK config is saved in 'sdkconfig.h' file. If you want to change this, please execute the following :
32+
```sh
33+
$ cd ~/st-device-sdk-c-ref
34+
$ vim apps/emw3166/light_example/sdkconfig.h
35+
```
36+
37+
## Test device schematics
38+
This example uses EMW3166 GPIO like below.
39+
Please refer below picture for __MXChip EMW3166__.
40+
> Note: If your device's schematics doesn't match with belows.
41+
> Please modify GPIO defines for your device at [device_control.h](main/device_control.h)
42+
> ```c
43+
> #define GPIO_INPUT_BUTTON MICO_GPIO_38 //PA4
44+
> #define GPIO_OUTPUT_COLORLED_R MICO_GPIO_5 //PB12
45+
> #define GPIO_OUTPUT_COLORLED_G MICO_GPIO_4 //PB15
46+
> #define GPIO_OUTPUT_COLORLED_B MICO_GPIO_7 //PB14
47+
> #define GPIO_OUTPUT_COLORLED_0 MICO_GPIO_6 //PB13
48+
> ```
49+
50+
### MXChip EMW3166
51+
| MXChip EMW3166 |
52+
|-----------------------------------------------------------------------|
53+
|![MXChip EMW3166](../../../doc/res/Light_Example_MXChip_EMW3166.png) |

apps/emw3166/light_example/sdkconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
#define CONFIG_MBEDTLS_TLS_CLIENT_ONLY 1
3030
#define CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN 6144
3131
#define CONFIG_STDK_MQTT_USE_SSL
32+
#define CONFIG_STDK_IOT_CORE_EASYSETUP_HTTP_USE_SOCKET_API
3233

3334
#endif
Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,45 @@
1-
# SmartThings Device SDK Switch Example
1+
# SmartThings SDK for Direct Connected Devices for C - Switch Example
22

33
## Introduction
44

55
SmartThings direct-connected device is Wi-Fi enabled device that uses the SmartThings cloud as its primary cloud infrastructure. And this device will use the MQTT protocol for communication.
66

77
## Getting started
88

9-
For information on detailed workflow, please refer to the [Getting Started](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/blob/master/doc/getting_started.md)
9+
For information on detailed workflow, please refer to the [Getting Started](../../../doc/getting_started.md)
1010

1111
## Components and Capabilities
1212

1313
SmartThings Device is defined using components and capabilities. Capabilities define the features of the device, and capabilities are grouped into components.
1414
Components and Capabilities are contained in device profile. You can create a device profile in Developer Workspace and associate it with an integration.
1515

16-
This example assumes the following component and capabilities are used. :
16+
This example assumes the following components and capabilities are used:
1717

18-
'main' component
19-
- 'healthCheck' capability
20-
- 'switch' capability
18+
'main' component
19+
- 'healthCheck' capability
20+
- 'switch' capability
2121

2222
('healthCheck' capability is automatically added by Developer Workspace. It doesn't need handler at device side)
2323

24-
## SmartThings Device SDK config
25-
If you want to use specific SmartThings Device SDK build options, you can directly modify the build configuration file. For this example, SmartThings Device SDK config is saved in 'sdkconfig.h' file.
26-
24+
## SmartThings SDK for Direct Connected Devices - Config
25+
If you want to use specific SmartThings Device SDK build options, you can directly modify the build configuration file. For this example, SmartThings Device SDK config is saved in 'sdkconfig.h' file. If you want to change this, please execute the following :
26+
```sh
27+
$ cd ~/st-device-sdk-c-ref
28+
$ vim apps/emw3166/switch_example/sdkconfig.h
29+
```
30+
31+
## Test device schematics
32+
This example uses EMW3166 GPIO like below.
33+
Please refer below picture for __MXChip EMW3166__.
34+
> Note: If your device's schematics doesn't match with belows.
35+
> Please modify GPIO defines for your device at [device_control.h](main/device_control.h)
36+
> ```c
37+
> #define GPIO_OUTPUT_NOTIFICATION_LED MICO_GPIO_6 //PB13
38+
> #define GPIO_INPUT_BUTTON MICO_GPIO_5 //PB12
39+
> #define GPIO_OUTPUT_MAINLED MICO_GPIO_7 //PB14
40+
> ```
41+
42+
### MXChip EMW3166
43+
| MXChip EMW3166 |
44+
|-----------------------------------------------------------------------|
45+
|![MXChip EMW3166](../../../doc/res/Switch_Example_MXChip_EMW3166.png) |

apps/emw3166/switch_example/sdkconfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@
2929
#define CONFIG_MBEDTLS_TLS_CLIENT_ONLY 1
3030
#define CONFIG_MBEDTLS_SSL_IN_CONTENT_LEN 6144
3131
#define CONFIG_STDK_MQTT_USE_SSL
32+
#define CONFIG_STDK_IOT_CORE_EASYSETUP_HTTP_USE_SOCKET_API
3233

3334
#endif

apps/esp32/light_example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SmartThings direct-connected device is Wi-Fi enabled device that uses the SmartT
66

77
## Getting started
88

9-
For information on detailed workflow, please refer to the [Getting Started](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/blob/master/doc/getting_started.md)
9+
For information on detailed workflow, please refer to the [Getting Started](../../../doc/getting_started.md)
1010

1111
## Components and Capabilities
1212

apps/esp32/switch_example/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ SmartThings direct-connected device is Wi-Fi enabled device that uses the SmartT
66

77
## Getting started
88

9-
For information on detailed workflow, please refer to the [Getting Started](https://github.com/SmartThingsCommunity/st-device-sdk-c-ref/blob/master/doc/getting_started.md)
9+
For information on detailed workflow, please refer to the [Getting Started](../../../doc/getting_started.md)
1010

1111
## Components and Capabilities
1212

apps/esp32s2/light_example/sdkconfig

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ CONFIG_ESPTOOLPY_FLASHFREQ_80M=y
8686
# CONFIG_ESPTOOLPY_FLASHFREQ_20M is not set
8787
CONFIG_ESPTOOLPY_FLASHFREQ="80m"
8888
# CONFIG_ESPTOOLPY_FLASHSIZE_1MB is not set
89-
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=y
90-
# CONFIG_ESPTOOLPY_FLASHSIZE_4MB is not set
89+
# CONFIG_ESPTOOLPY_FLASHSIZE_2MB is not set
90+
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
9191
# CONFIG_ESPTOOLPY_FLASHSIZE_8MB is not set
9292
# CONFIG_ESPTOOLPY_FLASHSIZE_16MB is not set
93-
CONFIG_ESPTOOLPY_FLASHSIZE="2MB"
93+
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
9494
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
9595
CONFIG_ESPTOOLPY_BEFORE_RESET=y
9696
# CONFIG_ESPTOOLPY_BEFORE_NORESET is not set
@@ -112,11 +112,11 @@ CONFIG_ESPTOOLPY_MONITOR_BAUD=115200
112112
#
113113
# Partition Table
114114
#
115-
CONFIG_PARTITION_TABLE_SINGLE_APP=y
115+
# CONFIG_PARTITION_TABLE_SINGLE_APP is not set
116116
# CONFIG_PARTITION_TABLE_TWO_OTA is not set
117-
# CONFIG_PARTITION_TABLE_CUSTOM is not set
118-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
119-
CONFIG_PARTITION_TABLE_FILENAME="partitions_singleapp.csv"
117+
CONFIG_PARTITION_TABLE_CUSTOM=y
118+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.2MB.csv"
119+
CONFIG_PARTITION_TABLE_FILENAME="partitions.2MB.csv"
120120
CONFIG_PARTITION_TABLE_OFFSET=0x8000
121121
CONFIG_PARTITION_TABLE_MD5=y
122122
# end of Partition Table

0 commit comments

Comments
 (0)