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

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

enum-ify stack/btm/btm_ble_int_types::tBTM_BLE_SEC_REQ_ACT

Towards readable code

Bug: 163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I05ccdb3e4b1b42810f77a4d6322606434a4b58c7
parent 279871a7
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -70,13 +70,14 @@

#define BTM_BLE_GAP_FAST_ADV_TIMEOUT_MS (30 * 1000)

#define BTM_BLE_SEC_REQ_ACT_NONE 0
typedef enum : uint8_t {
  BTM_BLE_SEC_REQ_ACT_NONE = 0,
  /* encrypt the link using current key or key refresh */
#define BTM_BLE_SEC_REQ_ACT_ENCRYPT 1
#define BTM_BLE_SEC_REQ_ACT_PAIR 2
  BTM_BLE_SEC_REQ_ACT_ENCRYPT = 1,
  BTM_BLE_SEC_REQ_ACT_PAIR = 2,
  /* discard the sec request while encryption is started but not completed */
#define BTM_BLE_SEC_REQ_ACT_DISCARD 3
typedef uint8_t tBTM_BLE_SEC_REQ_ACT;
  BTM_BLE_SEC_REQ_ACT_DISCARD = 3,
} tBTM_BLE_SEC_REQ_ACT;

/* LE scan activity bit mask, continue with LE inquiry bits */
/* observe is in progress */
+1 −1
Original line number Diff line number Diff line
@@ -272,7 +272,7 @@ tGATT_SEC_ACTION gatt_determine_sec_act(tGATT_CLCB* p_clcb) {
  bool is_link_key_known = false;
  bool is_key_mitm = false;
  uint8_t key_type;
  tBTM_BLE_SEC_REQ_ACT sec_act = BTM_LE_SEC_NONE;
  tBTM_BLE_SEC_REQ_ACT sec_act = BTM_BLE_SEC_REQ_ACT_NONE;

  if (auth_req == GATT_AUTH_REQ_NONE) return act;