Type Alias usb_ids::Protocol

source ·
pub type Protocol = UsbId<PROTOCOL_TAG, u8>;
Expand description

Represents a subclass protocol in the USB database.

Protocols are part of the USB class code triplet (base class, subclass, protocol), contained within a SubClass.

Aliased Type§

struct Protocol { /* private fields */ }

Implementations§

source§

impl Protocol

source

pub fn from_cid_scid_pid( class_id: u8, subclass_id: u8, id: u8 ) -> Option<&'static Self>

Returns the Protocol corresponding to the given class, subclass, and protocol IDs, or None if no such protocol exists in the DB.

use usb_ids::Protocol;
let protocol = Protocol::from_cid_scid_pid(0x02, 0x02, 0x05).unwrap();
assert_eq!(protocol.name(), "AT-commands (3G)");