Bluetooth serial connection for Iphone app - ios

I have a general question about using bluetooth in apps. I'm doing a college program that involves communicating with a serial bluetooth device from a phone. I originally found that Iphone apps are easier to create (I have C/C++ but no java, hence the lean away from android) but Ive came across several posts about having to register with MFI in order to use bluetooth serial. Can college students do this as a once off basis for one app? Is it worthwhile or expensive?
Any help'd be great!

You have to choose the bluetooth device first and know about its category i.e BLE or Classic. For BLE you can use Corebluetooth and for Classic one you have to use MFI. Yes MFI will be paid and expensive too. Refer to developer site for this and also this question.
iPhone bluetooth and "Made for iPod"
https://mfi.apple.com/MFiWeb/enroll.action.
Hope this helps.

Related

how to make iOS app connecting with bluetooth?

how to make iOS app with bluetooth?
I need an app which connects and exchange data via bluetooth with other devices, laptop for example.
Many packages for BLE and cant find for classic bluetooth
If you want to use the classic Bluetooth interface of an Apple iOS device, you have to comply with/accept Apple's MFi licensing programme (Made for iPhone/iPod/iPad), which is a major hurdle and the reason for the lack of corresponding libraries.
Short answer: you don't want classic Bluetooth for this. You want BLE. It supports everything you want for this kind of use case. See Core Bluetooth.
Much too long answer about classic Bluetooth and iPhones from my years building earbuds:
Continuing from Risto's answer, even with MFi certification (which requires adding an extra chip to your device, not just licensing), you still don't get general access to the BR/EDR ("classic") interface. You only get access to iAP2, which is an SPP-like serial protocol, but is not SPP. If you're porting from Android, you probably are using SPP, and sorry, that's just not available. You're going to need to switch to BLE.
MFi certification is a useful if you build an audio device that also needs a non-audio control channel. It makes it easy to ensure that both the audio connection and control connection are connected to the same device. This is extremely difficult to do with BLE. But iAP2 isn't a particularly nice protocol, and has weird corner cases. You should not go through the cost and trouble of MFi just to get a SPP-like serial protocol.
On iPhones, access to BR/EDR non-audio profiles is limited to the proprietary iAP2 and GATT over BR/EDR (which is less useful than it sounds since most chips don't support it). Classic audio profiles are limited to what Apple's audio frameworks support, which is not very flexible.
If you make a Bluetooth audio device, have a little extra room on your board, enough margin to add a chip to your BOM, and your SoC supports it, MFi is definitely worth exploring. You can improve the pairing experience marginally and it makes it a bit easier to manage an extra control channel. Plus, you get to add that "Made for iPhone" logo to your packaging. For hearing aids (which I have less experience with), I expect that MFi is a must-have today. From my casual investigation, it looks like it adds some really nice capabilities.
For everyone else, you want BLE.

Can an iPhone be a BLE peripheral?

What I want to do is have my iPhone send advertising packets, just like a peripheral device would. Is this possible? Is there an app for that?
From the Core Bluetooth Programming Guide:
In this chapter, you learn how to use the Core Bluetooth framework to perform the most common types of Bluetooth low energy tasks from the peripheral side. The code-based examples that follow will assist you in developing your app to implement the peripheral role on your local device.
So: yes, it's possible.
There are probably apps that make your iPhone act like a peripheral, since the ability has been supported since iOS 6.0. But this is a site about programming, not app recommendations.

MFi , CoreBluetooth or External Accesory framework?

I am trying to build an iOS app which would communicate with another non-apple device via bluetooth. It would be a  Bluetooth Stereo Transmitter which uses the bluetooth A2DP-profile which is supported by apple :
http://support.apple.com/kb/HT3647?viewlocale=en_US&locale=en_US
I have read tons of articles and pages. I have many unanswered questions and hope to recieve some answers and write something that will help me and others in future work with iOS and bluetooth.
Evaluating the available bluetooth connection options
Here's a list with possible approaches and informations I found. Please feel free to answer/edit anything that is not correct.
Edited from http://www.pocketmagic.net/2012/07/bluetooth-and-ios-use-bluetooth-in-your-iphone-apps/ :
A) Enroll in the made for iPhone/iPod/iPad (MFi) program. Details on costs are not available, but this is not for the small development companies, barely selling a few licenses.indicate costs depending on project, and starting numbers somewhere at 10K USD. Not really an option IMO, as the costs involved and trouble getting certified are ridiculously high, for something so basic and simple such as building a Bluetooth application. I have found a Bluetooth stereo transmitter with bluetooth version 2.1 (Class II). I can not find if the device is MFi compliant.
Based on this article :
Existing bluetooth device and Apple MFI
Q1: How can I be sure or find out if the device is Mfi compliant?
Q2: If the device is Mfi compliant will I be able to pair it with the device in the settings option?
B) CoreBluetooth framework, currently usable only with Low Energy Bluetooth 4 devices. Since these are not largely spread this is not really an option. You won't be able to connect to standard headsets, keyboards, or other non-Bluetooth 4 devices.
Q3: Will I need to pair the non-apple bluetooth device with my iPad (in settings) to use the CoreBluetooth framework?
I am asking beacuse I have no experience with iOS and bluetooth and beacuse my budget is low, so I dont want to waste money buying stuff I will not be able to use for development.
C) GameKit framework, this allows some basic Bluetooth functionality, such as finding nearby devices and establishing a serial communication link, but it only intended for use between iOS devices. So Android plus iPhone via GameKit is a no go.
D) Private APIs. There is a BluetoothManager framework, in the private APIs, inside the SDK. This can be used to achieve the proposed task, but you won't get your App approved on Appstore, as private API's is not allowed by Apple. Since this is so convenient, and working so nice, almost like the real thing Apple didn't want to include.
Q4: Can I use private APIs within the iOS Eneteprise program and distribute my apps since there is no App store approval process?
Q5: Does anyone know some more private APIs I could use beside bluetoothManager framework?
E)Jailbreaking and using Ringwald's BTStack. Jailbreaking = rooting = freedom, probably the best way to go . But this places you so far away from Apple's guidelines, and the Appstore itself. So better decide what your project is all about, and who your users will be.
Q6: For bluetooth I need CoreBluetooth Framework. What framework do I need to import if I want to use wifi communication?
Thanks for any help :).

how to programming serial port of ios without jail break

As the title says
i've searched for this on Google for about a week.
lots of instruction and articles about programming serial port of iOS.
but all of them have one precondition:
your iOS has to be jail broken first!
Actually i want to develop a app enabled audio peripheral which connected to iDevice(iPhone, iTouch,iPad) by the serial port and ship it by the App Store, where the user can download the App there! At this scenario, i can't tell my user to jailbreak their iPhone in order to use my App.May be lots of them don't even know what jailbreak is.
Help me!
Thanks
David zhu
You will need to join the Apple MFI program in order to obtain this level of access to the iPhone/iPad hardware. Alternatively, investigate the use of Bluetooth Low Energy - this does not require MFI program membership

iOS PKPKT BLE concept

I understand that the iOS App "PKPKT" is using BLE (Bluetooth Low Enery). But what I am curious about it is, is it purely using BLE only? Or does it switching between BLE and Classic Bluetooth?
I tested with a iPhone 5 and a iPhone 5s with both installed the app. I turned on bluetooth on both devices. And then i checked the "DEVICES" list to see if the other iPhone is paired with one another, I found that they are not. Until i launched the PKPKT on one of the device, and the i check the "DEVICE" list again, now they are paired and connected. So, i'm thinking is this pairing done by the BLE pairing? Meaning one of "Just works", "Out of Band", or "Passkey entry" methods.
There is also a "Chat" functionality in that app. This make me curious if the chatting function using BLE or Classic Bluetooth?
So my question is actually "Is switching between BLE and Classic bluetooth possible?". This is part of the study on this BLE technology. Hopefully someone could help me and other newbie on this new technology.
Thanks in advance!
I wrote PKPKT. I only use BLE. No classic. iBeacon is cool but doesn't have the background scanning needed to discover other players. I use game center, but only for scores, no sessions. It's optional in the app to enable game center (those banners can be distracting!)
The chat is also over BLE.
Because the connections are not encrypted, you don't need to manually pair the devices, and "just works"
I think you might find this link helpful. It implements something that looks to be a simpler version of PKPKT. I believe the app uses a combination of GameKit/iBeacon. The app requires iOS7.0+ and states, "PKPKT does the hard work of finding other players by detecting them using Bluetooth Low Energy (BLE) in the background." iBeacon would be the most battery-efficient way of accomplishing this and is a new feature in iOS 7. There is a wealth of information online(particularly on SO) about peer to peer bluetooth gaming using GameKit, if you are interested.
We can't say for sure unless the developer lets us know. If one were to attempt to recreate the application, GameKit and iBeacon would be the technologies that I believe most would recommend.
You might find this project helpful as an overview of how to use Bluetooth LE to communicate between two devices. You don't need to pair the devices, and unlike iBeacons, it works when the app is in the background.
SimpleShare - Easy Proximity-based Sharing for iOS
You can use the delegate methods of the SimpleShare project to easily share arrays of strings between nearby users running your app, such as user IDs, which you could then use to get more info, photos, etc, about that user from a web service.

Resources