I'm working on an idea which requires my Mac to send some data to my iOS device. I know CoreBluetooth framework is not there for Mac OS and only for iOS, so is there any way that I can get my Mac to pose a peripheral ?
I've done some Googling around - haven't got a straight answer :(
The CoreBluetooth.Framework is there for OSX. It's embedded inside of the IOBluetooth.framework. Download the sample mac apps from the Apple Dev Site. The one difference is that the OSX version of the CoreBluetooth.Framework does not contain the CBPeripheralManager class. You should just have your iOS device act as the peripheral and the Mac as the central. The iOS device can act as both at the same time and data can be sent both ways.
If you are comfortable with writing JavaScript, you can use bleno. It is a node.js module for implementing BLE (Bluetooth Low Energy) peripherals, and it support Mac OS X 10.9 or later, Linux and Windows.
You can find an example for implementing a Battery Service in peripheral mode in their github repository:
https://github.com/sandeepmistry/bleno/tree/master/examples/battery-service
Related
I want to transfer video files from macOS to iOS devices. My objective here is to create a connection between a Mac running OS to a device running iOS, via bluetooth. I know that I might be able to use CoreBluetooth for this but I don't understand how since I don't see a method to setup a service on the MacOS device and broadcast...
Any solution for that?
I have turned my mac book pro into iBeacon using the project https://github.com/mttrb/BeaconOSX but unable to list the Mac device in iPhone using PheripheralManager / CBCentralManager after scan.
Could you please help me understand why the Mac Book is not listed?
Edit: I am using MacBook Pro with 10.9.1 Mac OS, my bluetooth version listed under system preference is LMP Version is 0x6
Thanks.
I would try known working programs on both the iOS and OSX Mavericks sides. On the iOS side, try our free Locate for iBeacon app as #sage444 suggests. If that does not detect your transmitter, try our MacBeacon app. It is $10, but we guarantee it will work with a BLE capable Mavericks computer or we will give you a refund.
One final thought, make sure you have the proper ProximityUUID from the BeaconOSX program in your region in your iOS program, or you will not see the beacon.
I think you should run Mavericks and have fresh mac book with BLE support, then get proper app to iPhone - search in app store for iBeacon
I have created universal device application to transfer any kind of files via bluetooth using GameKit Framework.
My question is how to create on Desktop Application with same process or there any Framework? That can communicate also on the device. Can i have any sample please or tips how to do it.
There is Core Bluetooth that used low energy protocol. But i don't know how?
Anyone please give some idea or anything that i can use it.
Thank you
The Bluetooth functionality of the GameKit framework is iOS-only (see GKSession), so you won’t be able to use that on a Mac.
The CoreBluetooth framework on the other hand is available on both Mac and iOS devices supporting Bluetooth LE, with the one difference that the CBPeripheralManager is not available on Mac, so you can’t advertise a service on Mac. However you can have your iOS device act as a peripheral and connect from the Mac acting as a central. Data transfer should still work both ways.
The BTLE Central Peripheral Transfer sample code should be a good starting point.
When I connect an iPhone to a mac computer, what are the limitations on what I can send over bluetooth?
My goal is to freely transmit data one-way from the iPhone to the OSX machine via the bluetooth. Is there a way to wrap your own communication class so that it sends any kind of data it wants? What are the limitations?
Can I send any data I please to the mac OS ?
Have you looked at using Bluetooth low energy ver 4.0 (CoreBluetooth Framework) ? Depending on your application it could be the best for you. Its supported on all latest iOS and Mac devices.
If you wan to use the Classic Bluetooth (Ver 3.0, 2.1 or 1.2)
Unfortunately currently is is not directly (easily) possible using Classic Bluetooth.
To do it ideally you would have needed the SPP profile (Serial Port Profile) but the iOS currently does not support SPP.
The iPhone can talk to the Mac (or any other device) using only the standard profiles it supports, and there is no direct access for your application to tap into standard profile data on the iOS device.
My objective here is to create a connection between a device running iOS to a device running Mac OS X, via bluetooth. I know that I might be able to use CoreBluetooth for this but I don't understand how since I don't see a method to setup a service on the iOS device and broadcast it as an available service for a device running Mac OS X. In other words, I simply want to setup a connection to get the iOS device to send data to the Mac OS X device. Also, how would I go about to specify how to setup properties of the service. I've tried researching this stuff but most of the documentation makes little sense to me. The data transfer is small so bluetooth is good enough for the job. I'm trying to avoid Bonjour for this, and the Game center framework for P2P since OS X can't handle that (I think).
In iOS6 the iPhone 4S, 5 and New iPad can work both as Peripheral and as Central in Bluetooth Smart / Low Energy mode.
Try downloading "LightBlue" APP from APP Store. It let's you put the iPhone4S or 5 into Peripheral mode with random Services which you can then read from the Mac (if you have a newer one with BT Low Energy, I use the Retina for that but also the new iMac and Mac Mini got BT Low Energy).
You are correct that Core Bluetooth only give access to Bluetooth Low Energy which doesn't allow for the MFI chip.
Just ran across this today... and just wanted to give another answer to anyone needing to communicate to a non-Bluetooth LE device from your Mac.
The way to go is with IOBluetooth, and IOBluetoothUI.
They are both frameworks for the Mac, and they allow you to communicate with both old bluetooth, and Bluetooth LE 4.0, I believe. Also, I'm pretty positive you can act as a Central and Peripheral Device using this framework.