TuyaOS
|
Common process - Initialization 更多...
#include "tuya_cloud_types.h"
#include "tuya_cloud_com_defs.h"
#include "base_event_info.h"
#include "tal_bluetooth_def.h"
结构体 | |
struct | TUYA_BLE_BT_PARA |
宏定义 | |
#define | TUYA_BLE_ABILITY_ALL 0xFF |
#define | TUYA_BLE_ABILITY_DP_CTRL 0x2 |
#define | TUYA_BLE_ABILITY_NETCFG 0x1 |
#define | TUYA_BLE_ABILITY_NONE 0x0 |
类型定义 | |
typedef UINT_T(* | BT_DP_GET_TM_CB) (CHAR_T *time_str) |
typedef VOID_T(* | BT_DP_QUERY_CB) (VOID_T) |
typedef VOID(* | GET_BT_CONN_STAT_CB) (IN CONST TUYA_BT_CONN_STAT stat) |
typedef BYTE_T | TUYA_BLE_ABILITY_T |
枚举 | |
enum | TUYA_BLE_BIND_TYPE { TUYA_BLE_OP_UNBIND = 0 , TUYA_BLE_OP_BIND } |
bind type for bluetooth remote controller | |
enum | TUYA_BT_CONN_STAT { TUYA_BT_UNBONDING_UNCONN = 0 , TUYA_BT_UNBONDING_CONN , TUYA_BT_BONDING_UNCONN , TUYA_BT_BONDING_CONN , TUYA_BT_UNKNOW_STATUS } |
connection status for bluetooth | |
enum | TUYA_BT_SERV_STAT { TUYA_BT_SERV_OPENED = 0 , TUYA_BT_SERV_OPENING , TUYA_BT_SERV_CLOSED , TUYA_BT_SERV_CLOSING } |
status for bluetooth service | |
函数 | |
BOOL_T | is_bt_connected (VOID_T) |
Check bluetooth is connected. 更多... | |
VOID_T | tuya_ble_disable_expt_unbind (VOID_T) |
Disable function for execept unbinding 更多... | |
VOID_T | tuya_ble_dp_response_query (IN CONST BYTE_T *dpid, IN CONST BYTE_T num) |
Response dp query with report flag 更多... | |
TUYA_BT_SERV_STAT | tuya_ble_get_serv_stat (VOID_T) |
Get status of bluetooth service 更多... | |
BOOL_T | tuya_ble_is_mftst_enable (VOID_T) |
VOID_T | tuya_ble_lowpower_handle (VOID_T) |
stop ble netcfg and plug_play when dev under lowpower status 更多... | |
OPERATE_RET | tuya_ble_monitor_init (VOID_T) |
Monitor for bluetooth 更多... | |
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_rept_netcfg_stat (IN UINT_T type) |
Report netcfg status 更多... | |
VOID_T | tuya_ble_restart_adv (VOID_T) |
Resend the ble adv data to hal and start ble adv 更多... | |
VOID_T | tuya_ble_set_bt_para (TUYA_BLE_BT_PARA *para) |
Set parameters for bluetooth. 更多... | |
VOID_T | tuya_ble_set_serv_switch (BOOL_T swith) |
Set enable switch for bluetooth service 更多... | |
VOID_T | tuya_ble_set_startup_attr (TUYA_BLE_ABILITY_T attr) |
Set abilitiy attribute 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 更多... | |
TUYA_BT_CONN_STAT | tuya_bt_get_connect_status (VOID) |
Get connection status of bluetooth 更多... | |
VOID_T | tuya_enable_ble_active (BOOL_T swith) |
VOID_T | tuya_enable_ble_dp_ctrl (BOOL_T swith) |
VOID_T | tuya_enable_ble_mftst (BOOL_T swith) |
VOID_T | tuya_enable_ble_netcfg (BOOL_T swith) |
VOID_T | tuya_enable_ble_timer (BOOL_T swith) |
OPERATE_RET | tuya_set_bt_device_name (CHAR_T *dev_name) |
Set name for bluetooth device. 更多... | |
OPERATE_RET | tuya_svc_bt_init (VOID_T) |
Init tuya 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 更多... | |
VOID_T | ty_bt_support_dp_sync_report (BOOL_T flag) |
Support dp sync report by bluetooth 更多... | |
OPERATE_RET | ty_bt_update_local_key (UINT8_T *p_buf, UINT8_T len) |
Update local key 更多... | |
Common process - Initialization
BOOL_T is_bt_connected | ( | VOID_T | ) |
Check bluetooth is connected.
VOID |
VOID_T tuya_ble_disable_expt_unbind | ( | VOID_T | ) |
Disable function for execept unbinding
VOID |
VOID_T tuya_ble_dp_response_query | ( | IN CONST BYTE_T * | dpid, |
IN CONST BYTE_T | num | ||
) |
Response dp query with report flag
dpid | query dpid array |
num | query dp num |
TUYA_BT_SERV_STAT tuya_ble_get_serv_stat | ( | VOID_T | ) |
Get status of bluetooth service
VOID |
VOID_T tuya_ble_lowpower_handle | ( | VOID_T | ) |
stop ble netcfg and plug_play when dev under lowpower status
VOID |
OPERATE_RET tuya_ble_monitor_init | ( | VOID_T | ) |
Monitor for bluetooth
VOID |
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
[in] | bt_conn_stat_cb | callback function |
VOID_T tuya_ble_rept_netcfg_stat | ( | IN UINT_T | type | ) |
Report netcfg status
type | 0-report 1-query |
VOID_T tuya_ble_restart_adv | ( | VOID_T | ) |
Resend the ble adv data to hal and start ble adv
note
VOID_T tuya_ble_set_bt_para | ( | TUYA_BLE_BT_PARA * | para | ) |
Set parameters for bluetooth.
[in] | para | parameters for bluetooth |
VOID_T tuya_ble_set_serv_switch | ( | BOOL_T | swith | ) |
Set enable switch for bluetooth service
[in] | switch | enable switch: TRUE-open, FALSE-close |
VOID_T tuya_ble_set_startup_attr | ( | TUYA_BLE_ABILITY_T | attr | ) |
Set abilitiy attribute of bluetooth
attr |
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
[in] | data | adv data |
[in] | len | adv data lenth |
[in] | sec_time | time in second |
TUYA_BT_CONN_STAT tuya_bt_get_connect_status | ( | VOID | ) |
Get connection status of bluetooth
VOID |
OPERATE_RET tuya_set_bt_device_name | ( | CHAR_T * | dev_name | ) |
Set name for bluetooth device.
Set device name for bluetooth.
[in] | dev_name | device name |
[in] | dev_name | device name for bluetooth |
OPERATE_RET tuya_svc_bt_init | ( | VOID_T | ) |
Init tuya bluetooth service
[in] | VOID |
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
[in] | dp_rept_type | dp report type |
[in] | data | dp data |
[in] | sync | true-support sync report |
VOID_T ty_bt_support_dp_sync_report | ( | BOOL_T | flag | ) |
Support dp sync report by bluetooth
[in] | flag | true - enable, false - disable |
OPERATE_RET ty_bt_update_local_key | ( | UINT8_T * | p_buf, |
UINT8_T | len | ||
) |
Update local key
[in] | p_buf | local key |
[in] | len | lenth of local key |