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

Commit a3aedf7e authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

stack::rfcomm::tPORT: Remove write-once read-never field am: f22f5622

parents 5b8ac80f f22f5622
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -166,8 +166,6 @@ typedef struct {
  bool is_server;  /* true if the server application */
  uint8_t dlci;    /* DLCI of the connection */

  uint8_t error; /* Last error detected */

  uint8_t line_status; /* Line status as reported by peer */

  uint8_t default_signal_state; /* Initial signal state depending on uuid */
+5 −12
Original line number Diff line number Diff line
@@ -214,15 +214,8 @@ void PORT_StartCnf(tRFC_MCB* p_mcb, uint16_t result) {
        log::verbose("dlci {}", p_port->dlci);
        RFCOMM_ParameterNegotiationRequest(p_mcb, p_port->dlci, p_port->mtu);
      } else {
        log::warn("failed result:{}", result);

        /* Warning: result is also set to 4 when l2cap connection
           fails due to l2cap connect cnf (no_resources) */
        if (result == HCI_ERR_PAGE_TIMEOUT) {
          p_port->error = PORT_PAGE_TIMEOUT;
        } else {
          p_port->error = PORT_START_FAILED;
        }
        log::warn("Unable start configuration dlci:{} result:{}", p_port->dlci,
                  result);

        rfc_release_multiplexer_channel(p_mcb);

@@ -482,7 +475,8 @@ void PORT_DlcEstablishCnf(tRFC_MCB* p_mcb, uint8_t dlci, uint16_t mtu,
  if (!p_port) return;

  if (result != RFCOMM_SUCCESS) {
    p_port->error = PORT_START_FAILED;
    log::warn("Unable to establish configuration dlci:{} result:{}", dlci,
              result);
    port_rfc_closed(p_port, PORT_START_FAILED);
    log_counter_metrics(
        android::bluetooth::CodePathCounterKeyEnum::RFCOMM_PORT_START_FAILED,
@@ -569,8 +563,7 @@ void PORT_PortNegCnf(tRFC_MCB* p_mcb, uint8_t dlci, tPORT_STATE* /* p_pars */,
  }
  /* Port negotiation failed. Drop the connection */
  if (result != RFCOMM_SUCCESS) {
    p_port->error = PORT_PORT_NEG_FAILED;

    log::warn("Unable to negotiate port state dlci:{} result:{}", dlci, result);
    RFCOMM_DlcReleaseReq(p_mcb, p_port->dlci);

    port_rfc_closed(p_port, PORT_PORT_NEG_FAILED);
+0 −1
Original line number Diff line number Diff line
@@ -108,7 +108,6 @@ void port_set_defaults(tPORT* p_port) {
  p_port->ev_mask = 0;
  p_port->p_callback = nullptr;
  p_port->port_ctrl = 0;
  p_port->error = 0;
  p_port->line_status = 0;
  p_port->rx_flag_ev_pending = false;
  p_port->peer_mtu = RFCOMM_DEFAULT_MTU;
+3 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include "stack/include/bt_hdr.h"
#include "stack/rfcomm/port_int.h"
#include "stack/rfcomm/rfc_int.h"
#include "stack/rfcomm/rfc_state.h"

using namespace bluetooth;

@@ -139,7 +140,8 @@ void RFCOMM_ParameterNegotiationRequest(tRFC_MCB* p_mcb, uint8_t dlci,
  }

  if (p_mcb->state != RFC_MX_STATE_CONNECTED) {
    p_port->error = PORT_PAR_NEG_FAILED;
    log::warn("Multiplexer is in unexpected dlci:{} state:{}", dlci,
              rfcomm_mx_state_text(p_mcb->state).c_str());
    return;
  }