How to get Major and Minor values from scan

Hi, I have a NANO 33 BLE board. I can write sketches and upload just fine.

I have been trying to get the major and minor values for a Beacon. The scan routine returns the MAC address.

I've gone hunting throught the src files but without luck.

Can anyone advise on getting the major and minor numbers from a beacon please?

Failing that does anyone know how to get the raw advertizing packet (which contains these numbers).

Thanks - and hoping - Richard

You need to get the actual advertising packet (see: iBeacon advertising packet structure – Support Center)

The version numbers are offset into the advertising packet, you should be able to modify the library to expose this data. You want to look for the code that extracts the MAC address from the BT packet, that is where you can add extra code to get the major/minor version number.

Hi, thanks for the reply.

That is exactly what I wanted to avoid if possible - hoping the full advertising packet is exposed.

Failing that, your answer looks to be my only option.

Would anyone know which module and approximately where the unpacking of the MAC from the advertising packet would be please?

Cheers - Richard

Probably this:

Found it by looking for the code which issued events when a device was observed:

You might just be able to add a public member function to BLEDevice which extracts the version numbers as the advertisement data is stored in the BLEDevice class: