Ignore case when comparing Bluetooth UUIDs.

This commit is contained in:
akwizgran
2011-10-28 12:54:20 +01:00
parent df125bdcd2
commit 0728f76933
3 changed files with 2 additions and 7 deletions

View File

@@ -233,8 +233,6 @@ class BluetoothPlugin extends AbstractPlugin implements StreamPlugin {
String address = p.get("address");
String uuid = p.get("uuid");
if(address != null && uuid != null) {
if(LOG.isLoggable(Level.FINE))
LOG.fine("Searching for " + uuid + " at " + address);
addresses.put(address, c);
uuids.put(c, uuid);
}

View File

@@ -81,8 +81,7 @@ class ContactListener implements DiscoveryListener {
for(ServiceRecord record : services) {
// Do we recognise the address?
RemoteDevice device = record.getHostDevice();
String address = device.getBluetoothAddress();
ContactId c = addresses.get(address);
ContactId c = addresses.get(device.getBluetoothAddress());
if(c == null) continue;
// Do we have a UUID for this contact?
String uuid = uuids.get(c);
@@ -101,8 +100,6 @@ class ContactListener implements DiscoveryListener {
UUID serviceUuid = (UUID) classId.getValue();
if(uuid.equalsIgnoreCase(serviceUuid.toString())) {
// The UUID matches - store the URL
if(LOG.isLoggable(Level.FINE))
LOG.fine("Discovered " + uuid + " at " + address);
urls.put(c, serviceUrl);
}
}

View File

@@ -77,7 +77,7 @@ class InvitationListener implements DiscoveryListener {
(Enumeration<DataElement>) classIds.getValue();
for(DataElement classId : Collections.list(e)) {
UUID serviceUuid = (UUID) classId.getValue();
if(uuid.equals(serviceUuid.toString())) {
if(uuid.equalsIgnoreCase(serviceUuid.toString())) {
// The UUID matches - store the URL
synchronized(this) {
url = serviceUrl;