()
| 646 | } |
| 647 | |
| 648 | pub 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 | |
| 678 | pub async fn test_request_connection_parameters() { |
| 679 | use btleplug::api::ConnectionParameterPreset; |
nothing calls this directly
no test coverage detected