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

Function test_request_connection_parameters

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

Source from the content-addressed store, hash-verified

676}
677
678pub async fn test_request_connection_parameters() {
679 use btleplug::api::ConnectionParameterPreset;
680
681 let peripheral = peripheral_finder::find_and_connect().await;
682 match peripheral
683 .request_connection_parameters(ConnectionParameterPreset::ThroughputOptimized)
684 .await
685 {
686 Ok(()) => {
687 tokio::time::sleep(std::time::Duration::from_secs(1)).await;
688 if let Ok(Some(params)) = peripheral.connection_parameters().await {
689 assert!(
690 params.interval_us > 0,
691 "Connection interval should be positive after update"
692 );
693 }
694 }
695 Err(btleplug::Error::NotSupported(_)) => {}
696 Err(e) => {
697 panic!(
698 "Unexpected error from request_connection_parameters: {:?}",
699 e
700 );
701 }
702 }
703 peripheral.disconnect().await.unwrap();
704}

Callers

nothing calls this directly

Calls 4

find_and_connectFunction · 0.85
connection_parametersMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected