2. I have an hardware that device have Bluetooth version 2.1. I have to communicate an iOS application with this hardware.
CoreBluetooth (GATT Profile) is used in iOS application. I could't communicate through bluetooth with the hardware. I can manually paired the hardware with iPhone. Can I interact with hardware using this GATT profile ? If not how can I do the same.
Bluetooth 2.1 is considered ‘Classic’ Bluetooth. It’s a different mechanism than Bluetooth Low Energy (BLE).
Classic devices support various built-in application classes (also called ‘profiles’). Audio devices like speakers support the A2DP or AVRCP profiles which the iPhone supports at the system level. Some hardware devices also support the Serial Port Profile (SPP) which is good for out-of-the-box data exchange. Unfortunately, the iPhone doesn’t support that (but Android does).
When you say you're ‘pairing’ with the device it’s possible that you’re doing an audio pair with it. That only allows the iPhone to exchange audio data with a device. It’s an entirely different scenario for data.
For data exchange the device has to support the Apple iAP profile. On the app side the software can use a framework called EAAcessory to communicate with that device. For this to work both the device and the app have to go through the Apple MFi certification program. Here’s more info:
- Apple guidelines: https://developer.apple.com/hardwaredrivers/BluetoothDesignGuidelines.pdf
- Bluetooth SIG Profiles: https://developer.bluetooth.org/TechnologyOverview/Pages/Profiles.aspx
First I would try to find out what kind of Bluetooth your device supports (Classic or LE). And if classic whether it supports iAP. Then you can decide which software you can use in your app.
Best,
Ramin