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

Commit 3e2d781b authored by Pomai Ahlo's avatar Pomai Ahlo
Browse files

RFCOMM SM logs[4/7] Cleanup docs

Bug: 358176338
Test: m com.android.btservices
Flag: DOCS_ONLY
Change-Id: Ic4eccc9d67d65e05ec0d40be9a51020d3700e160
parent 789dd7a8
Loading
Loading
Loading
Loading
+3 −18
Original line number Diff line number Diff line
@@ -22,13 +22,8 @@

#include "macros.h"

/*
 * Events that can be received by multiplexer as well as port state machines
 */
// Events that can be received by both multiplexer or port state machines
enum tRFC_EVENT : uint16_t {
  /*
   * Events that can be received by multiplexer as well as port state machines
   */
  RFC_EVENT_SABME = 0,
  RFC_EVENT_UA = 1,
  RFC_EVENT_DM = 2,
@@ -38,13 +33,8 @@ enum tRFC_EVENT : uint16_t {
  RFC_EVENT_BAD_FRAME = 50,
};

/*
 * Multiplexer events
 */
// Multiplexer events
enum tRFC_MX_EVENT : uint16_t {
  /*
   * Multiplexer events
   */
  RFC_MX_EVENT_SABME = RFC_EVENT_SABME,
  RFC_MX_EVENT_UA = RFC_EVENT_UA,
  RFC_MX_EVENT_DM = RFC_EVENT_DM,
@@ -62,13 +52,8 @@ enum tRFC_MX_EVENT : uint16_t {
  RFC_MX_EVENT_DISC_IND = 14,
};

/*
 * Port events
 */
// Port events
enum tRFC_PORT_EVENT : uint16_t {
  /*
   * Port events
   */
  RFC_PORT_EVENT_SABME = RFC_EVENT_SABME,
  RFC_PORT_EVENT_UA = RFC_EVENT_UA,
  RFC_PORT_EVENT_DM = RFC_EVENT_DM,
+5 −8
Original line number Diff line number Diff line
@@ -472,11 +472,9 @@ void rfc_port_sm_opened(tPORT* p_port, tRFC_PORT_EVENT event, void* p_data) {
      return;

    case RFC_PORT_EVENT_DATA:
      /* Send credits in the frame.  Pass them in the layer specific member of
       * the hdr. */
      /* There might be an initial case when we reduced rx_max and credit_rx is
       * still */
      /* bigger.  Make sure that we do not send 255 */
      // Send credits in the frame.  Pass them in the layer specific member of the hdr.
      // There might be an initial case when we reduced rx_max and credit_rx is still bigger.
      // Make sure that we do not send 255
      log::verbose("RFC_PORT_EVENT_DATA bd_addr:{} handle:{} dlci:{} scn:{}", p_port->bd_addr,
                   p_port->handle, p_port->dlci, p_port->scn);
      if ((p_port->rfc.p_mcb->flow == PORT_FC_CREDIT) &&
@@ -704,15 +702,14 @@ void rfc_process_rpn(tRFC_MCB* p_mcb, bool is_command, bool is_request, MX_FRAME
    return;
  }

  /* If we are not awaiting response just ignore it */
  // If we are not awaiting response just ignore it
  p_port = port_find_mcb_dlci_port(p_mcb, p_frame->dlci);
  if ((p_port == nullptr) || !(p_port->rfc.expected_rsp & (RFC_RSP_RPN | RFC_RSP_RPN_REPLY))) {
    log::warn("ignore DLC parameter negotiation as we are not waiting for any");
    return;
  }

  /* If we sent a request for port parameters to the peer it is replying with */
  /* mask 0. */
  // If we sent a request for port parameters to the peer it is replying with mask 0.
  rfc_port_timer_stop(p_port);

  if (p_port->rfc.expected_rsp & RFC_RSP_RPN_REPLY) {
+2 −6
Original line number Diff line number Diff line
@@ -20,9 +20,7 @@

#include "macros.h"

/*
 * Define states and events for the RFC multiplexer state machine
 */
// Multiplexer states
typedef enum : uint16_t {
  RFC_MX_STATE_IDLE = 0,
  RFC_MX_STATE_WAIT_CONN_CNF = 1,
@@ -33,9 +31,7 @@ typedef enum : uint16_t {
  RFC_MX_STATE_DISC_WAIT_UA = 6,
} tRFC_MX_STATE;

/*
 * Define port states
 */
// Port states
typedef enum : uint8_t {
  RFC_STATE_CLOSED = 0,
  RFC_STATE_SABME_WAIT_UA = 1,