summaryrefslogtreecommitdiff
path: root/floss
diff options
context:
space:
mode:
author Archie Pusaka <apusaka@google.com> 2024-04-05 07:02:06 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2024-04-05 07:02:06 +0000
commit0fc0339fced0d48091f7a5e7d03a32407407c67b (patch)
tree2473b810a8138ff46e08e2c0e201caf476c714f4 /floss
parenta01121f8fd2bd50271578ffd9a1677d37be08a60 (diff)
parent882537878741733a1df3e653f0838fc0f19e4316 (diff)
Merge "Floss: Hcidoc: Clear NOCP on carryover section" into main
Diffstat (limited to 'floss')
-rw-r--r--floss/hcidoc/src/groups/connections.rs12
-rw-r--r--floss/hcidoc/src/parser.rs6
2 files changed, 18 insertions, 0 deletions
diff --git a/floss/hcidoc/src/groups/connections.rs b/floss/hcidoc/src/groups/connections.rs
index e339c0452c..9c1526f1b7 100644
--- a/floss/hcidoc/src/groups/connections.rs
+++ b/floss/hcidoc/src/groups/connections.rs
@@ -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
_ => (),
}
diff --git a/floss/hcidoc/src/parser.rs b/floss/hcidoc/src/parser.rs
index 3db07bef76..4bba3aade3 100644
--- a/floss/hcidoc/src/parser.rs
+++ b/floss/hcidoc/src/parser.rs
@@ -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())),
}