michaeldorner / BeeTee

Demo application for Bluetooth device scanning using the iOS private framework "BluetoothManager"

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to pair the device?

OuIChien opened this issue · comments

Hi Michael, Could you tell me how to pair the bluetooth device?
I run your demo on my ip4s(ios7.1), and I try to connect the device in method

  • (void)setBluetoothDevices:(BluetoothDevice *)device
    just like this:[device connect];
    But I got the log:
    2014-05-24 23:04:11.867 BeeTee[2360:60b] BTM: connection to service 0xffffffff on device "小米手机" AC:F7:F3:9B:D6:8D failed with error 109

Is connect equals pair?
I just want to read some data from my odb deveice.
Could you tell the way to do this?
Appreciate your work and Thank you!

Unfortunately I cannot work on this project at the moment. Until now I could not figure out how to perform a stable pairing with two devices. Hopefully I have some time over the summer...

commented

I found that we can connect device(with no PIN ) with code below,using service tag 0x00002000:
hope this would help you. : )

BluetoothManager *btManager =  [[self bluetoothScanner] bluetoothManager];
[btManager setDevicePairingEnabled:YES];
[btManager connectDevice:bluetoothDevice withServices:0x00002000];

This is awesome! Thank you for your contribution. I will try to integrate your finding.

Is there a similar way to make the iPhone discoverable and accept incoming pairing requests?

Yes, in the way I did in my code:

[[BluetoothManager sharedInstance] setDeviceScanningEnabled:YES];
[[BluetoothManager sharedInstance] scanForServices:0xFFFFFFFF];

Hi Michael,
Really great work, Thanks.

Could you please let me know , is it posible to do similar thing with Personal hotspot and WiFi.
I want to turn on and turn off iPhone personal hotspot programmatically.
I tried using private api but didn't find any luck.

Could you please help me in achieving this functionality.

I haven't spent too much time into WiFi, but I am quite sure this is possible. But not with my framework.

Ok thanks!

On 02 Sep 2015, at 08:14, Michael Dorner notifications@github.com wrote:

I haven't spent too much time into WiFi, but I am quite sure this is possible. But not with my framework.


Reply to this email directly or view it on GitHub #2 (comment).

@michaeldorner : I have used your code and able to discovered the devices. we are able to connect.pair with apple mac mini but when we try to connect with Android device and Another Apple device it shows below error log message.
BeeTee[366:30343] BTM: setting pairing enabled
BeeTee[366:30343] BTM: setting connectable enabled
BeeTee[366:30343] BTM: setting pincode '0000' for device "OnePlus2" C0:EE:FB:52:EC:B8
BeeTee[366:30343] BTM: connecting to device "OnePlus2" C0:EE:FB:52:EC:B8
BeeTee[366:30343] BTM: connection to service 0xffffffff on device "OnePlus2" C0:EE:FB:52:EC:B8 failed with error 109

If you have any idea about the above error then please let me know.
Thanks in advance for your help.

@michaeldorner Is there any way to know what these error codes are with respect to BluetoothManager APIs.

To be honest, I have no idea. :-) The main problem about the error codes and the services as well is: they are not typed, they are just int and hex numbers.

At least regarding the services: I am quite sure, that 0xffffffff is the wrong service (imho, just sounds so :) ). I have heard that services 0x00000010, 0x00000008, 0x00000020did work, but haven't tried it.

@nickup I tried using the 0x00002000 service but it asks me for a pin... have you found anything new?

HI michaeldorner.. I am facing problem to pair devices from long time. will you please provide updated BeeTee app with device pairing?. i will be waiting for your code please provide.

@mgreddy12345 Not in a near future. Unfortunately I do not have time for working on BeeTee. But Contributions are always welcome!

@nickup
Hi
I want pair and connect to Bluetooth, in your sample code:
[btManager connectDevice:bluetoothDevice withServices:0x00002000];
I don't understand your mean from bluetoothDevice?
with which property/object can paired/connect to Bluetooth device? address? name? productId? scoUID? vendorId?
please describe.
Thanks

Hi michael, Is it possible to Possible to pair a peripheral from an iOS App ?

Hi, sure it is possible, but I think what you actually want is CoreBluetooth, which is the Bluetooth 4.0 (LE) framework. BeeTee here is for low-level bluetooth and non-LE interactions.

Hi Michael, I would like to connect a Bluetooth classic device for which I have tried BeeTee.

Using it I was able to list the device. I would also like to connect the device. I thought after pairing the device only we can connect it. So, I have went through BluetoothManager.h file in BeeTee Application I have found a method to unpair device but no method to pair device. I would like to know if it is possible to pair a device using BeeTee.

I have tried by pairing the device from iPhone settings and tried to connect and disconnect the device from BeeTee application which I was able to do it. Now I'm just stuck in pairing the device from BeeTee application. Any help would be appreciated. Thanks.

Please let me know (also via PR) if you find a solution to this problem. I do not have deeper experiences regarding paring with BluetoothManager.