robertoprato / bluecove

Automatically exported from code.google.com/p/bluecove
0 stars 0 forks source link

Bluecove boot is not thread safe? #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
Start a service and inquiry at the same time using 2 different LocalDevice
objects

What is the expected output? What do you see instead?
double version output in the console or exceptions

What version of the product are you using? On what operating system?
snapshot foe 6 dec 2007

Please provide any additional information below.
Adding a Thread.sleep(xx) between both actions to avoid above results

Original issue reported on code.google.com by franci...@gmail.com on 7 Dec 2007 at 11:53

GoogleCodeExporter commented 8 years ago
In general more then one Device inquiry is not supported on any Bluetooth stack!

Any comments on what Exception you got?

Original comment by skarzhev...@gmail.com on 7 Dec 2007 at 4:42

GoogleCodeExporter commented 8 years ago
I'm doing an inquiry and while doing that i'm publishing services and that 
doesn't work

I get this in the console
BlueCove version 2.0.2-SNAPSHOT on winsock
BlueCove version 2.0.2-SNAPSHOT on winsock

on my other machine: 

BlueCove version 2.0.2-SNAPSHOT on widcomm
BlueCove version 2.0.2-SNAPSHOT on widcomm
Fri Dec 07 17:54:22 CET 2007 Searching for Bluetooth devices in the vicinity...
javax.bluetooth.BluetoothStateException: Bluetooth Device is not ready
    at com.intel.bluetooth.BluetoothStackWIDCOMM.runDeviceInquiryImpl (Native Method)
    at
com.intel.bluetooth.BluetoothStackWIDCOMM.runDeviceInquiry(BluetoothStackWIDCOMM
.java:204)
    at com.intel.bluetooth.DeviceInquiryThread.run(DeviceInquiryThread.java:80)
javax.bluetooth.BluetoothStateException : WIDCOMM error[WBT_ERROR]
    at
com.intel.bluetooth.BluetoothStackWIDCOMM.getLocalDeviceBluetoothAddress(Native 
Method)
    at javax.bluetooth.LocalDevice.<init>(LocalDevice.java:70)
    at javax.bluetooth.LocalDevice.getLocalDevice (LocalDevice.java:85)
    at com.vodtec.bluetoothserver.VodtecServer.start(VodtecServer.java:69)
    at
com.vodtec.bluetoothserver.VodtecServerGui.actionPerformed(VodtecServerGui.java:
85)
    at javax.swing.AbstractButton.fireActionPerformed (Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed (Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl (Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent (Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Fri Dec 07 17:55:22 CET 2007 Searching for Bluetooth devices in the vicinity...
javax.bluetooth.BluetoothStateException: Bluetooth Device is not ready
    at com.intel.bluetooth.BluetoothStackWIDCOMM.runDeviceInquiryImpl (Native Method)
    at
com.intel.bluetooth.BluetoothStackWIDCOMM.runDeviceInquiry(BluetoothStackWIDCOMM
.java:204)
    at com.intel.bluetooth.DeviceInquiryThread.run(DeviceInquiryThread.java:80)

Original comment by franci...@gmail.com on 7 Dec 2007 at 4:59

GoogleCodeExporter commented 8 years ago
Do you have this application available so I can test myself?
Anyway I fixed Singleton initialization.
Can you try a new build: 
bluecove-2.0.2-20071207.172813-54.jar   07-Dec-2007 12:28 

Also can you be so kind to test related problem:
1) When Bluetooth is disabled you should get exception
BluetoothStateException("BluetoothStack not detected")
2) DO not restart application. Enable device and start search again. It should 
work.

Original comment by skarzhev...@gmail.com on 7 Dec 2007 at 5:29

GoogleCodeExporter commented 8 years ago
startup seems to be fixed
and disabling/enabling bluetooth also works (switch on my laptop)
I get DiscoveryListener.INQUIRY_ERROR
and
DiscoveryListener.SERVICE_SEARCH_DEVICE_NOT_REACHABLE
but I suppose you would like a test with an external usb device...

on my other pc i'm getting this now:
BlueCove version 2.0.2-SNAPSHOT on widcomm
Fri Dec 07 19:04:25 CET 2007 Searching for Bluetooth devices in the vicinity...
javax.bluetooth.BluetoothStateException: Bluetooth Device is not ready
    at com.intel.bluetooth.BluetoothStackWIDCOMM.runDeviceInquiryImpl (Native Method)
    at
com.intel.bluetooth.BluetoothStackWIDCOMM.runDeviceInquiry(BluetoothStackWIDCOMM
.java:204)
    at com.intel.bluetooth.DeviceInquiryThread.run(DeviceInquiryThread.java:80)

I'm afraid I can't send you the code...

Original comment by franci...@gmail.com on 7 Dec 2007 at 6:10

GoogleCodeExporter commented 8 years ago

Original comment by skarzhev...@gmail.com on 7 Dec 2007 at 6:15