diff options
author | Attila Dusnoki <dati91@gmail.com> | 2016-11-14 17:51:41 +0100 |
---|---|---|
committer | Keith Yeung <kungfukeith11@gmail.com> | 2016-11-23 01:24:33 -0800 |
commit | fd7cdbf19fd4ad6ddb173d4b4061c3098ef29520 (patch) | |
tree | d1e962d51dfb16a5826cf9c9c353d31d3e3c2b8b /components/bluetooth/test.rs | |
parent | a89ba50180532bc652db7ff649f252ffdca33177 (diff) | |
download | servo-fd7cdbf19fd4ad6ddb173d4b4061c3098ef29520.tar.gz servo-fd7cdbf19fd4ad6ddb173d4b4061c3098ef29520.zip |
Add Start/Stop notifications
Diffstat (limited to 'components/bluetooth/test.rs')
-rw-r--r-- | components/bluetooth/test.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/components/bluetooth/test.rs b/components/bluetooth/test.rs index ee84fcc976a..fa61c99d22b 100644 --- a/components/bluetooth/test.rs +++ b/components/bluetooth/test.rs @@ -18,6 +18,7 @@ const ADAPTER_ERROR: &'static str = "No adapter found"; const WRONG_DATA_SET_ERROR: &'static str = "Wrong data set name was provided"; const READ_FLAG: &'static str = "read"; const WRITE_FLAG: &'static str = "write"; +const NOTIFY_FLAG: &'static str = "notify"; // Adapter names // https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=65 @@ -217,10 +218,11 @@ fn create_heart_rate_service(device: &BluetoothDevice, } // Heart Rate Measurement Characteristic - let _heart_rate_measurement_characteristic = + let heart_rate_measurement_characteristic = try!(create_characteristic_with_value(&heart_rate_service, HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID.to_owned(), vec![0])); + try!(heart_rate_measurement_characteristic.set_flags(vec![NOTIFY_FLAG.to_string()])); // Body Sensor Location Characteristic 1 let body_sensor_location_characteristic_1 = @@ -357,10 +359,11 @@ fn create_two_heart_rate_services_device(adapter: &BluetoothAdapter) -> Result<( let heart_rate_service_empty_2 = try!(create_heart_rate_service(&heart_rate_device_empty, true)); - let _heart_rate_measurement_characteristic = + let heart_rate_measurement_characteristic = try!(create_characteristic_with_value(&heart_rate_service_empty_1, HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID.to_owned(), vec![0])); + try!(heart_rate_measurement_characteristic.set_flags(vec![NOTIFY_FLAG.to_string()])); let _body_sensor_location_characteristic_1 = try!(create_characteristic_with_value(&heart_rate_service_empty_1, |