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

Commit 81de83c5 authored by Chris Manton's avatar Chris Manton
Browse files

Add stack/gatt/gatt_int::kGattConnected/Disconnected

Towards readable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: Iad9e85c56975f7ca97dfb62d4f5348c03aacc2f5
parent fdfc65d2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -100,6 +100,9 @@ typedef uint8_t tGATT_SEC_FLAG;
#define GATT_INFO_TYPE_PAIR_16 0x01
#define GATT_INFO_TYPE_PAIR_128 0x02

constexpr bool kGattConnected = true;
constexpr bool kGattDisconnected = !kGattConnected;

/*  GATT client FIND_TYPE_VALUE_Request data */
typedef struct {
  bluetooth::Uuid uuid; /* type of attribute to be found */
+2 −4
Original line number Diff line number Diff line
@@ -1573,10 +1573,8 @@ void gatt_cleanup_upon_disc(const RawAddress& bda, uint16_t reason,
    tGATT_REG* p_reg = &gatt_cb.cl_rcb[i];
    if (p_reg->in_use && p_reg->app_cb.p_conn_cb) {
      uint16_t conn_id = GATT_CREATE_CONN_ID(p_tcb->tcb_idx, p_reg->gatt_if);
      VLOG(1) << StringPrintf("found p_reg tcb_idx=%d gatt_if=%d  conn_id=0x%x",
                              p_tcb->tcb_idx, p_reg->gatt_if, conn_id);
      (*p_reg->app_cb.p_conn_cb)(p_reg->gatt_if, bda, conn_id, false, reason,
                                 transport);
      (*p_reg->app_cb.p_conn_cb)(p_reg->gatt_if, bda, conn_id,
                                 kGattDisconnected, reason, transport);
    }
  }