c++iossppios-bluetooth

How to connect hardware device to an Iphone application over Bluetooth


I have a hardware device which would communicate with a third party application on Android and IOS over Bluetooth to send to and fro data. With Android I am able to achieve this, however in case of IOS I don't have any information.

Till now the information gathered to work with IOS devices is: 1. Application runs on Iphone 5 2. Hardware is MFI enabled 3. IAP2 is supported

Please guide how to connect the hardware to an application and what other information is essential? Is AppName, BundleID, BundleSeedID and ProtocolName required to connect? If yes how we can get these details?

I tried unzipping the application but the Info.plist file looks garbled and not able to get much info from that.

Currently I am able to connect the hardware with IPhone over Bluetooth, but my real concern is how to communicate with a specific application on it.

Also if you can provide some link or pseudo code to initiate a session between hardware and IOS application.


Solution

  • I assume you've already connected the SPP profile on Android. However for iOS the SPP(BLE is another story and do not need MFi) was hidden but need MFi authentication for raw data links.

    Since you want to establish the raw data link between your hardware device and your iPhone, you need:

    1. Make sure your hardware has MFi chip, generally this chip is connected with your hardware by I2C.
    2. After step 1 make sure you can communicate with this chip at your hardware, fortunately the hardware vendor or MFi vendor will support this kind of code or binary.
    3. The MFi channel have a specific UUID(which may defined by Apple?) to replace the SPP official(which defined by Bluetooth SIG) UUID, hence if you want to make connection between your hardware and your iPhone, you need register the iOS defined UUID and make them as same as the normal SPP profile.
    4. After the RFCOMM channel created, iOS would first authenticate the link, just like 3-way handshaking or something, so your hardware just communicate with the MFi chip and transfer the token to iOS.
    5. After that iOS would set this RFCOMM channel(same as SPP actually) for your hardware, then you can send/recv data between them.