No, you cannot get the address of EAAccessory mac. I mean, you can use the following command:
NSString *macAddress = [accessory valueForKey:@"macAddress"];
But it is not documented, as you can see in EAAccessory docs . Apple may reject your application, or this feature may stop working with the next iOS update, etc.
If you are just trying to create a custom action on a specific device model, in most cases you can use one of the available information:
<EAAccessory: 0x17445c180> { connected:YES connectionID:29354791 name: 23HG YKL CXN manufacturer: MANUFACTURER NAME modelNumber: 878253-222 serialNumber: //not always available firmwareRevision: 1.0.0 hardwareRevision: 1.0.0 protocols: ( "com.some.protocol", "com.some.other.protocol" ) }
Or a combination of its type (modelNumber + firmwareRevision), etc.
PS: I know that with the information above, you do not know the difference between two identical devices, but depending on what application you are developing, it does not matter.
Hope this helps.
source share