Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Transmitting data with CoreBluetooth

I'm developing an iOS app with an accompanying Bluetooth LE peripheral. The one step I don't seem to be able to solve is how to actually transmit the data from my app to the peripheral or vice versa.

What I've built so far is a test app that can connect to my sample Bluetooth peripheral, and read all of its services/characteristics/descriptors. It can toggle notifications for a given characteristic, and write to given characteristics. It is just this last step of "transmit n bytes to the peripheral, and receive m bytes from the peripheral" that I can't seem to figure out.

Looking at the External Accessory Framework (what I would use if Apple would actually give me MFi approval for this project), they give you input and output streams on a given session to communicate with the accessory, but no such object exists for CoreBluetooth.

Is this simply an oversight on Apple's part on the functionality of CoreBluetooth? Or do I simply need to develop my own Bluetooth service profile to handle the inflow/outflow of data to and from the peripheral?

like image 621
Dan F Avatar asked Sep 07 '12 18:09

Dan F


People also ask

How do I transfer data over BLE?

Set the BLE hardware of your device to either peripheral or central mode. In the Peripheral (Server) mode, you must specify the Service and Characteristic of your device. Other devices then receive the data sent from your Android mobile device with the same service and characteristic.

What is Bluetooth used for?

Bluetooth technology allows devices to communicate with each other without cables or wires. Bluetooth relies on short-range radio frequency, and any device that incorporates the technology can communicate as long as it is within the required distance.

What is Br EDR in Bluetooth?

The Bluetooth Classic radio, also referred to as Bluetooth Basic Rate/Enhanced Data Rate (BR/EDR), is a low power radio that streams data over 79 channels in the 2.4GHz unlicensed industrial, scientific, and medical (ISM) frequency band.

Does iPad support Bluetooth low energy?

Bluetooth Low Energy is supported on the following iPads: iPad 4th Generation and newer. iPad Mini 2 and newer. iPad Air 2 and newer.


1 Answers

LE is fundamentally designed to work with these GATT based profiles, which are suited for monitoring sensors, not for data streams. While LE does allow for additional L2CAP streams to be opened for custom protocols, Apple's CoreBluetooth doesn't provide access to do so.

like image 167
TJD Avatar answered Oct 24 '22 17:10

TJD