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

Function test_read_write_descriptor_roundtrip

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

Source from the content-addressed store, hash-verified

541}
542
543pub async fn test_read_write_descriptor_roundtrip() {
544 let peripheral = peripheral_finder::find_and_connect().await;
545 peripheral_finder::reset_peripheral(&peripheral).await;
546 let descriptor = super::find_descriptor(
547 &peripheral,
548 gatt_uuids::DESCRIPTOR_TEST_CHAR,
549 gatt_uuids::READ_WRITE_DESCRIPTOR,
550 );
551 let data = vec![0x42, 0x43, 0x44];
552 peripheral
553 .write_descriptor(&descriptor, &data)
554 .await
555 .unwrap();
556 let read_back = peripheral.read_descriptor(&descriptor).await.unwrap();
557 assert_eq!(
558 read_back, data,
559 "Descriptor read-back should match written data"
560 );
561 peripheral.disconnect().await.unwrap();
562}
563
564pub async fn test_descriptor_discovery() {
565 let peripheral = peripheral_finder::find_and_connect().await;

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected