btle/hci/
link_control.rs

1//! Link Controller module (WIP).
2use crate::hci::{Opcode, OCF, OGF};
3
4#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Debug, Hash)]
5#[repr(u16)]
6pub enum LinkControlOpcode {
7    Inquiry = 0x0001,
8    InquiryCancel = 0x0002,
9    PeriodicInquiryMode = 0x0003,
10    ExitPeriodicInquiryMode = 0x0004,
11    CreateConnection = 0x0005,
12    Disconnect = 0x0006,
13    AddSCOConnection = 0x0007,
14    AcceptConnectionRequest = 0x0009,
15    RejectConnectionRequest = 0x000A,
16    LinkKeyRequestReply = 0x000B,
17    LinkKeyRequestNegativeReply = 0x000C,
18    PINCodeRequestReply = 0x000D,
19    PINCodeRequestNegativeReply = 0x000E,
20    ChangeConnectionPacketType = 0x000F,
21    AuthenticationRequested = 0x0011,
22    SetConnectionEncryption = 0x0013,
23    ChangeConnectionLinkKey = 0x0015,
24    MasterLinkKey = 0x0017,
25    RemoteNameRequest = 0x0019,
26    ReadRemoteSupportedFeatures = 0x001B,
27    ReadRemoteVersionInformation = 0x001D,
28    ReadClockOffset = 0x001F,
29}
30impl LinkControlOpcode {
31    pub const fn ogf() -> OGF {
32        OGF::LinkControl
33    }
34}
35impl From<LinkControlOpcode> for OCF {
36    fn from(opcode: LinkControlOpcode) -> Self {
37        Self::new(opcode as u16)
38    }
39}
40impl From<LinkControlOpcode> for Opcode {
41    fn from(opcode: LinkControlOpcode) -> Self {
42        Self(OGF::LinkControl, opcode.into())
43    }
44}