MCPcopy Create free account
hub / github.com/deviceplug/btleplug / test_read_only_descriptor

Function test_read_only_descriptor

tests/common/test_cases.rs:526–541  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

524// ── Descriptors ─────────────────────────────────────────────────────
525
526pub async fn test_read_only_descriptor() {
527 let peripheral = peripheral_finder::find_and_connect().await;
528 peripheral_finder::reset_peripheral(&peripheral).await;
529 let descriptor = super::find_descriptor(
530 &peripheral,
531 gatt_uuids::DESCRIPTOR_TEST_CHAR,
532 gatt_uuids::READ_ONLY_DESCRIPTOR,
533 );
534 let value = peripheral.read_descriptor(&descriptor).await.unwrap();
535 assert_eq!(
536 value,
537 vec![0xDE, 0xAD, 0xBE, 0xEF],
538 "Read-only descriptor should return fixed value"
539 );
540 peripheral.disconnect().await.unwrap();
541}
542
543pub async fn test_read_write_descriptor_roundtrip() {
544 let peripheral = peripheral_finder::find_and_connect().await;

Callers

nothing calls this directly

Calls 5

find_and_connectFunction · 0.85
reset_peripheralFunction · 0.85
find_descriptorFunction · 0.70
read_descriptorMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected