objective-cbluetooth-lowenergycore-bluetoothmfieaaccessory

CoreBluetooth or the EAAccessoryManager and hands free


Is it possible to know if an iPhone is paired with the hands free system in a car using the CoreBluetooth or the EAAccessoryManager? If not, is there another way to do it?


Solution

  • If the iPhone considers the car an accessory you can get the connected accessories by calling:

    [[EAAccessoryManager sharedAccessoryManager] connectedAccessories];
    

    This will return an array of EAAccessory objects which you can then query to get certain information like the name: accessory.name.

    I don't know for certain of this will work with cars having never tried it myself (I have used it with other accessories), so I would suggest that you create a test app that logs the connected accessories to the screen on demand and test it yourself.

    Here's the documentation for EAAccessoryManager and EAAccessory.