BLE manufacurer data in adv_ind and scan resp for Android

Hi, 

I found an interesting issue on Andorid app with my nrf52840 device BLE advertising.

Since I need long size for my custom data so I tried to use the manufacturer data in both adv_ind and scan_resp for the BLE device.

But the android app is only able to get one side manufacturer data which is not having service uuid while iOS app can get both manufacturer data from adv_ind and scan_resp.

Does anyone know if Android OS has some kind of limitation like only being able to get the manufacturing data from one side adv_ind or scan resp which doesn't include service_uuid or something?

Thanks!

Parents
  • Hi Eleven-x,

    If you add something else, not manufacturer data into the scan response packet, do you receive the data on the Android app ? 


    Could you try to do the scanning using nRF Connect app ? 

  • But the android app is only able to get one side manufacturer data which is not having service uuid while iOS app can get both manufacturer data from adv_ind and scan_resp.

    I was confused, the manufacturer data shown was always from scan_resp. It is not related to service uuid.

    nRF connect app shows both properly.

    And when I check the whole bytes of advertising data, it always comes with adv_ind + scan_resp.

    My guess is android os just remains the last manufaturer data after parsing since the later data covered previous data if you use "scanRecord?.manufacturerSpecificData?.

    Is nRF connect app parsing the data with its own decoding code with"scanRecord?.bytes" or using "scanRecord?.manufacturerSpecificData?" I guess it is decoding code with"scanRecord?.bytes".

  • Hi again,

    I got some feedback from our Android developer: 

    On Android you may get the Manufacturer data in 2 ways. 

    First is by using ScanRecord  |  Android Developers, which returns an array of bytes for given company ID

    It may be, that if there are 2 manufacturer data with the same ID, one in Adv data, the other in Scan Resp, the Android just overrides one with the second so you'd get one

    The other solution is to get Raw Data using ScanRecord  |  Android Developers and parse them on your own. And usually, the raw data contain a concatenated adv data + scan response (you don' t know where the other starts)


    So I guess you are right, the nRFConnect parse the "scanRecord?.bytes" directly. 

Reply Children
Related