Get MAC address out of BLE packet

I am currently working on an iOS application based on Bluetooth Low Energy (BLE).

How can I get Advertising Address (MAC) out of BLE packet received by iOS?

Are there any updates for BLE support in iOS9 regarding the prior mentioned issue?

Replies

It is not possible to get the private address of an advertising BLE peripheral via the advertising packets using CoreBluetooth.

An iOS app will not be guaranteed to be able to uniquely identify a BLE peripheral over a certain period and across sessions - you will be provided with a UUID for the peripheral which may change without notice.


If it is necessary for your app to uniquely identify an unknown BLE peripheral, this identifying information must be supplied by the peripheral, as long as this information fits in an advertising packet.


There are no changes with regards to obtaining private address information out of a peripheral in iOS 9.

What is the solution provided by iOS team to identify couple of devices that are physically the same and advertise at the same time to the central? If we are not able to count on the mac address (like Android) or even the UUID, what is the strategy?

The central could connect to the advertising peripherals, at which point they can send arbitrary data to each other to do identification, etc.

It does not sound very power efficient if I need to do a connection with all the remote devices around me. I may come up with my own authentication security protocol embedded in the advertisement.

This needs to be solved in the BLE software of your device not iOS.


For example, you could put a unique device identifier in the Manufacturer data of the device and read this from the advertisement in iOS.


If using the cloud and mutiple iOS devices for your users, your would store this BLE device provided unique information in the cloud data so each iOS device know which data corresponds to which BLE preipheral device.

Another option is to program your peripherals to include the last 2 octets of their MAC address in plain text in their advertisement packet. The app could then parse the advertisement packets without actually having to connect to the peripherals and identify them. This would allow you to map out 63,535 unique peripherals just by their advertisment packets.

As for BLE device manufacturer - the simplest way to broadcast device's own BD_ADDR is include it into the second packet which is transmitted as answer for device name request. iOS allows to pass it to an application. Payload volume of primary BLE packet will not reduce. And it works for iBeacon devices. Our iBeacons do it.

If I understand you well your BLE device sends two packets. One is iBeacon format the other is a generic Bluetooth advertisement which contains the MAC address. If so how do you know which iBeacon packet and (secondary) Bluetooth packet belong to the same device?

your bluetooth address and your advertised ibeacon guid are effectively the same value, that is how you get around apple's ridiculous restrictions regarding ibeacon ... let them close that loophole and make bluetooth impossible to use, i am fine with that, i welcome a closed platform (cynicism)

> This needs to be solved in the BLE software of your device not iOS.


Very nice!

CoreBluetooth is the only BT framework that hides so much sensible data like the peer address, connection details and so forth -- that was quite stupid decision in the first place and now developers have to reinvent a wheel in their BLE devices again and again, just for nothing.

I am also in need of this, I have asked my manufacturer to send the MAC ADDRESS in the advertising packet. My question is, will the App gets rejected because of this?


-john

Could this identifying information be a MAC address? Just concerned about App Store rejection if we get MAC-id of BLE in this way.

RTK,


Although Apple may have made decisions that make some applications more difficult, there are some good reason.


Peer Address is basically useless - the MAC address of a device can change if privacy is enabled. So every 15 mins or so (depends on settings) a device could change its MAC address. The Identifier Apple supplies resolves this by abstracting it: you know you connect to the same device, but whether the MAC address changed doesn't matter. Nevermind that the MAC address is not necessarily guaranteed to be unique unless you purchased a block of IEEE addresses (almost no vendor does except the chipset vendors).


Connection details are nonexistant and this can sometimes make things challenging, but the reality is you couldn't control it anyway - Apple attempts to optimize the connection to balance power and throughput. If your device is compliant with Apple's BLE connection and advertising settings, you can get what you want if the device.


How you connect to every device initially is up to every system because it is device dependant. Some devices have displays, keys, others have nothing. Some devices are very low power while others run on large batteries.


Sending an unique ID in the Scan Response packet (Serial Number) is a good way to avoid connection, but there are many other pariing schemes (proximity, user entry, etc)


Regards,

Gustavo


====================================

ARGENOX

Wireless Connecitivity Experts

Bluetooth, BLE, Wi-Fi

www.argenox.com

info@argenox.com

====================================

How do I connect Bluetooth devices with Bluetooth addresses