Connect devices using the private iOS BluetoothManager infrastructure

I worked with the private BluetoothManager infrastructure in iOS 5.0, and I was able to successfully start / stop Bluetooth and get a list of devices, however I cannot figure out how to initiate pairing.

Closest I came to try to connect using:

[[BluetoothManager sharedInstance] connectDevice:dev]; 

where dev is the BluetoothDevice object detected during the scan.

It seems that you are trying to connect (when I try to connect to my iMac, the pairing dialog appears for a second), but then quickly fails.

I noticed that BluetoothManager.h includes a BTPairingAgentImpl structure that can help, but I have no idea what this structure includes or how to use it.

Any help would be greatly appreciated.

+4
source share
1 answer

The correct way to do this is to get the BluetoothDevice object (see BluetoothDevice.h) and use its methods: pairing, connection, etc.

0
source

Source: https://habr.com/ru/post/1385429/


All Articles