The SmartThings Device SDK(for short STDK) is the IoT core device library that allow device applications to securely connect to the SmartThings Cloud. To facilitate the development of device application in your original chipset SDK that installed before, we provide this core device library as a separate repository. You may simply link it to develop a device application in your existing development environment.
We also provide the additional Reference repository so that you can refer to how this core device library can be linked in existing original chipset SDKs and device applications can be developed.
- Reference : There are sample device applications under the
apps
directory.
It is distributed in source form and written in C99 for the purpose of portability to most platforms.
This core device library provides the following features :
- Customized MQTT in order to reduce memory consumption and enhance stability
- Easy and efficient APIs
- Connection APIs : You can do onboarding & MQTT connection by just calling only a few these APIs.
- Capability APIs : More than hundred different capabilities can be implemented as only a few APIs.
This core device library includes platform-dependent parts that should be built in a specific toolchain or SDK. That is, if you do NOT use the pre-porting environment, you must first port them to the appropriate environment.
After porting, you can use this library completely under the specific environment. Therefore, it is better to refer to one of the pre-supplied example device applications in the Reference repository. For more information on detailed workflow below, please refer to the Getting Started. Maybe, we think it's more helpful to you
- Setup Environment
- Register a Device
- Develop a Device Application
This core device library has platform-dependent directories. In current SDK version, those that must be ported are present in src/port/bsp
, src/port/net
and src/port/os
. By default, we have already provided several implementations based on some operating systems(e.g. FreeRTOS) and chipsets(e.g. ESPRESSIF, REALTEK). These porting examples in those directories make it easier for you to port to additional chipsets and operating systems. As of now, this release can also be cross-compiled directly through several chipset SDK environments that have already been ported in the Reference repository.
For instructions on how to port this SDK, please see the Porting Guide.
This core device library should be built according to the chipset development environment to be applied. If this environment is not ready yet, you can build it in the POSIX environment based on Ubuntu as shown below.
But, unlike the resource limited MCU devices, you can NOT check the onboarding process in the POSIX environment because it does not support a SoftAP function by default. Therefore, as a starting point of this SDK, we strongly recommend that you build one of the MCU device examples provided in the Reference repository to use all features without limitations.
Basically, you can build this core device library through make
in the Ubuntu.
sudo apt-get install libssl-dev libpthread-stubs0-dev
-
Clone the source code.
-
Download the source code via
git clone
.$ cd ~ $ git clone https://github.com/SmartThingsCommunity/st-device-sdk-c.git $ cd st-device-sdk-c
-
-
Build the core device library.
-
This build process moves the core device library to
~/st-device-sdk-c/output/
location.$ cd ~/st-device-sdk-c/ $ make
-
-
Build a POSIX example application.
-
Go to a example directory and then build.
$ cd ~/st-device-sdk-c/example $ make
-
For more information, please review the following documents:
- SmartThings Direct-connected devices : It covers the overall workflow and detailed steps for connecting devices to the SmartThings Cloud directly.
- Capabilities Reference : This page serves as a reference for the supported capabilities.
- Developer Workspace : It provides functions related to device information registration and device integration in the SmartThings cloud.
- STDK Code Lab : The code lab data of the 2019 Samsung Developer Conference. It includes a demo video and a tutorial.
This library is licensed under the Apache License Ver2.0.