Last Updated on : 2024-06-25 03:37:22download
This topic walks you through the concepts and development process of the TuyaOS Central Control Development Framework.
Concept | Description |
---|---|
Central Control Device Development Kit | Central Control Device Development Kit, built on top of the TuyaOS architecture, is designed to help you quickly develop central control products for different use cases. It consists of the build framework, development environment, demo, library, and header file. For more information, see Central Control Device Development Kit. |
Development mode | TuyaOS Central Control Development Framework supports two development modes:
|
Release notes | The release notes for the type development kits in the Central Control Development Framework. For more information, see Release Notes. |
This section describes how to download the development kit from Tuya Wind IDE.
See Tuya Wind IDE and proceed with the installation.
Log in to Tuya Wind IDE using your account of the Tuya Developer Platform.
Click Resource Center and search for the development kit you need. Select a Development Mode and Type Development Kit to show the supported chip platforms.
In TuyaOS SDK development, if you cannot find the platform you need, contact your account manager and provide the cross compiler toolchain you use.
Select a platform and click Search to show all the available TuyaOS versions. Find the latest version and click Request Permission.
Wait for your request to be processed. After it is approved, you can click Create Framework on the home page to download the development kit.
The directory of software/TuyaOS
:
Name | Description |
---|---|
apps | The example app, that is the product development kit. |
build | The build configuration files (leave it as is). |
build_app.sh | The build script. |
docs | The API documentation produced by Doxygen. |
include | The header files. |
libs | The libraries. |
Makefile | The Makefile. |
output | The build output. The generated program is located in output/<project name>_<version number> . |
scripts | The build framework (leave it as is). |
vendor | The development environment. It is downloaded to the local computer when you execute the build command. |
Designed with a cross-platform approach, TuyaOS abstracts away the differences between hardware and systems by providing the TuyaOS Kernel API (TKL). When you port TuyaOS, you only need to adapt TKL.
TKL API definition: software/TuyaOS/vendor/<development environment>/tuyaos/tuyaos_adapter/include
TKL API examples: software/TuyaOS/vendor/<development environment>/tuyaos/tuyaos_adapter/src
You need to adapt and port TKL when using TuyaOS SDK development, but it is not necessary for TuyaOS OS development.
The standard Linux APIs, such as for the OS, file system, and network, come with examples of TKL implementations.
Most APIs can be used directly, but a few might not be fully compatible with all products, hardware, or chips. In such cases, you need to adapt them accordingly. For more information about porting, see Pair Over Wired Connection.
TuyaOS provides a unified build framework, allowing you to write application code and build projects in Tuya Wind IDE.
How to build a project in Tuya Wind IDE:
Right-click the name of the target project in the apps directory and choose Build Project from the menu.
Enter the version number in the format X.X.X
(where X
is a number) and press Enter.
It is strongly recommended to use Tuya Wind IDE to develop and build a project. However, if you have an existing build framework, you can integrate the development kit into your framework as a component.
This section describes the key steps to integrate the TuyaOS development kit into your existing build framework.
Copy the TuyaOS lib
and include
directories to your build framework, and write a build rule to specify the include
path. Write the link rule to specify the lib
path and link the respective library.
When linking a library, it is recommended to add the option -Wl,--start-group <link library> -Wl,--end-group
. This enables you not to take care of the order of dependency when multiple static libraries are used.
Copy the software/TuyaOS/vendor/<development environment>/tuyaos/tuyaos_adapter
directory to your build framework, and write a build rule to specify the tuyaos_adapter/include
path. Build all the .c
files in the tuyaos_adapter/include
and tuyaos_adapter/src
directories.
Copy the directory of the sample app to your build framework and build all the .c
files in this directory.
This way, the development kit can be integrated into your build framework.
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback