fabiberlin / android-bluetooth

Automatically exported from code.google.com/p/android-bluetooth
0 stars 0 forks source link

pair() does not return #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'm using this api to connect to a KDC barcode scanner. Everything seems
pretty straight forward to use, however it seems to hang when I call pair().

1. I create my local device - ok
2. Initial a scan - ok
3. The listener reports seeing the KDC
4. When scan is complete, I pick the KDC from the devices
5. Check if it's paired already, return no.
6. call pair("0000"), this is the correct key for the KDC

My code is;

Log.i("BT", "Pairing ...");
kdc.pair("0000");
Log.i("BT", "Paired"); // *** THIS IS NEVER REACHED *** 

Any ideas?

I have been able to connect to a KDC using JSR-82 on a Nokia if that helps.

What version of the product are you using? On what operating system?

Please provide any additional information below.

I am using an HTC magic with a 1.6 version of android.

Original issue reported on code.google.com by dfasdfas...@gmail.com on 2 Nov 2009 at 2:34

GoogleCodeExporter commented 8 years ago
Actaully, it does not hang, I get an exception ...

11-02 18:20:40.601: INFO/BluetoothEventLoop.cpp(72): DiscoveryCompleted signal 
received
11-02 18:20:40.621: INFO/TTSActivity(14384): BT Scan done
11-02 18:20:40.621: INFO/TTSActivity(14384): BT get dev
11-02 18:20:40.621: INFO/TTSActivity(14384): BT dev name: KDC300[000158]
11-02 18:20:40.651: INFO/TTSActivity(14384): BT pair ...
11-02 18:20:40.751: ERROR/TTSActivity(14384): BT Exception:
java.lang.UnsupportedOperationException
11-02 18:20:40.751: ERROR/TTSActivity(14384): 
java.lang.UnsupportedOperationException
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
it.gerdavax.android.bluetooth.LocalBluetoothDevice$RemoteBluetoothDeviceImpl.pai
r(LocalBluetoothDevice.java:312)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
com.himoa.tts.TTSActivity.scanCompleted(TTSActivity.java:122)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
it.gerdavax.android.bluetooth.LocalBluetoothDevice$BluetoothBroadcastReceiver.pr
ocessDiscoveryCompleted(LocalBluetoothDevice.java:790)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
it.gerdavax.android.bluetooth.LocalBluetoothDevice$BluetoothBroadcastReceiver.on
Receive(LocalBluetoothDevice.java:689)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
android.app.ActivityThread$PackageInfo$ReceiverDispatcher$Args.run(ActivityThrea
d.java:705)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
android.os.Handler.handleCallback(Handler.java:587)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
android.os.Handler.dispatchMessage(Handler.java:92)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
android.os.Looper.loop(Looper.java:123)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
android.app.ActivityThread.main(ActivityThread.java:4203)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
java.lang.reflect.Method.invokeNative(Native Method)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
java.lang.reflect.Method.invoke(Method.java:521)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
11-02 18:20:40.751: ERROR/TTSActivity(14384):     at
dalvik.system.NativeStart.main(Native Method)

Can you offer any advise?

Original comment by dfasdfas...@gmail.com on 2 Nov 2009 at 6:25

GoogleCodeExporter commented 8 years ago
not supported pair(String) API. Only support pair() API.

Original comment by zyt...@gmail.com on 17 Nov 2009 at 8:50

GoogleCodeExporter commented 8 years ago
If you pair before running your code you may get around I couldn't get the 
BTSamples (GPS)to work without pairing manually first.

  I have an issue I need my App to work for 1.6 and I'm using the 0.03b library no matter what I do I can scan fine for the BT devices next to me but I cannot connect I call opensocket as per the samples but nothing happens not error thrown or anything, I want to connect SPP(i have the proper UUID) to a device and/or to a PC emulating the device which I can connect to from a WinMo or a BB but not from the Android.. any pointers????

Original comment by becker...@gmail.com on 17 Jul 2010 at 12:24