Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f1a20b79 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Controller: Simplify ReadLocalSupportedCommands"

parents 771c552e 8c426e5d
Loading
Loading
Loading
Loading
+7 −13
Original line number Diff line number Diff line
@@ -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;
@@ -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),*) => {