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

Commit 1de720f0 authored by Chris Manton's avatar Chris Manton
Browse files

stack::l2cap [2/19] L2CA_DataWrite

Bug: 339732512
Test: m .
Flag: EXEMPT, Logging Change

Change-Id: Ida920d0a1a5abbcabc30c551e65fda5ccb6b1b18
parent de07fce6
Loading
Loading
Loading
Loading
+8 −2
Original line number Original line Diff line number Diff line
@@ -476,7 +476,10 @@ void avct_bcb_send_msg(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
  p_buf->layer_specific = AVCT_DATA_BROWSE;
  p_buf->layer_specific = AVCT_DATA_BROWSE;


  /* send message to L2CAP */
  /* send message to L2CAP */
  L2CA_DataWrite(p_bcb->ch_lcid, p_buf);
  if (L2CA_DataWrite(p_bcb->ch_lcid, p_buf) != L2CAP_DW_SUCCESS) {
    log::warn("Unable to write L2CAP data peer:{} cid:{}", p_bcb->peer_addr,
              p_bcb->ch_lcid);
  }
}
}


/*******************************************************************************
/*******************************************************************************
@@ -579,7 +582,10 @@ void avct_bcb_msg_ind(tAVCT_BCB* p_bcb, tAVCT_LCB_EVT* p_data) {
    AVCT_BUILD_HDR(p, label, AVCT_PKT_TYPE_SINGLE, AVCT_REJ);
    AVCT_BUILD_HDR(p, label, AVCT_PKT_TYPE_SINGLE, AVCT_REJ);
    UINT16_TO_BE_STREAM(p, pid);
    UINT16_TO_BE_STREAM(p, pid);
    p_buf->layer_specific = AVCT_DATA_BROWSE;
    p_buf->layer_specific = AVCT_DATA_BROWSE;
    L2CA_DataWrite(p_bcb->ch_lcid, p_buf);
    if (L2CA_DataWrite(p_bcb->ch_lcid, p_buf) != L2CAP_DW_SUCCESS) {
      log::warn("Unable to write L2CAP data peer:{} cid:{}", p_bcb->peer_addr,
                p_bcb->ch_lcid);
    }
  }
  }
}
}


+4 −1
Original line number Original line Diff line number Diff line
@@ -707,7 +707,10 @@ void avct_lcb_msg_ind(tAVCT_LCB* p_lcb, tAVCT_LCB_EVT* p_data) {
    p = (uint8_t*)(p_buf + 1) + p_buf->offset;
    p = (uint8_t*)(p_buf + 1) + p_buf->offset;
    AVCT_BUILD_HDR(p, label, AVCT_PKT_TYPE_SINGLE, AVCT_REJ);
    AVCT_BUILD_HDR(p, label, AVCT_PKT_TYPE_SINGLE, AVCT_REJ);
    UINT16_TO_BE_STREAM(p, pid);
    UINT16_TO_BE_STREAM(p, pid);
    L2CA_DataWrite(p_lcb->ch_lcid, p_buf);
    if (L2CA_DataWrite(p_lcb->ch_lcid, p_buf) != L2CAP_DW_SUCCESS) {
      log::warn("Unable to write L2CAP data peer:{} cid:{} len:{}",
                p_lcb->peer_addr, p_lcb->ch_lcid, p_buf->len);
    }
  }
  }
}
}


+4 −1
Original line number Original line Diff line number Diff line
@@ -303,7 +303,10 @@ static void bnep_congestion_ind(uint16_t l2cap_cid, bool is_congested) {


      if (!p_buf) break;
      if (!p_buf) break;


      L2CA_DataWrite(l2cap_cid, p_buf);
      if (L2CA_DataWrite(l2cap_cid, p_buf) != L2CAP_DW_SUCCESS) {
        log::warn("Unable to write L2CAP data peer:{} cid:{} len:{}",
                  p_bcb->rem_bda, l2cap_cid, p_buf->len);
      }
    }
    }
  }
  }
}
}
+4 −1
Original line number Original line Diff line number Diff line
@@ -415,7 +415,10 @@ void bnepu_check_send_packet(tBNEP_CONN* p_bcb, BT_HDR* p_buf) {
      fixed_queue_enqueue(p_bcb->xmit_q, p_buf);
      fixed_queue_enqueue(p_bcb->xmit_q, p_buf);
    }
    }
  } else {
  } else {
    L2CA_DataWrite(p_bcb->l2cap_cid, p_buf);
    if (L2CA_DataWrite(p_bcb->l2cap_cid, p_buf) != L2CAP_DW_SUCCESS) {
      log::warn("Unable to write L2CAP data peer:{} cid:{} len:{}",
                p_bcb->rem_bda, p_bcb->l2cap_cid, p_buf->len);
    }
  }
  }
}
}


+5 −1
Original line number Original line Diff line number Diff line
@@ -88,7 +88,11 @@ static void hidd_check_config_done() {


    // send outstanding data on intr
    // send outstanding data on intr
    if (hd_cb.pending_data) {
    if (hd_cb.pending_data) {
      L2CA_DataWrite(p_hcon->intr_cid, hd_cb.pending_data);
      if (L2CA_DataWrite(p_hcon->intr_cid, hd_cb.pending_data) !=
          L2CAP_DW_SUCCESS) {
        log::warn("Unable to write L2CAP data cid:{} len:{}", p_hcon->intr_cid,
                  hd_cb.pending_data->len);
      }
      hd_cb.pending_data = NULL;
      hd_cb.pending_data = NULL;
    }
    }
  }
  }
Loading