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

Commit 30d0cf47 authored by Archie Pusaka's avatar Archie Pusaka Committed by Automerger Merge Worker
Browse files

Merge "Floss: Hcidoc: Clear NOCP on carryover section" into main am: 0fc0339f

parents 9f8faa99 0fc0339f
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -612,6 +612,14 @@ impl OddDisconnectionsRule {
        self.last_feat_handle.clear();
        self.pending_disconnect_due_to_host_power_off.clear();
    }

    fn process_system_note(&mut self, note: &String) {
        // Carryover section doesn't contain the NOCP from the controller.
        // The note may contain zero bytes, so don't check for exact string.
        if note.contains("END OF CARRYOVER SECTION") {
            self.nocp_by_handle.clear();
        }
    }
}

impl Rule for OddDisconnectionsRule {
@@ -806,6 +814,10 @@ impl Rule for OddDisconnectionsRule {
            // We don't do anything with RX packets yet.
            PacketChild::AclRx(_) => (),

            PacketChild::SystemNote(note) => {
                self.process_system_note(note);
            }

            // End packet.inner match
            _ => (),
        }
+6 −0
Original line number Diff line number Diff line
@@ -288,6 +288,7 @@ pub enum PacketChild {
    AclTx(Acl),
    AclRx(Acl),
    NewIndex(NewIndex),
    SystemNote(String),
}

impl<'a> TryFrom<&'a LinuxSnoopPacket> for PacketChild {
@@ -320,6 +321,11 @@ impl<'a> TryFrom<&'a LinuxSnoopPacket> for PacketChild {
                Err(e) => Err(format!("Couldn't parse new index: {:?}", e)),
            },

            LinuxSnoopOpcodes::SystemNote => match String::from_utf8(item.data.to_vec()) {
                Ok(data) => Ok(PacketChild::SystemNote(data)),
                Err(e) => Err(format!("Couldn't parse system note: {:?}", e)),
            },

            // TODO(b/262928525) - Add packet handlers for more packet types.
            _ => Err(format!("Unhandled packet opcode: {:?}", item.opcode())),
        }