Android Question Read RAW advertising packet from BLE peripheral

neilcarter

New Member
Licensed User
Longtime User
Hi

New to B4A - looking to read the raw advertising packet from a BLE peripheral, the peripheral uses a custom advertising packet and I have gone through the examples but am at a loss how to do this.

Neil
 

neilcarter

New Member
Licensed User
Longtime User
Yes I understand that and how to get the standard elements of the packet - but i cant see how to get the raw packet needed as its a custom packet - maybe im missing something obvious - but i cant find it anywhere.
 
Upvote 0

neilcarter

New Member
Licensed User
Longtime User
ok thank you , i will try key 0, can you point me at any documentation for the map and what is returned in the different keys ?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
BleManager parses the advertising data to keys and values and returns a map with those pairs.
This is why there is really no reason to get the complete data. You will just need to parse it yourself.

The meaning of the various keys and values depend on the specific peripheral that you are communicating with.

You can see the information with:
B4X:
Dim bc As ByteConverter
For Each k As Int In AdvertisingData.Keys
 Log($"${k}: ${bc.HexFromBytes(AdvertisingData.Get(k))}"$)
Next
 
Upvote 0
Top