20706 hello_sensor BLE scan connect

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
adam
Level 4
Level 4
5 solutions authored 25 replies posted 50 sign-ins

Hi, 

I am using CYW20706 as Central role to do the scanning.

when scan result callback I turn off scanning and initiate a connection by callback parameter.

scanResultCb(parameter)

{

wiced_bt_ble_scan( BTM_BLE_SCAN_TYPE_NONE, WICED_FALSE, scanResultCb );

return_value = wiced_bt_gatt_le_connect( p_scan_result->remote_bd_addr, p_scan_result->ble_addr_type, BLE_CONN_MODE_HIGH_DUTY, TRUE );

}

but I got the return_value  as FALSE very often, 

I keep scanning  after lots of return FALSE it can get return TRUE and connect successfully in sometimes.

Is there any reason why connect fail return FALSE?

adam_0-1664526141857.png

thanks.

 

0 Likes
1 Solution
adam
Level 4
Level 4
5 solutions authored 25 replies posted 50 sign-ins

I found the issue, 

if you want to do connect in scanResultCb, 

1. save scan address and advtype

2. disable scanning

3. scanResultCb will callback again without parameter

4. in this time, do connect

View solution in original post

0 Likes
1 Reply
adam
Level 4
Level 4
5 solutions authored 25 replies posted 50 sign-ins

I found the issue, 

if you want to do connect in scanResultCb, 

1. save scan address and advtype

2. disable scanning

3. scanResultCb will callback again without parameter

4. in this time, do connect

0 Likes