diff options
author | Zakor Gyula <zakorgy@inf.u-szeged.hu> | 2017-02-09 17:32:01 +0100 |
---|---|---|
committer | Attila Dusnoki <dati91@users.noreply.github.com> | 2017-02-10 13:32:07 +0100 |
commit | fae2beeda0b125547fb105017f77166dcf497a9f (patch) | |
tree | e8800d669abe3b47abbc7aa195d23d7a4f6d8aad /components/script/dom | |
parent | 384391da680de3f73557dc721774326bbbf8ade7 (diff) | |
download | servo-fae2beeda0b125547fb105017f77166dcf497a9f.tar.gz servo-fae2beeda0b125547fb105017f77166dcf497a9f.zip |
Reorder startNotifications steps
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/bluetoothremotegattcharacteristic.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/components/script/dom/bluetoothremotegattcharacteristic.rs b/components/script/dom/bluetoothremotegattcharacteristic.rs index 7e72bb57a98..636b9dc96f4 100644 --- a/components/script/dom/bluetoothremotegattcharacteristic.rs +++ b/components/script/dom/bluetoothremotegattcharacteristic.rs @@ -209,22 +209,22 @@ impl BluetoothRemoteGATTCharacteristicMethods for BluetoothRemoteGATTCharacteris return p; } - // Step 4. + // Step 2. + if !self.Service().Device().Gatt().Connected() { + p.reject_error(p_cx, Network); + return p; + } + + // Step 5. if !(self.Properties().Notify() || self.Properties().Indicate()) { p.reject_error(p_cx, NotSupported); return p; } - // TODO: Step 5: Implement `active notification context set` for BluetoothRemoteGATTCharacteristic. - - // Step 6. - if !self.Service().Device().Gatt().Connected() { - p.reject_error(p_cx, Network); - return p; - } + // TODO: Step 6: Implement `active notification context set` for BluetoothRemoteGATTCharacteristic. - // Note: Steps 2 - 3, 7 - 11 are implemented in components/bluetooth/lib.rs in enable_notification function + // Note: Steps 3 - 4, 7 - 11 are implemented in components/bluetooth/lib.rs in enable_notification function // and in handle_response function. let sender = response_async(&p, self); self.get_bluetooth_thread().send( |