Last Updated on : 2024-11-20 08:51:48download
This topic describes the APIs used to implement Bluetooth services.
OPERATE_RET tuya_bt_svc_init(IN ty_cJSON *cfg);
Functional description
Initializes Tuya-specific Bluetooth services, such as Bluetooth application management.
Parameter description
Parameter name | Description |
---|---|
cfg | JSON configuration |
Description of JSON configuration
{
"enable_hb": 1, // Enable the heartbeat management.
"scan_timeout": 60, // The scanning timeout period, in seconds.
"mode": 5, // The Bluetooth mode, with the data type of bitmap. The types of mode: `BT_WORK_MODE_E`
"sw_ver": "1.0.8" // This field is deprecated.
}
Return value
Return value | Description |
---|---|
OPRT_OK | Success |
Error code | The error code on a failed operation. |
OPERATE_RET tuya_bt_svc_start(IN ty_cJSON *cfg);
Functional description
Starts Tuya-specific Bluetooth services to run the Bluetooth application manager.
Parameter description
Parameter name | Description |
---|---|
cfg | JSON configuration |
Description of JSON configuration
{
"enable_hb": 1, // Enable the heartbeat management.
"scan_timeout": 60, // The scanning timeout period, in seconds.
"mode": 5, // The Bluetooth mode, with the data type of bitmap. The types of mode: `BT_WORK_MODE_E`
"sw_ver": "1.0.8" // This field is deprecated.
}
Return value
Return value | Description |
---|---|
OPRT_OK | Success |
Error code | The error code on a failed operation. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback