cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a detailed scan response

RAdam.1
Associate III

Hi am using the BlueNRG-LP. I am a master/client and want to discover local devices and then decide who to connect to ... I am able to get the advertising data from local devices including the BT addr, RSSI etc. But I want to get the Scan response data from them so I can get more information - such as name etc... So think along the lines of LightBlue or similar BLE Apps that get as much info as possible without needing to connect.

How is this achieved in this stack - the documentation is very thin!

5 REPLIES 5
Winfred LU
ST Employee

Please refer to programming manual in Alpha DK, section 3.3.2.

  1. Configure the scanning parameters, before starting to the GAP general discovery procedure.
  2. The responses of the procedure are given through the event callback hci_le_extended_advertising_report_event()

The scan responses will be reported in Advertising Report event with evt_type set to SCAN_RSP (0x1B).

RAdam.1
Associate III

Thanks Winfred. I have done as requested but I am definitely not seeing all the same information as I get with an app such as LightBlue or nRFConnect. On the apps I see device names and service information (before they even connect). I also do not get an event type of 0x1B.

I also note that the code in BLE_SensorDemo_Central uses an abstraction layer such as Master_Init() which I am unable to see, we dont get source code. Should I drop all that and just use the ACI commands instead?

I get the following

****Master_DeviceScanConfiguration() OK

ADDR 1 = be:20:15:e2:88:04:: RSSI : -85, Type 13- [02][01][06][11][07]g[9a][0c] [00][08][e2][a5][e3][11][[a6] [b3][e3][d9][02][0a][f8][06][ff][00][cc][10][ab][84]

ADDR 2 = f2:03:88:db:f7:74:: RSSI : -90, Type 13- [02][01][1a][02][0a][0c][0a][ff]L[00][10][05][01][14][00][b8][f5]

ADDR 3 = bf:be:b6:ad:2d:21:: RSSI : -87, Type 10- [02][01][1a][0b][ff]L[00][09][06][03][86][c0][a8][01][05]

ADDR 4 = 14:dc:d2:c0:cb:40:: RSSI : -89, Type 13- [02][01][1a][02][0a][0c][0a][ff]L[00][10][05][01][14]b[ac]8

ADDR 5 = 75:14:eb:a8:1f:7e:: RSSI : -79, Type 13- [02][01][06][0a][ff]L[00][10][05]K[1c]i[98]5

ADDR 6 = c0:94:c7:95:e3:61:: RSSI : -66, Type 13- [02][01][1a][02][0a][0c][0b][ff]L[00][10][06][1a][1e][8f]-[0e]

ADDR 7 = 86:7f:7d:ed:08:6b:: RSSI : -65, Type 13- [02][01][1a][02][0a][0c][0a][ff]L[00][10][05][03][1c][c7][ab][05]

ADDR 8 = 6f:39:7c:b5:12:66:: RSSI : -76, Type 13- [02][01][1a][0a][ff]L[00][10][05][01][90]_[c3][9b]

ADDR 9 = 5e:b7:ab:a8:3d:0d:: RSSI : -95, Type 10- [02][01][1a][0b][ff]L[00][09][06][03][0b][c0][a8][01][02]

ADDR 10 = 13:c0:d2:cd:69:c8:: RSSI : -94, Type 13- [02][01][1a][0b][ff]L[00][09][06][03]T[c0][a8][01][a8]

ADDR 11 = ec:6d:80:c4:e0:46:: RSSI : -99, Type 13- [02][01][1a][0a][ff]L[00][10][05][07][1c][86][7e][d1]

ADDR 12 = 8a:7d:22:8f:a0:f4:: RSSI : -87, Type 13- [02][01][06][03][03][ed][fe][0d][16][ed][fe][02][00][11]l[b6][02]m[ca][a5]Q

In lightblue i see.... the attached image

0693W000001qMV9QAM.jpg

Can you explain why I am getting nothing like this?

RAdam.1
Associate III

I also note that the scan window an interval parameters to  Master_DeviceScanConfiguration(&devDiscParam) were set to 0x30 which is very different to the suggested 0x4000 in the manual

Is there any documentation or source code for the Master_Device...... functions shown above? (not just Doxygen stuff)

RAdam.1
Associate III

@Winfred LU​ Do you have any ideas? I am active scanning and barely get any scan responses. But clearly they are out there because my android and iOS phone pick them up with various apps. How do I go about getting faster support from ST? Turnaround is so slow

Winfred LU
ST Employee

Could you please try to set SCAN_TYPE to 1 ?

It is defined In master_config.h line 132, where 0 means passive scan and 1 means active scan.

The devDiscParam variable In deviceScanConfiguration() is supposed to used for aci_gap_set_scan_configuration() ACI, as far as i understand.

Then, try to handle them in hci_le_extended_advertising_report_event() event callback.

It is true that the libmaster_library has wrapped lower layer ACIs into an abstraction layer for user's easier usage. I don't have access to the source code either.

Use the ACIs directly when you need a full control or specific customization.

Please refer to the programming manual in the DK, section 3.3.2, for the ACI example about the scan responses.

> I also note that the scan window an interval parameters to Master_DeviceScanConfiguration(&devDiscParam) were set to 0x30 which is very different to the suggested 0x4000 in the manual

Possibly the interval was designed according to the peripheral's advertising interval to have a proper user response time.

Values between 0x20 and 0x4000 are valid. 0x4000 is the Maximum allowed interval (10.24 seconds) to start another scanning. Users can choose according to the application needs.

For information,

The Apple recommended advertising intervals are 152.5, 211.25, 318.75, 417.5, 546.25, 760, 852.5, 1022.5, 1285 ms.

https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf

> How do I go about getting faster support from ST?

Please contact your corresponding local FAE directly to have immediate technical support.