pub struct BluetoothAgent { /* private fields */ }Expand description
The shell’s Bluetooth pairing agent, from cx.bluetooth_agent(). A
clone is cheap and shares the one agent.
Implementations§
Source§impl BluetoothAgent
impl BluetoothAgent
Sourcepub fn request(&self) -> ReadSignal<Option<PairingRequest>>
pub fn request(&self) -> ReadSignal<Option<PairingRequest>>
What BlueZ asks now, or None. One shows at a time: a new request
takes the place of one unanswered, which BlueZ is told was
cancelled. It goes once answered, or when BlueZ cancels it.
Sourcepub fn answer_pin_code(&self, pin_code: &str)
pub fn answer_pin_code(&self, pin_code: &str)
Answers PairingKind::PinCode with pin_code, 1 to 16 letters
and digits. Any other, or at any other time, it is dropped and
logged.
Sourcepub fn answer_passkey(&self, passkey: u32)
pub fn answer_passkey(&self, passkey: u32)
Answers PairingKind::Passkey with passkey, at most 999999. Any
other, or at any other time, it is dropped and logged.
Sourcepub fn accept(&self)
pub fn accept(&self)
Says yes to a confirmation, an authorization or a service, and hides a code shown. A PIN code or passkey needs its answer instead.
Sourcepub fn reject(&self)
pub fn reject(&self)
Says no to a question, so the pairing fails. A code shown is only hidden: BlueZ took its answer already, and ends the pairing itself.
Sourcepub fn make_default(&self)
pub fn make_default(&self)
Asks BlueZ to make the shell its default agent, now and whenever
BlueZ starts again, so the shell also answers pairings that other
programs, such as bluetoothctl, or the devices themselves start.
Without it, the shell answers only the pairings
Bluetooth::pair starts, since BlueZ asks the agent of whoever
called Pair.