()
| 676 | } |
| 677 | |
| 678 | pub 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 | } |
nothing calls this directly
no test coverage detected