cancel
Showing results for 
Search instead for 
Did you mean: 

aci_gap_start_general_discovery_proc doesn't return NON Connectable devices

Santoli.Massimo
Associate II

Hello,

I'm struggling with BLE scanning on an STM32WB55 based application as GAP_CENTRAL_ROLE.

We need to scan for beacons, and can't see any with ADV_NONCONN_IND, if device Advertises as connectable everything works perfectly.

Any suggestions welcomed.

Massimo

4 REPLIES 4
Remi QUINTIN
ST Employee

When a device sends an aci_gap_set_non_connectable command with the advertising_event_type parameter set to 0x03 (ADV_NONCONN_IND), The aci_gap_start_observation_proc must be used instead of the aci_gap_start_general_discovery_proc function.

In that case, the Advertising Reports (ADV_REPORT) with event_type=0x03 (ADV_NONCONN_IND) are received. The AD type Flags which set the device as discoverable is not present.

The device can be detected either with the ST BLE Toolbox mobile application or with nRF connect.

  

When a device sends an aci_gap_set_discoverable command with the advertising_type parameter set to 0x03 (ADV_NONCONN_IND), the aci_gap_start_general_discovery_proc command can be used.

In that case, , the Advertising Reports (ADV_REPORT) with event_type=0x03 (ADV_NONCONN_IND) are received.

The AD type Flags which set the device as discoverable is present.

Note that the aci_gap_start_observation_proc function can cover all the advertising types (ADV_NONCONN_IND, ADV_IND and ADV_SCAN_IND) assuming the device is an OBSERVER.

When the aci_gap_start_general_discovery_proc command is used, the Advertising Reports with no “discoverable�? flag are filtered by the GAP layer.

Santoli.Massimo
Associate II

Remi,

Thanks Very much for the clarification!

Our device is just a passive beacon scanner, and we started from the STM32WB code example of the P2P_Client.

Do you have any indication to se the device as a pure OBSERVER.

Thanks

Massimo

Martin HUBIK
Associate III

Hello Massimo,

P2P_Client might be good starting point. You need to change the role though and set

 aci_gap_init(GAP_OBSERVER_ROLE,...

and then call aci_gap_start_observation_proc() instead of aci_gap_start_general_discovery_proc();

I suggest you check the return status of all ACI calls to debug the possible issues. The error codes can be found in

AN5270 - STM32WB Bluetooth® Low Energy (BLE) wireless interface

Best regards,

Martin

Santoli.Massimo
Associate II

Martin,

Thanks for your input...

We are testing the whole solution now.

Massimo