Device Initialization

Last Updated on : 2024-06-25 04:06:13Copy for LLMView as MarkdownDownload PDF

This topic describes the initialization process of the TuyaOS Integrated SDK in terms of initialization phases, use cases, and related APIs.

Background

Initialization is made up of a set of interfaces needed to build a minimal software model for an NB-IoT device. The interfaces initialize the hardware, TuyaOS software, and applications.

How to

The product ID (PID) is required to bind a device with the Tuya Developer Platform. Call the following interfaces in sequence to set the PID during initialization.

  1. Set the PID: tuya_user_api_set_product_key
  2. Set the event capture callback: tuya_user_api_event_loop_set_cb
  3. Start event capture: tuya_user_api_event_loop_start
  4. Set the downlink data point (DP) messaging callback: tuya_user_api_dp_write_default_cb
  5. Set the record-type data callback: tuya_user_api_dp_report_record_ack_register_cb
Device Initialization

API description

For more information, see OpenCPU SDK.