MCPcopy Create free account
hub / github.com/deviceplug/btleplug / test_read_rssi

Function test_read_rssi

tests/common/test_cases.rs:595–611  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

593}
594
595pub async fn test_read_rssi() {
596 let peripheral = peripheral_finder::find_and_connect().await;
597 match peripheral.read_rssi().await {
598 Ok(rssi) => {
599 assert!(
600 rssi < 0 && rssi > -120,
601 "RSSI should be between -120 and 0 dBm, got {}",
602 rssi
603 );
604 }
605 Err(btleplug::Error::NotSupported(_)) => {}
606 Err(e) => {
607 panic!("Unexpected error from read_rssi: {:?}", e);
608 }
609 }
610 peripheral.disconnect().await.unwrap();
611}
612
613pub async fn test_properties_contain_peripheral_info() {
614 let peripheral = peripheral_finder::find_and_connect().await;

Callers

nothing calls this directly

Calls 3

find_and_connectFunction · 0.85
read_rssiMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected