3

When advertising from an android device (supports BLE Peripheral mode)

Is there a way to add advert data elements to a scan response?

I think it is sending empty scan responses when a central role device is doing an active scan as we are recieving two RSSI values in our own hardware

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
b_hammonds
  • 66
  • 6
  • What problem are you having? What have you tried doing so far? – dirn Dec 18 '14 at 17:48
  • 1
    I am advertising from my Nexus 9, and doing an active scan on a Laird BL600 (http://www.lairdtech.com/products/bl600-series) I know whilst doing an active scan you should recieve a follow on scan response that can also contain data I Have sniffed this and i am indeed recieving an advert packet from the nexus but it doesnt contain any advertising element. There just doesnt seem to be any API for adding data to the response. – b_hammonds Dec 19 '14 at 09:25

1 Answers1

1

Use the start advertising method with that has two arguments of type AdvertiseData. One will be the Advertisement packet and the other is the scan response. See this constructor from Android developer site:

startAdvertising(AdvertiseSettings settings, AdvertiseData advertiseData, AdvertiseData scanResponse, AdvertiseCallback callback)
Khaled Alanezi
  • 351
  • 4
  • 12