Search code examples
swiftbluetootheaaccessory

get eaaccessory macaddress in swift


i have a bt 2.0 device with certified.

i can send/recv data with this bt device with eaaccessory input/output stream.

but i went to get the device's mac address

there is a ios9 eaaccessory header

https://github.com/JaviSoto/iOS9-Runtime-Headers/blob/master/Frameworks/ExternalAccessory.framework/EAAccessory.h

  • (id)macAddress;

how can i call this method ??

this app do not need submit to apple store.


Solution

  • Try to get value with:

    let mac = myAccessory.valueForKey("macAddress")
    print("mac address is: \(mac)")