Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use bluetooth classic instead of le

Tags:

In reference to Dennis Mathews answer how do you specify bluetooth classic instead of LE on iOS? Is there a different api from Core Bluetooth Framework?

like image 887
joels Avatar asked Aug 13 '13 16:08

joels


People also ask

Can Bluetooth Classic connect to BLE?

No a BLE can not discover a classic bluetooth device nor a classic bluetooth device can discover a BLE.

What is the difference between BLE and Bluetooth Classic?

Similar to Bluetooth, Bluetooth LE operates in the 2.4 GHz band. The hidden difference is that Bluetooth Low Energy remains in sleep mode unless a connection initiates. The actual connection times only last a few milliseconds, unlike Bluetooth, which connects for a few seconds or a few hours at a time.

Is Bluetooth 5.0 the same as Bluetooth LE?

While both BLE5 and BLE4 are part of the Bluetooth Low Energy ecosystem, BLE5 has been designed to consume less power than its predecessor. So Bluetooth 5 devices can be left running for longer periods, without putting too much stress on their batteries.


2 Answers

Joels there is a very clear way to use Bluetooth classic on iOS. It is with the External Accessory framework (it also includes direct hardware connections in addition to Bluetooth classic however).

You need to add the ExternalAccessory.framework and specify "App communicates with an accessory" in the required background modes inside your plist to get started. It should be noted however that with Bluetooth classic, the user must add your Bluetooth device from the System Bluetooth settings. It is only with Bluetooth LE that we are able to add devices from the app side.

Check out the docs on the External Accessory Framework

In response to your question regarding the MFi program, this should clarify:

I want to develop an iOS app that communicates with an MFi accessory. Do I need to join the MFi Program? No. iOS app developers do not need to join the MFi Program. Everything app developers need is in the External Accessory Framework, which is provided in the iOS SDK. To access the iOS SDK, please join the iOS Developer Program: https://developer.apple.com/programs/ios/.

If you'd like to learn more, consult the MFi FAQ

like image 147
Tommy Devoy Avatar answered Sep 17 '22 12:09

Tommy Devoy


If your external accessory doesn't need high bandwidth in the connection to iOS, and you wish to use (or must use) 2.x/classic BT, (instead of 4.x/LE/Smart, which is very low bandwidth but requires no MFi dancing) you may be able to communicate by emulating a BT HID keyboard in your accessory.

It's hardly optimal, especially since the HID reverse channel is pretty limited (I think to things like lighting the caps lock key in the basic keyboard configuration (HID page 7 mapping, if I recall correctly.) OTOH, if your primary task is to push data to the iOS device, sending the data as keystrokes would not be too awful. (and might even be seen as virtue during testing :)

HID devices can declare additional capabilities in table defined keymaps, but I'm not sure if an iOS app can get at those alternate mappings with sanctioned APIs.

like image 34
Taryn Avatar answered Sep 18 '22 12:09

Taryn