0

To get the mac address of a ble device, it need to connect first, but in android we have option to see mac address while in scan mode in list of devices around.

To replicate that behaviour in iphone environment, can we attach mac address as postscript to the name of ble device itself?

Here is what is sent from ble while advertising:

```["kCBAdvDataTimestamp": 511120041.111478, "kCBAdvDataLocalName": MYDEVICENAME, "kCBAdvDataIsConnectable": 1]```

Could mac address be attached somehow to the name "MYDEVICENAME" as "MYDEVICENAME-12:34:56:12:34:56"?

Raj
  • 1,099
  • 2
  • 13
  • 30
  • Yes, if there's enough space in the advertising packet for this to fit (your example is right at the edge, and is possibly a little too long). Why do you think you couldn't do this, provided you control the device's firmware? Did you have some trouble? (Why put it in the name, though, rather than in the manufacturer's data?) – Rob Napier Nov 14 '19 at 16:19

1 Answers1

0

In my experience a hex of the mac address is included in HEX format in the advertisement packet. You cannot acquire it from CoreBluetooth, they abstract it out in the form of a UUID.

There seems to be a way to parse the MAC address, but I have not tried it. Here's a good post on it (it's at the bottom)

Get MAC address of bluetooth low energy peripheral

John Lanzivision
  • 425
  • 4
  • 12