SS

smartthingscommunity/st-device-sdk-c

Developer tools
138 stars Quality 34 Trend 44

SmartThings SDK for Direct Connected Devices for C

Overview

The SmartThings SDK for Direct Connected Devices for C 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 examples so that 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. It is distributed in source form and written in C99 for the purpose of portability to most platforms. With the release of SmartThings SDK version 2.0, we decided to no longer support softAP-based ST app connections. If you want to use softAP-based SmartThings SDK, you should use SmartThings SDK version 1.X.

README

SmartThings SDK for Direct Connected Devices for C

The SmartThings SDK for Direct Connected Devices for C 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 examples so that 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.

It is distributed in source form and written in C99 for the purpose of portability to most platforms.

SmartThings SDK version 2.0 Release

With the release of SmartThings SDK version 2.0, we decided to no longer support softAP-based ST app connections. If you want to use softAP-based SmartThings SDK, you should use SmartThings SDK version 1.X. The currently provided softAP-based SmartThings SDK can be used, but new feature upgrades are no longer planned to be supported for softAP-base SmartThings SDK.

Because softAP-based devices have technical limitations in supporting the functions planned by SmartThings, we have released SmartThings SDK version 2.0, which provides BLE-based connection with SmartThings APP. If the chipset to be used in the product supports BLE, it is recommended to use a BLE-based SmartThings SDK.

Using BLE is expected to not only support new SmartThings features, but also improve device search and connection stability with the SmartThings APP.

Main features

This core device library provides the following features :

  • SmartThings Onboarding : Enables seamless device registration within SmartThings
  • 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.
  • Offline diagnostics : A feature designed to assist users in self-diagnosing issues when an IoT device is detected as offline, providing root cause analysis along with actionable recovery recommendations

These features are not required, but are supported by most Samsung products connected to SmartThings. In line with SmartThings’ policy of extending these features to partner products, They are provides in the STDK. If you’re considering a commercial product, SmartThings recommends these features as essential.

AI Agent Skills

If you use an AI coding agent such as Claude Code, OpenAI Codex, or Gemini CLI, the skills directory gives it STDK-specific knowledge. Each skill is a SKILL.md file in the open Agent Skills format, so the same files work across agents.

  • stdk-docs-reference : Answers SDK questions (APIs, onboarding flow, device states, porting, key/QR generation) from the live documentation in this repository, with code examples and source links.
  • stdk-error-lookup : Explains mobile app error codes (81-001, 04-100, …) and SDK internal codes (NE01, CE01, …) with causes and a fix checklist.
  • stdk-log-analysis : Reads an STDK device log, rebuilds the onboarding and connection timeline, and reports root causes and fixes by severity.
  • stdk-github-search : Finds the right document, source file, or GitHub issue in the STDK repositories for a given question.

To install, copy the skill folders into your agent’s skills directory (for example ~/.claude/skills/, ~/.codex/skills/, or ~/.gemini/skills/). See skills/README.md for per-agent instructions and a fallback for agents without native skill support.

How to get started?

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. For more information on detailed workflow below, please refer to the Getting Started. Maybe, we think it’s more helpful to you

  • Register a Device on Developer Workspace
  • Develop a Device Application

Porting SmartThings SDK for Direct Connected Devices for C

This core device library has platform-dependent directories. In current SDK version, those that must be ported are present in src/port. By default, we have already provided several implementations based on some operating systems(e.g. FreeRTOS) and chipsets(e.g. ESPRESSIF). These porting examples in those directories make it easier for you to port to additional chipsets and operating systems.

For instructions on how to port this SDK, please see the Porting Guide.

Git Branch Guide

We are managing two git branch categories. One is develop branch. The other is release/v{version} branchs. In devleop branch, we are merging latest developing features actively. In release/v{version} branchs, we branch out from devleop branch and keep them stable updating bugfix and small amendment. If you want to use latest SDK features for test or POC, we recommand devleop branch as base. Or if you want to apply the SDK in real product and consider commercializing, we recommand release/v{version} branchs as base.

  • develop branch : Latest devleoping features. Recommand for new feature test or POC.
  • release/v{version} branchs : Tested and stable branchs. Recommand for Commercial product.

Developer Support Tools

You can get the useful tools in this link. It will help you to make sure for SmartThings Device SDK.

  • Key Generation : It will generate a key pair to be used for device authentication.
  • QR Generation : It will help you create QR codes to attach to SmartThings-compliant devices.
  • STDK Dev Support : It is designed to perform the onboarding process identically to the standard app and provide various information to the app side, so it is expected to be of great help in analyzing issues during porting.
  • STDK Emulator : You can obtain a reference device simply by installing the app. This is expected to help in the comparative analysis of issues that arise during porting.
  • Manual Onboarding : You can build and test the SDK on your Linux distribution environment without real target board. In this way, you can easily make PoC demo for your product and check your IoT device feasibility on SmartThings platform. Also in real product developing, building and testing on Linux environment can accelerate product development speed.

Learn more

For more information, please review the following documents:

  • Getting Started : It covers the overall workflow and detailed steps for starters to work with SDK.
  • API References : It provide all API reference that SDK offers.
  • Developer Workspace : It provides functions related to device information registration and device integration in the SmartThings cloud.
  • Device Registration : This page is a guide explaining the device registration process.
  • Capabilities Reference : This page serves as a reference for the supported capabilities.
  • Capability Attribute Update : This development page guides how to use Capability Attribute update APIs.
  • Cloud Interaction : This page is an explanatory guide to cloud connection and the event transmission.
  • Commercialization Guide : It provides guide for ones who consider commercializing their IoT products with SDK.

Commercialization

For commercialization, refer to the following link.

If you have any issue, or want to commercialize your IoT devices using this SDK, please use the following contact point.

License

This library is licensed under the Apache License Ver2.0.

View the full README on GitHub

Recommended Tools

Try a different keyword or remove a filter.

Install

npx skillfish add smartthingscommunity/st-device-sdk-c