Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pair the device? #2

Open
OuIChien opened this issue May 24, 2014 · 20 comments
Open

How to pair the device? #2

OuIChien opened this issue May 24, 2014 · 20 comments

Comments

@OuIChien
Copy link

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!

@michaeldorner
Copy link
Owner

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...

@nickup
Copy link

nickup commented Feb 2, 2015

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];

@michaeldorner
Copy link
Owner

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

@patrickjglaser
Copy link

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

@michaeldorner
Copy link
Owner

Yes, in the way I did in my code:

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

@prashantg2
Copy link

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.

@michaeldorner
Copy link
Owner

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

@simgul-1
Copy link

simgul-1 commented Sep 2, 2015

Ok thanks!

On 02 Sep 2015, at 08:14, Michael Dorner [email protected] 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).

@vijayradke
Copy link

@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.

@santoshbotre
Copy link

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

@michaeldorner
Copy link
Owner

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.

@MattSich
Copy link

MattSich commented May 3, 2016

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

@mgreddy12345
Copy link

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.

@michaeldorner
Copy link
Owner

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

@mgreddy12345
Copy link

mgreddy12345 commented Sep 13, 2017 via email

@qasimsina
Copy link

qasimsina commented May 23, 2018

@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

@harshchitrla
Copy link

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

@michaeldorner
Copy link
Owner

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.

@harshchitrla
Copy link

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.

@michaeldorner
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests