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

Function test_connection_parameters

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

Source from the content-addressed store, hash-verified

646}
647
648pub async fn test_connection_parameters() {
649 let peripheral = peripheral_finder::find_and_connect().await;
650 match peripheral.connection_parameters().await {
651 Ok(Some(params)) => {
652 assert!(
653 params.interval_us >= 7_500 && params.interval_us <= 4_000_000,
654 "Connection interval out of range: {} us",
655 params.interval_us
656 );
657 assert!(
658 params.latency <= 499,
659 "Latency out of range: {}",
660 params.latency
661 );
662 assert!(
663 params.supervision_timeout_us >= 100_000
664 && params.supervision_timeout_us <= 32_000_000,
665 "Supervision timeout out of range: {} us",
666 params.supervision_timeout_us
667 );
668 }
669 Ok(None) => {}
670 Err(btleplug::Error::NotSupported(_)) => {}
671 Err(e) => {
672 panic!("Unexpected error from connection_parameters: {:?}", e);
673 }
674 }
675 peripheral.disconnect().await.unwrap();
676}
677
678pub async fn test_request_connection_parameters() {
679 use btleplug::api::ConnectionParameterPreset;

Callers

nothing calls this directly

Calls 3

find_and_connectFunction · 0.85
connection_parametersMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected