|
TuyaOS
|
Common process - Initialization 更多...

结构体 | |
| 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 | |
函数 | |
| OPERATE_RET | bt_netcfg_init (VOID_T) |
| Init network configuration by bluetooth 更多... | |
| OPERATE_RET | bt_netcfg_uninit (VOID_T) |
| Uninit network configuration by bluetooth 更多... | |
| BOOL_T | is_bt_connected (VOID_T) |
| Check bluetooth is connected. 更多... | |
| VOID_T | tuya_ble_connect_enable (BOOL_T enable) |
| Control the BLE fearture 更多... | |
| VOID_T | tuya_ble_disable_expt_unbind (VOID_T) |
| Disable function for execept unbinding 更多... | |
| BOOL_T | tuya_ble_is_serv_opened (VOID_T) |
| Check bluetooth service is available 更多... | |
| 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_restart_adv (VOID_T) |
| Resend the ble adv data to hal and start ble adv 更多... | |
| VOID_T | tuya_ble_set_auto_close (BOOL_T auto_close) |
| Close or open ble adv when mqtt disconnect or connected 更多... | |
| 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 更多... | |
| TUYA_BT_CONN_STAT | tuya_bt_get_connect_status (VOID) |
| Get connection status of bluetooth 更多... | |
| OPERATE_RET | tuya_set_bt_device_name (CHAR_T *dev_name) |
| Set name for bluetooth device. 更多... | |
| OPERATE_RET | ty_ble_init_env_for_mftest (VOID_T) |
| OPERATE_RET | ty_bt_dp_report (IN CONST DP_REPT_TYPE_E dp_rept_type, IN CONST VOID_T *data) |
| Report dp by bluetooth 更多... | |
| OPERATE_RET | ty_bt_init_env (IN CONST TY_BT_SDK_PARAM_S *p) |
| Init the running environment for bluetooth. 更多... | |
| OPERATE_RET | ty_bt_update_local_key (UINT8_T *p_buf, UINT8_T len) |
| Update local key 更多... | |
Common process - Initialization
| OPERATE_RET bt_netcfg_init | ( | VOID_T | ) |
Init network configuration by bluetooth
| VOID |
| OPERATE_RET bt_netcfg_uninit | ( | VOID_T | ) |
Uninit network configuration by bluetooth
| VOID |
| BOOL_T is_bt_connected | ( | VOID_T | ) |
Check bluetooth is connected.
| VOID |
| VOID_T tuya_ble_connect_enable | ( | BOOL_T | enable | ) |
Control the BLE fearture
| enable.TRUE | enable FALSE disable the ble feature |
| VOID_T tuya_ble_disable_expt_unbind | ( | VOID_T | ) |
Disable function for execept unbinding
| VOID |
| BOOL_T tuya_ble_is_serv_opened | ( | VOID_T | ) |
Check bluetooth service is available
| 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_restart_adv | ( | VOID_T | ) |
Resend the ble adv data to hal and start ble adv
note
| VOID_T tuya_ble_set_auto_close | ( | BOOL_T | auto_close | ) |
Close or open ble adv when mqtt disconnect or connected
| auto_close |
| 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 |
| 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 ty_bt_dp_report | ( | IN CONST DP_REPT_TYPE_E | dp_rept_type, |
| IN CONST VOID_T * | data | ||
| ) |
Report dp by bluetooth
| [in] | dp_rept_type | dp report type |
| [in] | data | dp data |
| OPERATE_RET ty_bt_init_env | ( | IN CONST TY_BT_SDK_PARAM_S * | p | ) |
Init the running environment for bluetooth.
| [in] | p | initial parameters for bluetooth |
| 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 |