()
| 11 | // ── Discovery ─────────────────────────────────────────────────────── |
| 12 | |
| 13 | pub async fn test_discover_peripheral_by_name() { |
| 14 | use btleplug::api::Central; |
| 15 | |
| 16 | let adapter = peripheral_finder::get_adapter().await; |
| 17 | let info = adapter |
| 18 | .adapter_info() |
| 19 | .await |
| 20 | .expect("Failed to get adapter info"); |
| 21 | assert!(!info.is_empty(), "Adapter info should not be empty"); |
| 22 | let _state = adapter |
| 23 | .adapter_state() |
| 24 | .await |
| 25 | .expect("Failed to get adapter state"); |
| 26 | |
| 27 | let peripheral = peripheral_finder::find_and_connect().await; |
| 28 | let props = peripheral.properties().await.unwrap().unwrap(); |
| 29 | let name = props.local_name.unwrap_or_default(); |
| 30 | let expected = std::env::var("BTLEPLUG_TEST_PERIPHERAL") |
| 31 | .unwrap_or_else(|_| gatt_uuids::TEST_PERIPHERAL_NAME.to_string()); |
| 32 | assert_eq!(name, expected); |
| 33 | peripheral.disconnect().await.unwrap(); |
| 34 | } |
| 35 | |
| 36 | pub async fn test_discover_services() { |
| 37 | let peripheral = peripheral_finder::find_and_connect().await; |
nothing calls this directly
no test coverage detected