6 posts / 0 new
Last post
randyzhou
Offline
Last seen:1 week 3 days ago
加入:2014-02-20 07:09
SPI主从模式,蓝牙scan后6秒钟左右自动停止

您好:
我们移植了SDK5.0.4中SPI主从模式的proximity工程。 在HadleGapmCmpEvt收到GAPM_SET_DEV_CONFIG回应后开启Scan. 能够正常scan到周围设备的广播包。 但是scan过程只持续了6s左右,就收到了scan结束的消息,错误码0x45 GAP_ERR_TIMEOUT. 如下是scan的log和scan的参数。 请问要如何修改才能保持长时间持续扫描,谢谢!

struct *msg = BleMsgAlloc(GAPM_START_SCAN_CMD, TASK_GAPM, TASK_GTL,
sizeof(struct gapm_start_scan_cmd));
msg->mode = GAP_GEN_DISCOVERY;
msg->op.code = GAPM_SCAN_PASSIVE;//GAPM_SCAN_ACTIVE;
msg->op.addr_src = GAPM_PUBLIC_ADDR;
msg->filter_duplic = SCAN_FILT_DUPLIC_EN;
msg->interval = 10;
msg->window = 5;
//msg->operation = GAPM_RESET;
msg->filt_policy = SCAN_ALLOW_ADV_ALL;
msg->filter_duplic = SCAN_FILT_DUPLIC_EN;

BleSendMsg(msg);

Sys UP:1
HandleBleMsg:3401
HCI Msg 2 spi 3402
spi2_send_hci_msg
HandleBleMsg:3400
HadleGapmCmpEvt:1[0]
app_proxr_db_create
HCI Msg 2 spi 4003
spi2_send_hci_msg
HandleBleMsg:4004
app_set_mode
HCI Msg 2 spi 3404
spi2_send_hci_msg
HandleBleMsg:3400
HadleGapmCmpEvt:3[0]
app_start_scan_gap
msg->op.code = 10
HCI Msg 2 spi 340f
spi2_send_hci_msg
HandleBleMsg:3410
ADDR16:15:14
RSSI45
HandleBleMsg:3410
ADDR16:15:14
RSSI49
HandleBleMsg:3410
ADDR16:15:14
RSSI44
HandleBleMsg:3410
ADDR16:15:14
RSSI3a
HandleBleMsg:3400
HadleGapmCmpEvt:10[45]

Device:
CYibin
Offline
Last seen:3 months 2 hours ago
Staff
加入:2017-12-14 02:48
您好,

您好,

您在收到下面消息:

HandleBleMsg:3400 <--> GAPM_CMP_EVT
HadleGapmCmpEvt: 10 [45] < - > gapm_operation= GAPM_SCAN_ACTIVE, status = GAP_ERR_TIMEOUT

之后,重新发送 GAPM_START_SCAN_CMD 就可以重新启动扫描了。

附件有应用参考例程

Attachment:
randyzhou
Offline
Last seen:1 week 3 days ago
加入:2014-02-20 07:09
Dialog support:

Dialog support:
谢谢您的回复!
请问TIMEOUT具体多长时间还能设置吗?

CYibin
Offline
Last seen:3 months 2 hours ago
Staff
加入:2017-12-14 02:48
你好, 不可设置

你好,

不可设置

zhaozhenhong
Offline
Last seen:1 year 2 months ago
加入:2019-07-12 04:10
这个receiver的例程设置了白名单

这个receiver的例程设置了白名单,我想去掉可以扫描任意设备要怎么弄?

CYibin
Offline
Last seen:3 months 2 hours ago
Staff
加入:2017-12-14 02:48
你好,把发送白名单的命令去掉即可

你好,

白名单是通过给系统底层协议栈发送一条设置白名单的消息实现的,将其去掉即可