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

Function to_error

src/winrtble/utils.rs:26–38  ·  view source on GitHub ↗
(status: GattCommunicationStatus)

Source from the content-addressed store, hash-verified

24};
25
26pub fn to_error(status: GattCommunicationStatus) -> Result<()> {
27 if status == GattCommunicationStatus::AccessDenied {
28 Err(Error::PermissionDenied)
29 } else if status == GattCommunicationStatus::Unreachable {
30 Err(Error::NotConnected)
31 } else if status == GattCommunicationStatus::Success {
32 Ok(())
33 } else if status == GattCommunicationStatus::ProtocolError {
34 Err(Error::NotSupported("ProtocolError".to_string()))
35 } else {
36 Err(Error::Other("Communication Error:".to_string().into()))
37 }
38}
39
40pub fn to_descriptor_value(
41 properties: GattCharacteristicProperties,

Callers 1

connectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected