|
| 1 | +# SmartThings SDK for Direct Connected Devices for C - Light Example |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 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 | + |
| 7 | +## Getting started |
| 8 | + |
| 9 | +For information on detailed workflow, please refer to the [Getting Started](../../../doc/getting_started.md) |
| 10 | + |
| 11 | +## Components and Capabilities |
| 12 | + |
| 13 | +SmartThings Device is defined using components and capabilities. Capabilities define the features of the device, and capabilities are grouped into components. |
| 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 | + |
| 16 | +This example assumes the following components and capabilities are used: |
| 17 | + |
| 18 | +'main' component |
| 19 | +- 'healthCheck' capability |
| 20 | +- 'switch' capability |
| 21 | +- 'switchLevel' capability |
| 22 | +- 'colorTemperature' capability |
| 23 | +- 'activityLightingMode' capability |
| 24 | + |
| 25 | +'monitor' component |
| 26 | +- 'dustSensor' capability |
| 27 | + |
| 28 | +('healthCheck' capability is automatically added by Developer Workspace. It doesn't need handler at device side) |
| 29 | + |
| 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/emw3080/light_example/sdkconfig.h |
| 35 | +``` |
| 36 | + |
| 37 | +## Test device schematics |
| 38 | +This example uses EMW3080 GPIO like below. |
| 39 | +Please refer below picture for __MXChip EMW3080__. |
| 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_1 //SWD CLK |
| 44 | +> #define GPIO_OUTPUT_COLORLED_R MICO_GPIO_2 //SWD IO |
| 45 | +> #define GPIO_OUTPUT_COLORLED_G MICO_GPIO_7 //RTS |
| 46 | +> #define GPIO_OUTPUT_COLORLED_B MICO_GPIO_8 //CTS |
| 47 | +> ``` |
| 48 | +
|
| 49 | +### MXChip EMW3080 |
| 50 | +| MXChip EMW3080 | |
| 51 | +|-----------------------------------------------------------------------| |
| 52 | +| | |
0 commit comments