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

Function test_discover_services

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

Source from the content-addressed store, hash-verified

34}
35
36pub async fn test_discover_services() {
37 let peripheral = peripheral_finder::find_and_connect().await;
38 let services = peripheral.services();
39 let service_uuids: Vec<_> = services.iter().map(|s| s.uuid).collect();
40 assert!(
41 service_uuids.contains(&gatt_uuids::CONTROL_SERVICE),
42 "Control Service not found in {:?}",
43 service_uuids
44 );
45 assert!(
46 service_uuids.contains(&gatt_uuids::READ_WRITE_SERVICE),
47 "Read/Write Service not found"
48 );
49 assert!(
50 service_uuids.contains(&gatt_uuids::NOTIFICATION_SERVICE),
51 "Notification Service not found"
52 );
53 assert!(
54 service_uuids.contains(&gatt_uuids::DESCRIPTOR_SERVICE),
55 "Descriptor Service not found"
56 );
57 peripheral.disconnect().await.unwrap();
58}
59
60pub async fn test_discover_characteristics() {
61 let peripheral = peripheral_finder::find_and_connect().await;

Callers

nothing calls this directly

Calls 4

find_and_connectFunction · 0.85
iterMethod · 0.80
servicesMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected