cancel
Showing results for 
Search instead for 
Did you mean: 

How get best performance from BlueNRG-X on scan mode?

uilter
Senior

Hi, 

I'm using the example "BLE_SensorDemo_Central" from SDK to design a PoC to scan iBeacons devices.

I can't figure out why the scan procedure is too slow. 

I have two iBeacon devices near by the BlueNRG-1. 

They are sending iBeacon messages in 3Hz, but the BlueNRG is not fast enough to get the packages.

What am I doing wrong?

I understood that the method "Master_DeviceDiscovery()" set the scan parameters, right? I couldn't find on documentation the min or max for scan interval or scan window.

What do I need to do to get best performance from BlueNRG-1 on scan mode? I don't need to connect, just get the iBeacon messages.

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Winfred LU
ST Employee

Hi Uiter,

HCI_LE_Set_Scan_Parameters() is used to set scan parameters including scan interval and scan window. Both have range between 10 ms and 10.24 s.

There is no right way, with longer scan windows the scanner shall scan more advertisers, but it consumes more power as well.

Below please reference the diagrams that i created. The timing is not very precise, but just to help you get the ideas.

0690X000008vyLbQAI.png

0690X000008vyLRQAY.png

Best Regards,

Winfred

View solution in original post

5 REPLIES 5
uilter
Senior

Hi,

After call the Master_DeviceDiscovery(), that indicate the type of scan and intervals I called "hci_le_set_scan_enable()". This functions allow you enable the scan mode and set a flag the allow duplications.

It works for me and I'm able to receive a lot of iBeacon messages.

The question right now is... Is this the right way to configure it?

About the time of min and max, I found the specification of Bluetooth that mention this values.

Thanks.

Winfred LU
ST Employee

Hi Uiter,

HCI_LE_Set_Scan_Parameters() is used to set scan parameters including scan interval and scan window. Both have range between 10 ms and 10.24 s.

There is no right way, with longer scan windows the scanner shall scan more advertisers, but it consumes more power as well.

Below please reference the diagrams that i created. The timing is not very precise, but just to help you get the ideas.

0690X000008vyLbQAI.png

0690X000008vyLRQAY.png

Best Regards,

Winfred

Hi @Winfred LU​ 

Amazing explanation about window and interval scan, thank you very much about it!

Using HCI_LE_Set_Scan_Parameters(), what callback function I need to use to get the data?

I found:

  • Master_Library_le_advertising_report_event()
  • Master_DeviceDiscovery_CB()

Which one is better to get the Advertising messages?

Thank you!

Uilter.

Please use Master_Library_le_advertising_report_event(), which is the callback for the HCI LE Advertising Report events.

While Master_DeviceDiscovery_CB is the callback when you go with Master_DeviceDiscovery().

Ok @Winfred LU​ !

Thank you for your support.