mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace AdvertisingData with AdvertisingEvent
This commit is contained in:
parent
a2391162a1
commit
748b78a6bf
12 changed files with 237 additions and 99 deletions
|
@ -278,6 +278,9 @@ impl BluetoothManager {
|
|||
BluetoothRequest::EnableNotification(id, enable, sender) => {
|
||||
self.enable_notification(id, enable, sender)
|
||||
},
|
||||
BluetoothRequest::WatchAdvertisements(id, sender) => {
|
||||
self.watch_advertisements(id, sender)
|
||||
},
|
||||
BluetoothRequest::Test(data_set_name, sender) => {
|
||||
self.test(data_set_name, sender)
|
||||
}
|
||||
|
@ -613,9 +616,6 @@ impl BluetoothManager {
|
|||
let message = BluetoothDeviceMsg {
|
||||
id: device_id,
|
||||
name: device.get_name().ok(),
|
||||
appearance: device.get_appearance().ok(),
|
||||
tx_power: device.get_tx_power().ok().map(|p| p as i8),
|
||||
rssi: device.get_rssi().ok().map(|p| p as i8),
|
||||
};
|
||||
return drop(sender.send(Ok(BluetoothResponse::RequestDevice(message))));
|
||||
}
|
||||
|
@ -1094,4 +1094,11 @@ impl BluetoothManager {
|
|||
None => return drop(sender.send(Err(BluetoothError::InvalidState))),
|
||||
}
|
||||
}
|
||||
|
||||
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothdevice-watchadvertisements
|
||||
fn watch_advertisements(&mut self, _device_id: String, sender: IpcSender<BluetoothResponseResult>) {
|
||||
// Step 2.
|
||||
// TODO: Implement this when supported in lower level
|
||||
return drop(sender.send(Err(BluetoothError::NotSupported)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue