forked from Samsung/TizenRT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Add the document 'how to develop things using SmartThings Thing…
…s SDK' It is a document about SmartThings Things SDK. Developers can make their own device using the SDK.
- Loading branch information
1 parent
5c80e5d
commit 004c928
Showing
23 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# How to develop things using SmartThings Things SDK based Tizen RT | ||
|
||
SmartThings Things(ST-Things) SDK is lightweight OCF development framework based Tizen RT. | ||
It provides APIs to develop OCF devices and supports Samsung Connect Services provided by Samsung mobile devices to easily connect Samsung Cloud. | ||
|
||
## Prerequisites | ||
### 1. To use Tizen RT | ||
Please refer to each details. | ||
|
||
- Toolchain installation [[Details]](../README.md#getting-the-toolchain) | ||
- Board specific prerequisites [[Details]](../README.md#supported-board--emulator) | ||
- IoTivity prerequisite installation [[Details]](../external/iotivity/README.md#prerequisites) | ||
- ROMFS prerequisite installation [[Details]](../tools/fs/README_ROMFS.md#pre-condition) | ||
|
||
|
||
### 2. To use Samsung Cloud | ||
A device developed using ST-Things SDK based Tizen RT can connect to Samsung Cloud. | ||
In order to work with the cloud, it is necessary to sign up Samsung Account at [SmartThings Developers](https://smartthings.developer.samsung.com/) site. | ||
Then, follow the steps. | ||
1. Get your MNID - Manufacturer ID - on [My Page](https://smartthings.developer.samsung.com/partner/dashboard) | ||
2. Create a cloud-connected device [[Details]](https://smartthings.developer.samsung.com/develop/workspace/ide/create-a-cloud-connected-device.html) | ||
3. Generate the Certificate Signing Request and issue a new Signing key for the device certificate [[Details]](https://smartthings.developer.samsung.com/develop/workspace/ide/about-common-tools.html) | ||
|
||
To develop App(Samsung Connect) UI and functionality, use the SmartThings SDK. Please refer to [SmartThings SDK](https://smartthings.developer.samsung.com/develop/workspace/sdk/overview.html) site. | ||
|
||
## Getting Started | ||
## 1. with Tizen Studio for RT | ||
The Tizen Studio for RT is an IDE that provides a lightweight RTOS (real-time operating system)-based application development environment that helps you develop, build, flash, and debug applications in Ubuntu. | ||
Select OS as **Ubuntu** and download Tizen Studio for RT IDE at [HERE](https://developer.tizen.org/development/tizen-studio/download). | ||
Tizen Studio supports ST-Things SDK since v2.0. | ||
Please refer to [README](HowToDevelopThingsWithTizenStudioForRT.md). | ||
|
||
## 2. without the IDE | ||
Please find it at [README](../apps/examples/st_things/README.md) to build st_things sample app. | ||
|
||
## API Reference | ||
Please find ST-Things APIs at [README](API_Reference/README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
# How to develop things with Tizen Studio for RT | ||
|
||
## Prerequisites | ||
- Java Development Kit (JDK) | ||
To install the appropriate JDK version for your Ubuntu system, go to the Ubuntu Web site and follow the detailed instructions for installing the Oracle® JDK version 8. | ||
- Package requirements for developing applications in Ubuntu | ||
You must install the webkitgtk package. At the terminal prompt, enter the following command: | ||
>$ sudo apt-get install libwebkitgtk-1.0-0 | ||
|
||
### 1. Install the Tizen Studio for RT | ||
To install the Tizen Studio for RT: | ||
1. Accept the software license. | ||
2. Configure the installation directory. | ||
3. Install the Tizen Studio for RT. | ||
4. Install additional tools. | ||
5. Run the Tizen Studio for RT. | ||
|
||
More details can find at [Guide page](https://developer.tizen.org/development/tizen-studio/rt-ide/installing-tizen-studio-rt). | ||
|
||
### 2. Create a Project | ||
You can create a new SmartThings project from remote Git repositories as well as local templates. To create a new project: | ||
- When creating a project from a template, click the **Check if you want Smart Things functionality** check box when selecting a template: | ||
 | ||
- When importing a project from a Git repository, click the **Check if you want Smart Things functionality** check box: | ||
 | ||
|
||
### 3. Manage Device/ Resource Model | ||
You can use the Device/Resource Model Manager to select a device model for interworking with the SmartThings service. | ||
With the Model Manager, you can: | ||
- [Check device, resource, and property information](#checking-device-resource-and-property-information) | ||
- [Select, add, and restore resources](#managing-resources) | ||
- [Import and export device models](#importing-and-exporting-device-models) | ||
- [Generate stub code](#generating-stub-code) | ||
|
||
The Model Manager is displayed while creating a new project with SmartThings functionality. If you want to access the Model Manager later again, in the **Project Explorer** view, right-click the project and select **Manage ST-Things Resource**. | ||
|
||
#### **Checking Device, Resource, and Property Information** | ||
To access information: | ||
- Select a device model in the **Device Name** list of the **Device/Platform** section to see device, platform, and resource information. | ||
- Select a resource in the left panel of the **Resource/Property** section to see the its description and property information. | ||
- Select a property in the right panel of the **Resource/Property** section to see its description. | ||
 | ||
- Input your MNID assigned by SmartThings website. Refer to [here](HowToDevelopThingsUsingSmartThingsThingsSDK.md#2-to-use-samsung-cloud). | ||
 | ||
|
||
#### **Managing Resources** | ||
You can select, add, and restore resources: | ||
- To select all resources, click the checkbox on the **Resource/Property** toolbar. | ||
 | ||
- To add a new resource: | ||
1. Click **Add Resource**. | ||
 | ||
2. In the Add Resource window, select the type of resource to be added, edit its information, and click **OK**. | ||
 | ||
The new resource appears in the list in the **Resource/Property** section of the Model Manager main view. | ||
- To restore the resources, click **Restore default**. This restores the initial resource state of the device, deleting all changes that have been made. | ||
|
||
#### **Importing and Exporting Device Models** | ||
To import a device model: | ||
1. Click **Import** on the **Device/Platform** toolbar. | ||
 | ||
2. Select the JSON file containing the device model to be imported and click **OK**. | ||
 | ||
3. The imported device shows up in the device list with the **Custom** type. | ||
 | ||
|
||
To export a device model: | ||
1. Select the model to be exported and click **Export** on the **Device/Platform** toolbar. | ||
 | ||
2. The device model is exported ad a JSON file. Enter a file name for the exported model and click **OK**. | ||
 | ||
|
||
#### **Generating Stub Code** | ||
When you click **Finish** in the Model Manager, the code for processing the resource is automatically created for the selected device. | ||
 | ||
 | ||
When the project is created, template code for the selected device and resources is automatically generated and opened for editing: | ||
``` | ||
<common_handlers.c> | ||
- Reset, ownership transfer, and status change handlers | ||
- You need to write additional code for the functionality you want. | ||
<resource_<uri>.c> | ||
- Get and set handlers for a resource | ||
- You need to write additional code for the functionality you want. | ||
- Refet to annotation or TODO in the resource file. | ||
<Makefile> and <Make.defs> | ||
- Makefile for building the project | ||
<st_things_main.c>, <things.c>, <things.h> | ||
- Project initialization, handler registration, and main loop | ||
``` | ||
If you edit the SmartThings resources in your project later on, the Model Manager automatically backs the existing source files with a **.bak** extension. | ||
 | ||
|
||
### 4. Build and Flash the Project | ||
You must build your project before flashing or debugging it. | ||
You can build a Tizen RT project in 2 ways: [using a batch build](#Using-Batch-Build) or [build project command](#Using-Build-Project). | ||
|
||
#### Using Batch Build | ||
To build your project using the batch build command: | ||
1. Select the project in the **Project Explorer** view. | ||
2. To build the selected project, use 1 of the following: | ||
In the Tizen Studio for RT menu, select **Project > Batch Build Project**. | ||
In the Tizen Studio for RT toolbar, click the **Build TizenRT Project** icon. | ||
 | ||
 | ||
3. In the Build TizenRT Project Wizard, select the board - **artik053** - and build option - **st_things** - for building your project, and click **OK**. | ||
 | ||
You can check the build logs in the **Console** view. | ||
 | ||
|
||
#### Using Build Project | ||
To build your project using the build project command: | ||
1. In the **Project Explorer** view, select the project. | ||
2. In the Tizen Studio for RT toolbar, click the arrow next to the **Build TizenRT Project icon** and **select Select Board**. | ||
 | ||
3. In the Select Board and PreDefine Option window, select the board - **artik053** - and build option - **st_things** - for building your project, and click **OK**. | ||
 | ||
4. In the Tizen Studio for RT toolbar, build the project by selecting **Project > Build Project**. | ||
 | ||
You can check the build logs in the **Console** view. | ||
 | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.