Is it possible to determine the unique bluetooth MAC address for an iPhone and an Android (and to a lesser extent, other smartphones) from within an app on said device? Is my assumption that the MAC address is universally unique correct?
A general yes or no would be helpful. Example code in the case of an iPhone or an Android would be extremely helpful.
Yes the bluetooth MAC address will always be unique.
In Android you can use the getAddress() api on the BluetoothAdaptor.
It returns the MAC address as a String.
On iPhone it looks like there is no public API to read the MAC address , see this thread
Android
Read up on the Bluetooth section of dev guide, specifically Connecting Devices.
About UUID
A Universally Unique Identifier (UUID)
is a standardized 128-bit format for a
string ID used to uniquely identify
information. The point of a UUID is
that it's big enough that you can
select any random and it won't clash.
In this case, it's used to uniquely
identify your application's Bluetooth
service. To get a UUID to use with
your application, you can use one of
the many random UUID generators on the
web, then initialize a UUID with
fromString(String).
Related
I have bought 5 BLEs from sensor tag, I Downloaded some iBeacon detection code.
But I do not know UUID of the 5 BLEs. Do I Need to put the UUID in my iBeacon detection code?
How Can I get the bluetooth device list using iBeacon code?
While you can use CoreBluetooth to do an LE scan and see all nearby iBeacons, the info you get back about each iBeacon is not very useful -- iOS blocks you from being able to read the iBeacon identifiers, including the ProximityUUID. See My blog post about this here.
So the bottom line is that while you can see unknown Proximity UUID iBeacon devices with iOS, you cannot even be sure the devices you see are iBeacons at all.
Android and OSX Mavericks do not have this restriction, so if you have access to one of those devices, try my company's iBeacon Locate or ScanBeacon products, which will read your identifiers for you.
Is impossible, at lest no way to get this list via public API, you must know the UUIDs before ranging
I am developing an iphone application which will communication with multiple bluetooth receivers that all have the same uuid. I am trying to figure out how I can create a mapping to allow the client to give each device a personalized name that would be persistent across connects/disconnets with the device. I have done something similiar in bluetooth 3.0 by mapping the name to the mac address of the device, but it doesn't appear the the mac address is available in bluetooth 4.0 of the CBPeripheral. Anyone having any ideas on how to solve this?
I am building an app where I do not want a loginsystem. I still want to be able to know what user is sending information to my online database. As far as I know, the UDID is not allowed to upload to any servers, so that is out of the question. Can I use the iphones mac address for this? If it is dynamic, it will change from time to time, and I won't be able to track it.
We use the MAC address as a unique identifier now the UDID has been deprecated.
MAC addresses are hardware based and therefore cannot be changed.
I would like to build an IPhone app that should check the identity of a BT device, by name or MAC.
If the device is not part of the MFI programme what profiles should the device support in order for an IPhone app to connect to it and validate its MAC or name ?
Cheers,
Ionut
I'm not sure you need to connect to something to get a MAC address or a name. My coworker's iphone seems to see all other bluetooth devices in our work area and displays the names, it just won't connect to them. And I'm sure it gets the MAC before it gets the name, but avoids displaying it to the user because names are a lot more friendly.
I do know that with android and blackberry, you actually use MAC addreses as your basic internal identifier, and only pull out the name when you want to identify your remote devices to the user.
If you really do need to make a connection from iOS to non MFi bluetooth radio, the advanced audio distribution profile (A2DP) would do what you want. There's a product out there I've seen that is a bluetooth controlled power board, and it used audio pulses being transmitted over A2DP to get around MFi requirements. Though you should reconsider this approach because it's problematic for a non audio device to advertise an audio profile. And this fake audio device will get seen by by a lot more than your application.
If you're happy to only work with iphone 4s and above, I've also heard rumours that bluetooth LE(4.0?) devices are not required to have the apple verification chip... but haven't really looked into it
I know CFUUID is generated from MAC address and a few other stuff. So is there anyways to get the MAC address back from CFUUID?
We have a few bluetooth devices and all the user knows is the last 3 parts of the MAC address which is written on the device. So we wanna give the user and option to select the right device. On the iOS side, looks like all we have the the CFUUID. So is there's a way to convert the UUID back to mac address?
Or even better would be if there's a way to get a peripheral's MAC address directly instead of UUID, but doesn't seem like that's possible
Thanks
Well, as you might have learnt from the comments to your question, the answer is clearly: NO. It is not possible (practically) to get the seeds that generated a particular UUID. Provided that in fact the algorithm that generated your UUID did used the MAC Address of your device to generate it, and I guess you cannot guarantee that it is the case for the UUID generator you use, unless you have access to the UUID Generator code or algorithm (UUID Version 1 probably?) and it is not a opaque operation to you (Immediately defeating the very purpose of the uuid generation algorithm).
While you clearly are onto something when you say that the generation of a UUID might use the MAC address of the device, other components like timestamps, hashing, UDID (iOS Devices) and so on. The fact is that the MAC Address, could be just one of many factors used to generate the UUID so if you were to spend a lot of computing power into trying to deconstruct it out of a big sample of UUIDs generated by the same system under the same conditions; We will probably be talking about a quantum computer wasting computing power trying to explore as many combinations as particles in the observable universe so you get a MAC address that you may as well get as a characteristic from a Bluetooth peripheral if you like, and incidentally defeating the purpose of having a UUID in the first place, once more.
On the other hand, further to what somebody commented on your question: the reason you find UUIDs so boring, building on top of the previous paragraph idea, is so you can avoid collisions: Generating duplicates not just coming from the ones generated by your computer but from all the other ones generated by every device out there every moment of the day (to authenticate requests, create string index keys in a database, or identifying services and characteristics) so your cool service or characteristic named:
AAAAAAAA-BBBB-CCCC-DDDD-EEEEFFFF6666
does not get confused with another cool foo service or characteristic with the same UUID.
In general, for more information check wikipedia or just the Core Bluetooth Programming Guide, form the developer portal. It is still under NDA so you have to be a registered iOS Developer with active developer program credentials to read it.
I was looking for a way to deploy platform-independent, static configurations of BLE devices. I was getting discouraged (Apple's UUIDs are +/- meaningless, and the MAC/BDADDR which can be obtained on most/all other platforms is not accessible from CoreBluetooth). Fortunately, I noticed that the "Device Information Service" profile (0x180A) contains a "System ID" attribute (0x2A23) which encodes the device's unique MAC/BDADDR address. I don't know if it is mandatory for a BLE device to expose this service, however.
there is a way to get mac address for ios device. but only works on ios8 and later. no private api .https://github.com/Baoge2012/MacAddressLibDemo