I need to implement a self bluetooth app to connect with all bluetooth devices to iPhone. I know it is not possible with CoreBluetooth framework.

I use private API and added header files of DeviceManager and BluetoothManager to private frameworks and downloaded BeeTee Project from here

This app runs and finds all bluetooth device near me but when I have tried to connect to a device by this code:

[self.bluetoothManager connectDevice:bluetoothDevice];

and this

[bluetoothDevice connect];

When a cell is selected, Both of above codes request to connect but BTM returns this message:

BeeTee[5473:60b] BTM: connection to service 0xffffffff on device "Nokia 500" F4:xx:xx:xx:xx:xx failed with error 109

What is error 109? Which would be set service number?

I guess I should pair devices before connecting but how can I do that?

有帮助吗?

解决方案

I am just guessing, but I think the problem is that the BluetoothManager.framework is made for the External Accessory Program by Apple. And this allows (among others) SPP Bluetooth connection to certificated devices. But there is the problem: you need to have a device with a authentication chip inside.

I don't know on which level/layer Apple implemented the authentication, but I fear the did it one layer under the private framework BeeTee is using.

UPDATE: Maybe this is helpful for you:

BluetoothManager *bluetoothManager = //...
[bluetoothManager setDevicePairingEnabled:YES];
[bluetoothManager connectDevice:bluetoothDevice withServices:0x00002000];

Credits

其他提示

BluetoothManager *bluetoothManager = //...
[bluetoothManager setDevicePairingEnabled:YES];
[btManager setPincode:@"111111" forDevice:bluetoothDevice.deviceRef];
//where 111111 is your device PIN
[bluetoothManager connectDevice:bluetoothDevice withServices:0x00002000];
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top