I want to catch commands from bluetooth peripheral in iOS.
Could anyone help me out?
There are a few ways of doing Bluetooth on iOS, and different ones have different methods:
An accessory that's part of the Made for iPhone program (see the answer to this question if you want to know what that entails)
A device that uses Bluetooth 4.0 Low Energy mode
Talking to another iPhone with GameKit
A device using one of the Bluetooth profiles Apple support natively: Hands-free profile, headset profile, A2DP, AVRCP, etc.
To answer those in order:
If you're part of the Made for iPhone program, you'll already know where to find this information, and it's not public: ask your contact at Apple for help.
If your device uses Bluetooth 4.0 Low Energy, look into the Core Bluetooth framework.
If you're trying to get two iPhones talking together, look into GameKit.
If you're working with a device that uses an Apple provided profile, you shouldn't have to do anything, it'll just work. For example, an A2DP device will stream audio played from the phone without needing programmer intervention. You can do a few things to control it: there's a Core Audio function somewhere that lets you choose whether to send audio to a Bluetooth device. If you're trying to support AVRCP, look into handling remote control events.
If your device doesn't fall into any of the above categories, you're probably out of luck and can't use it with iOS.
Related
From macOS, I'd like to detect the presence/proximity of already paired (via iCloud) Bluetooth LE devices such as a user's iPhone or Apple Watch. Is there a way to do this without running a custom-built app on the user's iPhone/Watch?
I can easily get a list of devices using CoreBluetooth, and seemingly also get RSSI signal strength from this device list, but I don't see a way to correlate the random UUID with a known device, as described in this question.
I've looked at some possible solutions including turning an iPhone into an iBeacon and the MultipeerConnectivity framework, but it looks like both of these require an app to be running on all devices (Mac, iPhone, and Watch). An example app that does not appear to require an app running on the iPhone/Watch is here.
Please note that I am working within a sandboxed environment. Thank you in advance for any suggestions.
I'm quite new to Objective-C programming and I have a problem with my app.
It connects to a device (an electronic board) through a Bluetooth Low Energy interface. My iPad is acting as a Central Manager, and the device it gets the data from acts as a Peripheral.
I use the CoreBluetooth framework.
It connects perfectly when I run the app on my iPad (iOS 7.02), but on any other device it hardly ever succeeds. I tried it in four other devices, all of them with the same iOS (7.02) and they hardly ever connect successfully to the electronic board (they managed to connect in a couple of chances).
I'm lost and don't know where to open a path to find the solution to that problem.
I don't know which other information could be useful to solve that problem.
Well there is the obvious, but worth mentioning. You bluetooth is on and you've scanned and picked up the Smart Device with your Smart Ready device. Given a yes to all of the above it just won't connect?
Have you ensured that it's not auto connecting to one of your other devices that you've previously connected with? Unless you've made some extraneous adjustments to your smart device's firmware it will only connect to one device at a time.
I've been starting to read about the above and on BLE devices in general and trying to find the differences between those 2 frameworks. Is there something that the iBeacon API offers beside the option to use startMonitoringForRegion with CLBeaconRegion (which will basically "wake up" or notify the app that you're in range)?
To my understanding on iPhone 4S and up I can get a list of BLE devices and check their signal strength on iOS 6 sure, i't will not be as simple as the API for ranging but still, am I missing something?
Thanks
Yes, the CoreLocation APIs allow you to see iBeacon devices where CoreBluetooth does not. See my in depth discussion of this here: http://developer.radiusnetworks.com/2013/10/21/corebluetooth-doesnt-let-you-see-ibeacons.html
This may not matter if you want to roll your own Bluetooth LE devices that are fully visible by CoreBluetooth. But such devices are somewhat more complex and more power-hungry. iBeacons by contrast are transmit only and send a minimal amount of data.
The bottom line is that if you want your app to see standard iBeacons, CoreBluetooth simply will not do the job.
I'm building a small controller device that I'd like to partner with a computer. I've settled on using OSC out from my custom built hardware and am pretty satisfied with what I can get from WOscLib. Two goals I'd like to achieve are portability and a very nice ratio between battery:computing power, and this has lured me towards using iPhoneOS to accomplish my goals.
I think the iPad would suit my needs perfectly, except that using wifi to broadcast OSC out from my device requires that device to be connected to a third device with a wifi chip, and this would destroy the goal of portability, whilst also introducing potential latency and stability headaches. My question is pretty simple: Can I push OSC commands FROM my controller TO an iPad via USB and the Camera Connection Kit? If I could accomplish this, the two major goals of my project would be fulfilled very nicely.
This seems like it should be a simple little question, but researching this obsessively over the past few weeks has left me more almost more uncertain than if I had done no research at all. I'd really like some more confidence before I go down this route, and it seems like it should be possible. Any insight would be very, very appreciated.
The simple answer is that you can't :-(
In order to interface your custom hw you'll have to
obtain a license from apple.
no third device is required. you can click "create network" on your wifi menu in osx and then you ipad can connect directly to that. many apps now use osc over wifi on the ipad. some are done in java. im not sure about objective c.
You could connect a USB ethernet device to the iPad Camera Connection Kit and send OSC over ethernet from your custom controller.
Somewhere along the line since this question was asked, USB ethernet devices became officially supported over the CCK.
I am trying to develop an application using bluetooth in my Mac mini. However, after searching all over net, all that I could find was the "Bluetooth Device Access Guide" from Apple, and not a single sample program!
Can anyone suggest of any sample code for this available ?
what I am trying to do in my program:
I want to pair my iPhone with my Mac programmatically over the PAN profile, and then send data (streams) both ways. I paired them manually, and I was successfully able to transfer data. I just want to do that programmatically!
[In 2016] I suspect you want CoreBluetooth
The Core Bluetooth framework provides the classes needed for your iOS and Mac apps to communicate with devices that are equipped with Bluetooth low energy wireless technology
You can do things like discover paired devices around you, read and write, and it documents best practices!