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

Commit b925a412 authored by Chris Manton's avatar Chris Manton
Browse files

Use common API to set hci handle

Towards readable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id30ad44e8084effd204f168cf3983da8ab31e064
parent 35503f9d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ void l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
  if (role == HCI_ROLE_MASTER) alarm_cancel(p_lcb->l2c_lcb_timer);

  /* Save the handle */
  p_lcb->SetHandle(handle);
  l2cu_set_lcb_handle(*p_lcb, handle);

  /* Connected OK. Change state to connected, we were scanning so we are master
   */
+0 −6
Original line number Diff line number Diff line
@@ -336,12 +336,6 @@ typedef struct t_l2c_linkcb {
  alarm_t* l2c_lcb_timer; /* Timer entry for timeout evt */
 private:
  uint16_t handle_; /* The handle used with LM */
  friend void l2cble_conn_comp(uint16_t handle, uint8_t role,
                               const RawAddress& bda, tBLE_ADDR_TYPE type,
                               uint16_t conn_interval, uint16_t conn_latency,
                               uint16_t conn_timeout);
  friend void l2c_link_hci_conn_comp(uint8_t status, uint16_t handle,
                                     const RawAddress& p_bda);
  friend void l2cu_set_lcb_handle(struct t_l2c_linkcb& p_lcb, uint16_t handle);
  void SetHandle(uint16_t handle) { handle_ = handle; }

+1 −1
Original line number Diff line number Diff line
@@ -163,7 +163,7 @@ void l2c_link_hci_conn_comp(uint8_t status, uint16_t handle,
  }

  /* Save the handle */
  p_lcb->SetHandle(handle);
  l2cu_set_lcb_handle(*p_lcb, handle);

  if (ci.status == HCI_SUCCESS) {
    /* Connected OK. Change state to connected */