Arduino and iPhone connection with Bluetooth 3.0 - ios

I would like to build an app that requires bluetooth connection. The Bluetooth HC05 module is connected to Arduino. I want to know what framework (or other related things) that I need to build an app that can connect to this Bluetooth module.
Still have no idea how to start. Anyone could help?

Unfortunately the answer might be "you can't do that".
iOS only supports the following Bluetooth profiles: HFP, PBAP, A2DP, AVRCP, PAN, HID and MAP. None of those can be used inside an app to communicate to your Arduino.
For the useful profiles like Serial Port Profile (SPP) and all arbitrary bluetooth communication you have to add an authentication chip to your Arduino. Unfortunately you can't buy these chips unless you have a MFi membership. And you won't get into the MFi program unless you are a company with a concrete product (mass market scale) in mind.
Fortunately, we now have Bluetooth Low Energy. Bluetooth LE can easily be used in iOS apps, without all the MFi hassle. So you should get a Bluetooth 4.0 module for your Arduino.
The framework that is used for Bluetooth 4.0 communication is called CoreBluetooth. You will find documentation, sample code and WWDC videos in the iOS Developer Center. Start with the Core Bluetooth Programming Guide

Related

How to scan and connect to Bluetooth classic for iOS in Xamarin forms?

I'm trying to implement Bluetooth for my project. I was able to implement BLE but I have to go with Bluetooth classic because of some hardware issue. So for Bluetooth classic implementation I have gone through this post and I used source code from this post. But in that they are trying to connect to already paired device. But my requirement is to scan and connect to available Bluetooth classic device not BLE device. And also there should not be any pairing dialogue appearing while connecting. I even tried to check if there is any Bluetooth classic scanner application in app store for reference but I didn't find any. There are only BLE scanner application in app store. I have no clue how to proceed forward any suggestions?
iOS apps can only connect to MFi enabled Bluetooth classic devices. This is why you can't find any classic BL scanner apps. Unless your hardware contains an MFi chip from Apple you will not be able to use classic Bluetooth profiles, such as SPP, to communicate with it.

Use bluetooth in iOS application

I'm currently digging my through the nest of using Bluetooth in my iOS application and I find it quite hard to find the information I'm looking for.
Can I turn on Bluetooth from within my app or does the user have to do it manually?
Can I use the basic Bluetooth fetaures (such as Discovery, connecting and Sending Data) with other devices running Bluetooth < 4.0 (classic)
AFAIK CoreBluetooth Framework can only be used to communicate with devices running Bluetooth 4.0+. Which framework is used to communicate with Bluetooth < 4.0 devices?
Is it possible to use Bluetooth in such a way that Apple will reject my App on App Store? And which ways would that be?
Is there a difference between paired and unparied communication? Can one communicate with another device without being paried? Can pairing be initated from an app?
To give some Context to my question: I'm currently developing a part of a Home Automation Application where the App needs to communicate with an embedded device which does not yet have Wifi. It has not been decided which Bluetooth version will run on the embedded device. The same functionality will be implemented in an Android application.
Thankful for some input from some with Bluetooth experience for iOS.
you cannot turn on Bluetooth from your app. The user must do it using settings or the control center.
unless you device is MFi certified you can only communicate with Bluetooth Low Energy devices
the external accessory framework is used to communicate with MFi devices that use "classic" Bluetooth
I am not aware of any use of Core Bluetooth that will lead to app rejection. If your app supports an MFi accessory that isn't associated with your company then your app will be rejected.
you can initiate bonding (commonly known as pairing but it is actually different) by requiring encryption for an attribute. Once the bonding is complete there is no difference in how you transfer data, but the data will be encrypted over the air.

iOS sample to connect a Bluetooth with MFI

I have an application for Android that communicates via Bluetooth with a hardware we develop. Now I need to develop an application for iOS that connects with the same hardware via bluetooth. This hardware makes serial communication via Bluetooth.
I've been researching quite recently and found two outputs:
- Bluetooth Low Energy (BLE).
- Bluetooth with "MFI Program".
Analyzing the smartphone today, both Android as iOS, the best option would be the MFI. Due to availability on older smartphones. Even already started the enrollment process over MFI program.
My question focuses on the development on iOS. And my question is:
Looking for Objective-C. Is there a difference between connecting to a Bluetooth Low Energy or MFI? Could someone show me an example of connecting via Bluetooth MFI?
As I understand it, devices enrolled in the MFi program use the EAAccessory framework, not CoreBluetooth. Documentation is here: External Accessory Programming Topics.
Sample code here.
MFI is for Bluetooth device Hardware.
Coming to connecting to BLE device from iOS devices, you have to use CoreBluetooth framework.
http://www.raywenderlich.com/52080/introduction-core-bluetooth-building-heart-rate-monitor
Check this link.

Test Bluetooth on iOS

I'd really like to start testing my iOS apps Bluetooth capabilities, but have run into a few problems:
I have a device made with a RN-42 module, but it's not the Apple version and I don't have the Apple authentication module at the moment (I ordered it, but shipping from China can take a while). I know what the messages will look like, but can't send them to my iPhone!
I can use the module with my Macbook, but not in the iOS simulator! Apple has taken down all of the documentation related to getting the iOS < 7.0 to use a separate bluetooth dongle, and my efforts have left my 6.1 simulator endlessly spinning on the bluetooth screen.
I'm new to using Bluetooth, so this may be a dumb question...
Is there a way of getting a bluetooth client device (I have a Mac, another iPhone, and an Android tab) to act as a server module that can send (and receive) Bluetooth data to my iPhone?
Client/Server as per developer.bluetooth.org
Thanks!
Not 100% sure your meaning of "server module". But in CoreBluetooth, you can use CBPeripheralManager to broadcast data to other iOS or Mac apps.
https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBPeripheralManager_Class/Reference/CBPeripheralManager.html
If you're using standard Bluetooth (i.e. not Bluetooth LE or Bluetooth Smart or whatever you want to call it), you'll need to enroll in the MFI program or work with an MFI certified device (such as a Redpark cable) and use the External Accessories library provided by Apple. If you're using Bluetooth LE, you can use the Core Bluetooth library provided by Apple. If you fall into neither of those cases, sorry, you can't use Bluetooth on iOS.

Can CoreBluetooth framework pair and talk to a slave bluetooth 2.0 serial module?

I would like to write an app for iPhone 4s that can talk to a slave bluetooth 2.0 serial module such as the HC-06, BC417, or EGBT-046S. Is this possible? Can anyone provide some sample code?
No, CoreBluetooth is for Bluetooth Low Energy. The External Accessory Framework can be used for Classic Bluetooth connection. But to be able to open on a serial link from the iPhone, you need a peripheral that complies with the Made For iPhone (MFi) program, and you need to be an MFi member to be able to buy one. Look at this question for more info: What's needed to use the Apple Accessory Protocol?

Resources