browser_commander/puppeteer/api/
bluetooth_emulation.rs1#![allow(clippy::all, missing_docs, unused_imports, non_snake_case)]
5
6use serde_json::Value;
7
8use super::*;
9use crate::puppeteer::bridge::{binary, remote_type, BridgeError, JsFunction, Remote};
10
11remote_type!(
12 BluetoothEmulation
15);
16
17impl BluetoothEmulation {
18 pub async fn emulate_adapter(&self, state: &str, le_supported: Option<bool>) -> Result<(), BridgeError> {
24 self.remote.call("emulateAdapter", vec![Some(Value::from(state)), le_supported.map(|x| Value::from(x))]).await
25 }
26
27 pub async fn disable_emulation(&self) -> Result<(), BridgeError> {
33 self.remote.call("disableEmulation", vec![]).await
34 }
35
36 pub async fn simulate_preconnected_peripheral(&self, preconnected_peripheral: Value) -> Result<(), BridgeError> {
42 self.remote.call("simulatePreconnectedPeripheral", vec![Some(preconnected_peripheral)]).await
43 }
44}