Using Multiple Devices fails
Brought to you by:
juliencamp,
moritzg
i got multiple usb bt devices.
i got different listener threads for each of them,
using AvetanaBTStack.setDeviceID(<nr>) to adress the
specific device, then normally opening a listening
connection.
If i then use the Benhui BT Browser midlet, i see the
services registered, but the service url is allways
the same as from the first device. also if i connect
to the server, it doesnt notice an incoming
connection, regardless of the device i choose.
it also doesnt notice incoming connections if i use
AvetanaBTStack.setDeviceID(0) and have only one device
plugged in.
Logged In: YES
user_id=628933
Hi there.
Arkturion, the current avetana bt stack does not permit
to have multiple instances of LocalDevice (see singleton
member localDevice in LocalDevice class).
This could be enabled if JSR-82 was extended, thus
allowing listing and selecting a device.
Anyway there is a bug in setDeviceId.
Avetana people, could you apply the following patch:
Thanks
-- Steve
diff -ru
avetana/sources/de/avetana/bluetooth/stack/AvetanaBTStack.java
avetana.new/sources/de/avetana/bluetooth/stack/AvetanaBTStack.java
---
avetana/sources/de/avetana/bluetooth/stack/AvetanaBTStack.java
2005-10-07 09:00:59.000000000 +0200
+++
avetana.new/sources/de/avetana/bluetooth/stack/AvetanaBTStack.java
2006-02-07 14:46:39.000000000 +0100
@@ -59,10 +59,11 @@
BlueZ.myFactory = new ConnectionFactory();
if(devID > -1) {
try {
- BlueZ.hciCloseDevice(devID);
+ BlueZ.hciCloseDevice(m_bd);
} catch(Exception ex) {}
}
- BlueZ.hciOpenDevice(dev, new BlueZ());
+ m_bd = BlueZ.hciOpenDevice(dev, new BlueZ());
+ this.devID = dev;
}
public String getRemoteName(String bd_addr) throws
Exception {