14#include "tuya_cloud_types.h"
15#include "tuya_cloud_com_defs.h"
17#include "tal_bluetooth_def.h"
23typedef BYTE_T TUYA_BLE_ABILITY_T;
24#define TUYA_BLE_ABILITY_NONE 0x0
25#define TUYA_BLE_ABILITY_NETCFG 0x1
26#define TUYA_BLE_ABILITY_DP_CTRL 0x2
27#define TUYA_BLE_ABILITY_ALL 0xFF
33 TUYA_BT_UNBONDING_UNCONN = 0,
34 TUYA_BT_UNBONDING_CONN,
35 TUYA_BT_BONDING_UNCONN,
44 TUYA_BT_SERV_OPENED = 0,
54 TUYA_BLE_OP_UNBIND = 0,
68typedef VOID_T(*BT_DP_QUERY_CB)(VOID_T);
69typedef UINT_T(*BT_DP_GET_TM_CB)(CHAR_T* time_str);
72 UINT8_T priority_flag;
74 UINT8_T dp_rept_with_time;
76 BT_DP_QUERY_CB query_dp_cb;
77 BT_DP_GET_TM_CB get_timestamp_cb;
80#if defined(ENABLE_BT_MF) && (ENABLE_BT_MF == 1)
81OPERATE_RET ty_ble_init_for_mftest(VOID_T);
82OPERATE_RET ty_ble_deinit_for_mftest(VOID_T);
130OPERATE_RET
ty_bt_dp_report(IN CONST DP_REPT_TYPE_E dp_rept_type, IN CONST VOID_T* data, IN BOOL_T sync);
202#if defined(ENABLE_BT_REMOTE_CTRL) && (ENABLE_BT_REMOTE_CTRL==1)
214VOID_T tuya_ble_init_beacon_key(VOID_T);
226OPERATE_RET tuya_ble_save_beacon_key(BOOL_T force);
238VOID_T tuya_ble_clear_beacon_key(VOID_T);
250VOID_T tuya_ble_clear_rmt_ctrl_info(UINT8_T stat);
254typedef VOID (*TUYA_BLE_APP_SCAN_HANDLE)(UCHAR_T *data, UCHAR_T len, UCHAR_T type, UCHAR_T* mac);
265OPERATE_RET tuya_ble_reg_app_scan_adv_cb(TUYA_BLE_APP_SCAN_HANDLE cb);
276BOOL_T tuya_ble_is_user_registed(VOID_T);
290OPERATE_RET tuya_ble_reg_raw_scan_adv_cb(TUYA_BLE_RAW_SCAN_HANDLE cb);
294typedef OPERATE_RET(*BLE_SCAN_ADV_BIND_CHECK_CB)(
TUYA_BLE_BIND_TYPE type, UCHAR_T *data, UCHAR_T len);
299 BLE_SCAN_ADV_BIND_CHECK_CB bind_check;
300 BLE_SCAN_ADV_BIND_RSLT_NOTIFY_CB bind_notify;
301} TUYA_BLE_SCAN_ADV_HANDLE_CBS;
312OPERATE_RET tuya_ble_reg_app_scan_adv_handle_cbs(TUYA_BLE_SCAN_ADV_HANDLE_CBS* cbs);
323VOID_T tuya_ble_set_bind_window(UINT_T time_out);
334VOID_T tuya_ble_open_bind_window(VOID_T);
345VOID_T tuya_ble_disable_clr_bind_info(VOID_T);
461VOID_T tuya_enable_ble_dp_ctrl(BOOL_T swith);
462VOID_T tuya_enable_ble_timer(BOOL_T swith);
463VOID_T tuya_enable_ble_netcfg(BOOL_T swith);
464VOID_T tuya_enable_ble_active(BOOL_T swith);
465VOID_T tuya_enable_ble_mftst(BOOL_T swith);
466BOOL_T tuya_ble_is_mftst_enable(VOID_T);
Definition: tal_bluetooth_def.h:104
parameters for bluetooth
Definition: tuya_bt.h:62
BOOL_T is_bt_connected(VOID_T)
Check bluetooth is connected.
TUYA_BT_CONN_STAT
connection status for bluetooth
Definition: tuya_bt.h:32
VOID_T tuya_ble_restart_adv(VOID_T)
Resend the ble adv data to hal and start ble adv
OPERATE_RET tuya_ble_reg_get_bt_stat_cb(IN CONST GET_BT_CONN_STAT_CB bt_conn_stat_cb)
Register callback function for getting the connection status of bluetooth
VOID_T tuya_ble_lowpower_handle(VOID_T)
stop ble netcfg and plug_play when dev under lowpower status
TUYA_BT_SERV_STAT
status for bluetooth service
Definition: tuya_bt.h:43
VOID_T tuya_ble_rept_netcfg_stat(IN UINT_T type)
Report netcfg status
VOID_T tuya_ble_dp_response_query(IN CONST BYTE_T *dpid, IN CONST BYTE_T num)
Response dp query with report flag
VOID_T tuya_ble_disable_expt_unbind(VOID_T)
Disable function for execept unbinding
VOID_T tuya_ble_set_startup_attr(TUYA_BLE_ABILITY_T attr)
Set abilitiy attribute of bluetooth
TUYA_BT_CONN_STAT tuya_bt_get_connect_status(VOID)
Get connection status of bluetooth
OPERATE_RET tuya_ble_start_user_beacon_adv(UCHAR_T *data, UCHAR_T len, UINT_T sec_time)
Start user defined advertising of bluetooth with time limited
OPERATE_RET tuya_set_bt_device_name(CHAR_T *dev_name)
Set name for bluetooth device.
VOID_T tuya_ble_set_serv_switch(BOOL_T swith)
Set enable switch for bluetooth service
OPERATE_RET ty_bt_dp_report(IN CONST DP_REPT_TYPE_E dp_rept_type, IN CONST VOID_T *data, IN BOOL_T sync)
Report dp by bluetooth
OPERATE_RET tuya_svc_bt_init(VOID_T)
Init tuya bluetooth service
VOID_T tuya_ble_set_bt_para(TUYA_BLE_BT_PARA *para)
Set parameters for bluetooth.
OPERATE_RET tuya_ble_monitor_init(VOID_T)
Monitor for bluetooth
OPERATE_RET ty_bt_update_local_key(UINT8_T *p_buf, UINT8_T len)
Update local key
TUYA_BLE_BIND_TYPE
bind type for bluetooth remote controller
Definition: tuya_bt.h:53
VOID_T ty_bt_support_dp_sync_report(BOOL_T flag)
Support dp sync report by bluetooth
TUYA_BT_SERV_STAT tuya_ble_get_serv_stat(VOID_T)
Get status of bluetooth service