|
1 | | -# SmartThings Device SDK Switch Example |
| 1 | +# SmartThings SDK for Direct Connected Devices for C - Light Example |
2 | 2 |
|
3 | 3 | ## Introduction |
4 | 4 |
|
5 | 5 | 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. |
6 | 6 |
|
7 | 7 | ## Getting started |
8 | 8 |
|
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) |
10 | 10 |
|
11 | 11 | ## Components and Capabilities |
12 | 12 |
|
13 | 13 | SmartThings Device is defined using components and capabilities. Capabilities define the features of the device, and capabilities are grouped into components. |
14 | 14 | Components and Capabilities are contained in device profile. You can create a device profile in Developer Workspace and associate it with an integration. |
15 | 15 |
|
16 | | -This example assumes the following components and capabilities are used. : |
| 16 | +This example assumes the following components and capabilities are used: |
17 | 17 |
|
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 |
24 | 24 |
|
25 | | -'monitor' component |
26 | | -- 'dustSensor' capability |
| 25 | +'monitor' component |
| 26 | +- 'dustSensor' capability |
27 | 27 |
|
28 | 28 | ('healthCheck' capability is automatically added by Developer Workspace. It doesn't need handler at device side) |
29 | 29 |
|
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 | +| | |
0 commit comments