【已解决】【TuyaOS OS】手机端删除蓝牙设备模块能收到通知吗?

蓝牙 BLE设备、蓝牙 MESH设备、蓝牙 Beacon设备、Sub-G设备等


Post Reply
17394068840
Posts: 39

TLSR825X_3.8.1 sdk
当设备从手机上删除的时候,我们想让设备的led闪亮起来,请问SDK中是哪个回调可以收到删除设备的通知? 以下是通知函数的结构体。
typedef enum {
TAL_BLE_STACK_INIT = 0x01, /**< Successfully init ble/bt stack */

Code: Select all

TAL_BLE_STACK_DEINIT,                               /**< Deinit BLE stack Callback */

TAL_BLE_STACK_RESET,                                /**< Reset Event From Ble Stack */

TAL_BLE_EVT_PERIPHERAL_CONNECT,                     /**< Connected as peripheral role */

TAL_BLE_EVT_CENTRAL_CONNECT_DISCOVERY,              /**< Connected as central role, include mesh gatt, And Complete the service discovery, We will report the sevice-discovery result and report the whole hanldes*/

TAL_BLE_EVT_DISCONNECT,                             /**< Disconnected */

TAL_BLE_EVT_ADV_REPORT,                             /**< Scan result report */

TAL_BLE_EVT_CONN_PARAM_REQ,                         /**< Parameter update request */

TAL_BLE_EVT_CONN_PARAM_UPDATE,                      /**< Parameter update successfully */

TAL_BLE_EVT_CONN_RSSI,                              /**< Got RSSI value of link peer device */

TAL_BLE_EVT_MTU_REQUEST,                            /**< MTU exchange request event, For Ble peripheral, we need to do reply*/

TAL_BLE_EVT_MTU_RSP,                                /**< MTU exchange respond event, For Ble Central, the ble central has finished the MTU-Request */

TAL_BLE_EVT_NOTIFY_TX,                              /**< [Ble peripheral] Transfer data Callback, Will Report Success Or Fail */

TAL_BLE_EVT_WRITE_REQ,                              /**< [Ble Peripheral] Get Client-Write Char Request */

TAL_BLE_EVT_NOTIFY_RX,                              /**< [Ble Central] Get Notification data */

TAL_BLE_EVT_READ_RX,                                /**< [Ble Central] Receive data from reading char */

TAL_BLE_EVT_SUBSCRIBE,                              /**< [Ble Peripheral] Event Subscribe */

TAL_BLE_EVT_READ_CHAR,                              /**< [Ble Peripheral] Read Char Event */

TAL_BLE_EVT_CONN_GATT,                              /**< [Ble Central] Report the GATT-Connect Event, Only Report Connect handle!!! */

} TAL_BLE_EVT_TYPE_E;

另外还有一个问题,就是蓝牙设备被手机发现并绑定成功后,能否设置成除非手动让设备进入配网状态,否则不能让手机发现设备?我现在发现即时手机绑定了设备,其他手机搜索设备还是会发现这台已经被绑定的设备。

User avatar
逻辑的院子
Posts: 290
Contact:

Re: 【求助】【TuyaOS OS】手机端删除蓝牙设备模块能收到通知吗?

从手机上删除可能会触发以下两个事件:

Code: Select all

TUYA_BLE_CB_EVT_UNBOUND
TUYA_BLE_CB_EVT_DEVICE_RESET

详情请参考:https://developer.tuya.com/cn/docs/iot- ... _id_type_t

手动让设备进入配网状态,可以通过控制设备的广播来实现:
开启广播即进入配网状态:tal_ble_advertising_start
关闭广播即退出配网状态:tal_ble_advertising_stop

“发现即时手机绑定了设备,其他手机搜索设备还是会发现这台已经被绑定的设备。”
请问这里指的是通过涂鸦智能App发现设备还是扫描到了设备广播?

17394068840
Posts: 39

Re: 【已解决】【TuyaOS OS】手机端删除蓝牙设备模块能收到通知吗?

谢谢已解决

Post Reply