Advertising state 如何上报给App

Wi-Fi 设备、Wi-Fi 低功耗设备、Wi-Fi BLE 双模设备、Ethernet设备、Ethernet+Wi-Fi设备等
Post Reply
GD32
Posts: 13

TKL_BLE_GAP_PARAMS_EVT_T结构体中type有TKL_BLE_GAP_EVT_ADV_STATE。
当advertising state改变的时候,在TKL_BLE_GAP_PARAMS_EVT_T结构体中该怎么将advertising state 赋值?

hearge
Posts: 39

Re: Advertising state 如何上报给App

可以这种方式上报:

Code: Select all

TKL_BLE_GAP_PARAMS_EVT_T init_event;
init_event.type = TKL_BLE_GAP_EVT_ADV_STATE;
init_event.result = result;
hearge
Posts: 39

Re: Advertising state 如何上报给App

result可参考下图。目前,该事件tuya sdk没有处理。也可不用关注

Attachments
企业微信截图_17011555668426.png
GD32
Posts: 13

Re: Advertising state 如何上报给App

看到 有这些advertising state

#define TKL_BLE_GAP_ADV_STATE_IDLE (0x00) /< Idle, no advertising /
#define TKL_BLE_GAP_ADV_STATE_START (0x01) /
< Start Advertising. A temporary state, haven't received the result./
#define TKL_BLE_GAP_ADV_STATE_ADVERTISING (0x02) /< Advertising State /
#define TKL_BLE_GAP_ADV_STATE_STOP (0x04) /
< Stop Advertising. A temporary state, haven't received the result./

目前我的做法是result 赋值为上述状态。

如果tuya sdk没有关注这个message,是不是调用gap callback也没有关系

hearge
Posts: 39

Re: Advertising state 如何上报给App

result = 0 默认是广播OK的。
callback上报不上报没有关系的。

Post Reply