Can an iPhone be a BLE peripheral? - ios

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.

Related

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 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.

Bluetooth serial connection for Iphone app

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.

Is it possible to implement this bluetooth feature in iOS

I am considering implementing in an app the bluetooth feature to read and display the battery life of a connected bluetooth peripheral (i.e. keyboard, headset...)
Is there an API or objects that can implement this in the iOS SDK or can someone tell me how this can be done, if it can be done ?
Yes, but more than likely you will need to be a member of the Made for iOS program. You can connect to a device that is Bluetooth Low Energy without being part of the MFi program but it only available for peripherals that support and the iOS device must be the iPhone 4S or the new iPad. Also reference this stackoverflow question.

Using custom/existing bluetooth HID with iOS Devices?

I am working on building or using an existing bluetooth HID device (something like this http://www.icontrolpad.com) and to get my iOS device to read the data coming from it. So i have some questions regarding this:-
Is it possible at all to do this, considering that the Bluetooth stack is not available on non jail broken devices.
Do i need to register with apples Mfi program? If i don't need to, what are the alternatives?
If i do register with Apple's Mfi program will i get access frameworks that will allow me to read data off the Bluetooth stack.
Considering that there will be a custom application sitting on the iOS device that needs to communicate with the HW im building, what are the implications w.r.t the approval of the app from Apple's side?
Thanks in advance, any help is greatly appreciated!
Core Bluetooth framework is available for Bluetooth Low Energy devices on iOS 5, no MFi membership is required.
With Made for iPhone, you basically get a serial pipe to your device using the ExternalAccesory Framework (in fact, it IS using the serial port profile plus some authentication). So you while you cannot use an actual HID device, you could send your data over.

Resources