Skip to content

Commit

Permalink
update BLE test-client for new whitelist test
Browse files Browse the repository at this point in the history
  • Loading branch information
andycarle committed Nov 1, 2022
1 parent f0ae305 commit 968fe02
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion examples/network/ble/test-client/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,22 @@ class AdvertisementProperties extends Test {
}
}

class Whitelist extends Test {
startTest(device) {
device.discoverPrimaryService(HEART_RATE_SERVICE_UUID);
}
onServices(services) {
if (services?.[0]?.uuid?.equals(HEART_RATE_SERVICE_UUID))
services[0].discoverCharacteristic(uuid`2A38`);
}
onCharacteristics(characteristics) {
if (characteristics?.[0]?.uuid?.equals(uuid`2A38`)) {
this.char = characteristics[0];
this.char.writeWithoutResponse(Math.floor(Math.random() * 128) + 1);
}
}
}

export default [
ConnectDisconnectTest, //0
ReadGAP, //1
Expand All @@ -256,5 +272,6 @@ export default [
ReadDescriptor, //4
ReadStaticCharacteristic, //5
ReadDynamicCharacteristic, //6
AdvertisementProperties //7
AdvertisementProperties, //7
Whitelist //8
]

0 comments on commit 968fe02

Please sign in to comment.