Loading system/gd/rust/hci/src/controller.rs +7 −13 Original line number Diff line number Diff line Loading @@ -218,9 +218,6 @@ pub struct SupportedCommands { impl SupportedCommands { /// Check whether a given opcode is supported by the controller pub fn is_supported(&self, opcode: OpCode) -> bool { match opcode { OpCode::ReadLocalSupportedCommands => true, _ => { let converted = OpCodeIndex::try_from(opcode); if converted.is_err() { return false; Loading @@ -228,13 +225,10 @@ impl SupportedCommands { let index = converted.unwrap().to_usize().unwrap(); // The 10 here looks sus, but hci_packets.pdl mentions the index value // is octet * 10 + bit // OpCodeIndex is encoded as octet * 10 + bit for readability self.supported[index / 10] & (1 << (index % 10)) == 1 } } } } macro_rules! supported_features { ($($id:ident => $page:literal : $bit:literal),*) => { Loading Loading
system/gd/rust/hci/src/controller.rs +7 −13 Original line number Diff line number Diff line Loading @@ -218,9 +218,6 @@ pub struct SupportedCommands { impl SupportedCommands { /// Check whether a given opcode is supported by the controller pub fn is_supported(&self, opcode: OpCode) -> bool { match opcode { OpCode::ReadLocalSupportedCommands => true, _ => { let converted = OpCodeIndex::try_from(opcode); if converted.is_err() { return false; Loading @@ -228,13 +225,10 @@ impl SupportedCommands { let index = converted.unwrap().to_usize().unwrap(); // The 10 here looks sus, but hci_packets.pdl mentions the index value // is octet * 10 + bit // OpCodeIndex is encoded as octet * 10 + bit for readability self.supported[index / 10] & (1 << (index % 10)) == 1 } } } } macro_rules! supported_features { ($($id:ident => $page:literal : $bit:literal),*) => { Loading