mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-21 15:19:53 +01:00
Use the same method as Android for calculating Bluetooth UUIDs.
This commit is contained in:
@@ -19,7 +19,7 @@ public class BluetoothClientTest extends DuplexClientTest {
|
|||||||
// Store the server's Bluetooth address and UUID
|
// Store the server's Bluetooth address and UUID
|
||||||
TransportProperties p = new TransportProperties();
|
TransportProperties p = new TransportProperties();
|
||||||
p.put("address", serverAddress);
|
p.put("address", serverAddress);
|
||||||
p.put("uuid", BluetoothTest.UUID);
|
p.put("uuid", BluetoothTest.getUuid());
|
||||||
Map<ContactId, TransportProperties> remote =
|
Map<ContactId, TransportProperties> remote =
|
||||||
Collections.singletonMap(contactId, p);
|
Collections.singletonMap(contactId, p);
|
||||||
// Create the plugin
|
// Create the plugin
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ public class BluetoothServerTest extends DuplexServerTest {
|
|||||||
private BluetoothServerTest(Executor executor) {
|
private BluetoothServerTest(Executor executor) {
|
||||||
// Store the UUID
|
// Store the UUID
|
||||||
TransportProperties local = new TransportProperties();
|
TransportProperties local = new TransportProperties();
|
||||||
local.put("uuid", BluetoothTest.UUID);
|
local.put("uuid", BluetoothTest.getUuid());
|
||||||
// Create the plugin
|
// Create the plugin
|
||||||
callback = new ServerCallback(new TransportConfig(), local,
|
callback = new ServerCallback(new TransportConfig(), local,
|
||||||
Collections.singletonMap(contactId, new TransportProperties()));
|
Collections.singletonMap(contactId, new TransportProperties()));
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
package net.sf.briar.plugins.bluetooth;
|
package net.sf.briar.plugins.bluetooth;
|
||||||
|
|
||||||
interface BluetoothTest {
|
import java.util.UUID;
|
||||||
|
|
||||||
static final String UUID = "CABBA6E5CABBA6E5CABBA6E5CABBA6E5";
|
class BluetoothTest {
|
||||||
|
|
||||||
|
private static final String EMPTY_UUID =
|
||||||
|
UUID.nameUUIDFromBytes(new byte[0]).toString().replaceAll("-", "");
|
||||||
|
|
||||||
|
static String getUuid() {
|
||||||
|
return EMPTY_UUID;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user