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

Commit 4806cdc1 authored by Archie Pusaka's avatar Archie Pusaka Committed by Gerrit Code Review
Browse files

Merge changes I12e25fdd,I1db61463,I1261212f,I41958f63 into main

* changes:
  floss: hcidoc: Add SecurityMode3 tag
  floss: hcidoc: fix the disconnection due to host power off
  floss: hcidoc: Add tags for remote feature request
  floss: hcidoc: Refactor OddDisconnectionRule
parents ddfe114d d58d9361
Loading
Loading
Loading
Loading
+578 −320

File changed.

Preview size limit exceeded, changes collapsed.

+16 −2
Original line number Diff line number Diff line
@@ -326,8 +326,11 @@ struct InformationalRule {
    devices: HashMap<Address, DeviceInformation>,
    handles: HashMap<ConnectionHandle, Address>,
    sco_handles: HashMap<ConnectionHandle, ConnectionHandle>,
    // unknownConnections store connections which is initiated before btsnoop starts.
    /// unknownConnections store connections which is initiated before btsnoop starts.
    unknown_connections: HashMap<ConnectionHandle, AclInformation>,
    /// When powering off, the controller might or might not reply disconnection request. Therefore
    /// make this a special case.
    pending_disconnect_due_to_host_power_off: HashSet<ConnectionHandle>,
}

impl InformationalRule {
@@ -337,6 +340,7 @@ impl InformationalRule {
            handles: HashMap::new(),
            sco_handles: HashMap::new(),
            unknown_connections: HashMap::new(),
            pending_disconnect_due_to_host_power_off: HashSet::new(),
        }
    }

@@ -454,6 +458,7 @@ impl InformationalRule {
            self.report_connection_end(handle, ts);
        }
        self.sco_handles.clear();
        self.pending_disconnect_due_to_host_power_off.clear();
    }

    fn _report_profile_start(
@@ -537,8 +542,15 @@ impl Rule for InformationalRule {
                }

                EventChild::DisconnectionComplete(ev) => {
                    // If disconnected because host is powering off, the event has been processed.
                    // We can't just query the reason here because it's different across vendors.
                    if !self
                        .pending_disconnect_due_to_host_power_off
                        .remove(&ev.get_connection_handle())
                    {
                        self.report_connection_end(ev.get_connection_handle(), packet.ts);
                    }
                }

                EventChild::ExtendedInquiryResult(ev) => {
                    for data in ev.get_extended_inquiry_response() {
@@ -638,6 +650,8 @@ impl Rule for InformationalRule {
                        if cmd.get_reason()
                            == DisconnectReason::RemoteDeviceTerminatedConnectionPowerOff
                        {
                            self.pending_disconnect_due_to_host_power_off
                                .insert(cmd.get_connection_handle());
                            self.report_connection_end(cmd.get_connection_handle(), packet.ts);
                        }
                    }