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

Parsing of Advertising Data in Android and IOS.

Hi,

We are integrating a 3rd party device with our application and while we were parsing advertising data, we found the same data received in Android at 3rd and 4th index of the advertising packet, while in IOS it is being received at 5th and 6th position? Is this an expected behavior ? Do Android and IOS BLE stack parse the advertising bytes differently?

Parents
  • Hi, what do you mean exactly by 3rd, 4th, 5th or 6th position?

    On Android you get advertising data in 2 ways: as raw bytes (the only option in Android 4.3 and 4.4.4) or parsed as ScanRecord (developer.android.com/.../ScanRecord.html). On iOS you get only the second option where data are put into a map. So I don't know what's 'data position'.

    What I may assume you are talking about it, is Manufacturer Data bytes. Since Bluetooth v4.1 the first 2 bytes are the Company ID (let's say 0x0059 for Nordic, more). On Android they are the key in SparseArray, where on iOS they are included in the data, that's why you may have your actual data shifted there 2 to the right.

Reply
  • Hi, what do you mean exactly by 3rd, 4th, 5th or 6th position?

    On Android you get advertising data in 2 ways: as raw bytes (the only option in Android 4.3 and 4.4.4) or parsed as ScanRecord (developer.android.com/.../ScanRecord.html). On iOS you get only the second option where data are put into a map. So I don't know what's 'data position'.

    What I may assume you are talking about it, is Manufacturer Data bytes. Since Bluetooth v4.1 the first 2 bytes are the Company ID (let's say 0x0059 for Nordic, more). On Android they are the key in SparseArray, where on iOS they are included in the data, that's why you may have your actual data shifted there 2 to the right.

Children
Related