removed disfunctional non-pairing mode
This commit is contained in:
@ -115,11 +115,13 @@ impl BleServer {
|
||||
button_up.lock().set_value(&[data]).notify();
|
||||
}
|
||||
Commands::PairTimerExpired => {
|
||||
advertise_to_direct(ble_advertiser).expect("Failed to exit pairing mode");
|
||||
//advertise_to_direct(ble_advertiser).expect("Failed to exit pairing mode");
|
||||
debug!("pairing mode / non-pairing mode not currently supported");
|
||||
self.send_q.send(Commands::PairTimerClear).await?;
|
||||
}
|
||||
Commands::AllowPairing => {
|
||||
advertise_to_undirected(ble_advertiser).expect("Failed to enter pairing mode");
|
||||
//advertise_to_undirected(ble_advertiser).expect("Failed to enter pairing mode");
|
||||
debug!("pairing mode / non-pairing mode not currently supported");
|
||||
}
|
||||
Commands::EraseBleBonds => {
|
||||
ble_device.delete_all_bonds().expect("Failed trying to erase bluetooth bonding information");
|
||||
@ -208,17 +210,5 @@ fn advertise(advertiser: &Mutex<BLEAdvertising>) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn advertise_to_direct(advertiser: &Mutex<BLEAdvertising>) -> Result<()> {
|
||||
advertiser.lock().stop()?;
|
||||
advertiser.lock().advertisement_type(ConnMode::Dir).start()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn advertise_to_undirected(advertiser: &Mutex<BLEAdvertising>) -> Result<()> {
|
||||
advertiser.lock().stop()?;
|
||||
advertiser.lock().advertisement_type(ConnMode::Und).start()?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
//TODO set maximum pairs to remember?
|
||||
//TODO after disconnect, it returns to scanning - will it return to directed scanning? Find out when directed is working.
|
||||
Reference in New Issue
Block a user