I have a similar problem and many streams like this say that you cannot get the MAC address from CoreBluetooth. I want to connect to a BLE peripheral device (I mean an open and connected peripheral device) and store some information in a database so that another iPhone can read the same database and use the information when it connects to the same BLE peripheral device . So far, I rely on the device name obtained as follows:
-(void)addDiscoveredDevice:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI { NSString * name = [peripheral name]; }
because NSString * uuid = [[peripheral identifier] UUIDString]; gives different results on different iOS devices.
Therefore, let’s say my first problem is to find out how much Apple Watch I have is close to my iPhone, the second problem is to find out if this Apple Watch (for example, John Apple Watch) fits my iPhone. Unfortunately, this method does not work because users (e.g. John) or companies can change the name of their peripheral devices.
Yes. I can rely on a combination of the name + service uuid + character uuid, but for the same reasons, if the name changes, it is useless. Has anyone found a solution?
source share