This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Scan response data and Advertising data, making difference on HRM iOS App

Having too much fun with iOS Apps :-D

I am using heart rate example from SDK11. Firmware example and HRM in nRF Toolbox worked well.

Then I moved

advdata.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
advdata.uuids_complete.p_uuids  = m_adv_uuids;

To

 scanrsp.uuids_complete.uuid_cnt = sizeof(m_adv_uuids) / sizeof(m_adv_uuids[0]);
 scanrsp.uuids_complete.p_uuids  = m_adv_uuids;

And changed parameters in ble_advertising_init accordingly.

Now HRM in nRF Toolbox cannot find the device.

PC Master Control Panel is showing UUID list got moved into Scan Response Data.

I thought this is interesting for somebody trying to understand advertising data and scan response data.

If you want the Central to find the Peripherals, information has to be enough in the advertising data for the Central to know "you are there". Scan Response Data will only be provided by the peripherals when the Central is going to accept "you" and want more information.

Please also let me know that I didn't get this right in my mind. LoL

  • I saw RichieJH posted an answer about UART example is using scan response data only to pass the 128 bit UUID. Yes, I tried that example. And UART App is able to find it. But I think UART App and HRM App are using different way to search devices. HRM App is looking for the service 0x180D. But UART is looking for everything and probably sending scan response data request to every device that is advertising.


    PS. I don't know why his answer is now showing up here, weird. (I got notification in my email, also his answer listed in my devzone inbox)

  • Yes, I posted that answer but then read your question again and saw you were talking about the HRM module in the nRF ToolBox which is specifically looking for an HRM device and if it doesn't see one advertised it takes no action. So I deleted it :) But the real answer is that it is fine for you to have the UUID in scan response providing your master always does a scan request when they see your original advertisement (whatever that may be) to unveil the HRM UUID. It's just that it appears nRF Toolbox is not doing that.

  • Actually I don't think the app can decide if iOS should do active scanning or not. My understanding is that this is handled by coreBluetooth, but that iOS will in general do active scanning when the app is in the foreground, while it switches to passive scanning in background mode. I would also expect it to switch to passive scanning if scanning for a long time in foreground mode as well, but I don't know if this is the case.

Related