louzhu 发表于 2017-6-30 17:36:11

CSR8670 ADK4.0 ble做client中GAP层怎么没有扫描完成事件

/* GAP events IDs */
typedef enum __ble_gap_event_id
{
    ble_gap_event_power_on,               /* 0 */
    ble_gap_event_bondable,               /* 1 */
    ble_gap_event_set_advertising_complete, /* 2 */
    ble_gap_event_bondable_pairing_timeout,         /* 3 */
    ble_gap_event_central_conn_attempt,   /* 4 */
    ble_gap_event_central_conn_complete,    /* 5 */
    ble_gap_event_central_disconn,          /* 6 */
    ble_gap_event_local_conn_success,       /* 7 */
    ble_gap_event_switch_central,         /* 8 */
    ble_gap_event_switch_peripheral,      /* 9 */
    ble_gap_event_remote_conn_success,      /* 10 */
    ble_gap_event_remote_conn_fail,         /* 11 */
    ble_gap_event_pairing_complete, /* 12 */
    ble_gap_event_switch_timeout,         /* 13 */
    ble_gap_event_cancel_advertising,       /* 14 */
    ble_gap_event_no_connections,         /* 15 */
    ble_gap_event_power_off,                /* 16 */
    ble_gap_event_whitelist_timeout,      /* 17 */
    ble_gap_event_fast_scan_timeout,      /* 18 */
    ble_gap_event_bondable_connection_timeout,      /* 19 */
    ble_gap_event_fast_adv_timeout,         /* 20 */
    ble_gap_event_retry_encryption,         /* 21 */
    /* Update gap_events[] array if adding new item */
    ble_gap_event_last                      /* Always leave as last item in enum */
} ble_gap_event_id_t;
上面是官方的ADK,不过没有扫描完成事件,只有一个扫描超时事件,不知道什么情况。如果我想拿到扫描的设备列表,应该是在哪个事件下得到呢?


pkuzhx 发表于 2017-6-30 17:36:12

8670好像要自己写数据结构,存储扫描到的设备信息。

自动连接好像确实是的,这个需要自己根据需要来修改代码了。

是否存储扫描设备信息,是否自动连接,这些应该都与蓝牙协议无关,各家都是自定义的。

pkuzhx 发表于 2017-7-1 11:27:30

个人理解ble scan并没有完成一说。
即便只有一个被扫描设备,client读取到该设备的广播后,只要该设备还在广播,下次还是会继续读取,一直不停地scan,并不会像传统蓝牙那样INQUIRY over。

louzhu 发表于 2017-7-1 17:05:52

pkuzhx 发表于 2017-7-1 11:27
个人理解ble scan并没有完成一说。
即便只有一个被扫描设备,client读取到该设备的广播后,只要该设备还在 ...

额,我用过TI的ble芯片,他那里可以设置一个扫描时间,比如说扫描4s,扫描后,他会把这4s内扫描到的所有结果放到一个列表里。然后我们就可以从中选择一个设备进行连接了。然后我看CSR8670中貌似没有这个存放扫描结果的列表。我目前从代码上来看,他设置了一个广播过滤功能,一旦发现符合规则的广播包就会自动与其建立连接。目前我也没有实现他和TI的芯片进行对接,目前还在测试。

olevin 发表于 2017-8-15 20:55:58

学习了.....................
页: [1]
查看完整版本: CSR8670 ADK4.0 ble做client中GAP层怎么没有扫描完成事件