()
| 267 | } |
| 268 | |
| 269 | pub async fn test_write_without_response_burst() { |
| 270 | use btleplug::api::WriteType; |
| 271 | |
| 272 | let peripheral = peripheral_finder::find_and_connect().await; |
| 273 | peripheral_finder::reset_peripheral(&peripheral).await; |
| 274 | let char = |
| 275 | peripheral_finder::find_characteristic(&peripheral, gatt_uuids::WRITE_WITHOUT_RESPONSE); |
| 276 | |
| 277 | // Send a burst of writes to exercise flow control. Without proper |
| 278 | // canSendWriteWithoutResponse handling, later writes would be silently |
| 279 | // dropped by CoreBluetooth. |
| 280 | let num_writes = 50; |
| 281 | for i in 0u8..num_writes { |
| 282 | let data = vec![i; 20]; |
| 283 | peripheral |
| 284 | .write(&char, &data, WriteType::WithoutResponse) |
| 285 | .await |
| 286 | .expect(&format!("write-without-response #{} should succeed", i)); |
| 287 | } |
| 288 | peripheral.disconnect().await.unwrap(); |
| 289 | } |
| 290 | |
| 291 | pub async fn test_read_write_roundtrip() { |
| 292 | use btleplug::api::WriteType; |
nothing calls this directly
no test coverage detected