()
| 221 | } |
| 222 | |
| 223 | pub async fn test_read_counter_increments() { |
| 224 | let peripheral = peripheral_finder::find_and_connect().await; |
| 225 | peripheral_finder::reset_peripheral(&peripheral).await; |
| 226 | let char = peripheral_finder::find_characteristic(&peripheral, gatt_uuids::COUNTER_READ); |
| 227 | let first = peripheral.read(&char).await.unwrap(); |
| 228 | let second = peripheral.read(&char).await.unwrap(); |
| 229 | let first_val = u32::from_le_bytes(first[..4].try_into().unwrap()); |
| 230 | let second_val = u32::from_le_bytes(second[..4].try_into().unwrap()); |
| 231 | assert!( |
| 232 | second_val > first_val, |
| 233 | "Counter should increment: first={}, second={}", |
| 234 | first_val, |
| 235 | second_val |
| 236 | ); |
| 237 | peripheral.disconnect().await.unwrap(); |
| 238 | } |
| 239 | |
| 240 | pub async fn test_write_with_response() { |
| 241 | use btleplug::api::WriteType; |
nothing calls this directly
no test coverage detected