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

Commit 6741b108 authored by Chris Manton's avatar Chris Manton
Browse files

Enum-ify stack/gatt::tGATT_SEC_ACTION

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

Change-Id: I57eb31e9e39f073380949dc9df4510a8adb81dfb
parent a108415c
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -41,14 +41,15 @@
#define GATT_TRANS_ID_MAX 0x0fffffff /* 4 MSB is reserved */

/* security action for GATT write and read request */
#define GATT_SEC_NONE 0
#define GATT_SEC_OK 1
#define GATT_SEC_SIGN_DATA 2       /* compute the signature for the write cmd */
#define GATT_SEC_ENCRYPT 3         /* encrypt the link with current key */
#define GATT_SEC_ENCRYPT_NO_MITM 4 /* unauthenticated encryption or better */
#define GATT_SEC_ENCRYPT_MITM 5    /* authenticated encryption */
#define GATT_SEC_ENC_PENDING 6     /* wait for link encryption pending */
typedef uint8_t tGATT_SEC_ACTION;
typedef enum : uint8_t {
  GATT_SEC_NONE = 0,
  GATT_SEC_OK = 1,
  GATT_SEC_SIGN_DATA = 2,       /* compute the signature for the write cmd */
  GATT_SEC_ENCRYPT = 3,         /* encrypt the link with current key */
  GATT_SEC_ENCRYPT_NO_MITM = 4, /* unauthenticated encryption or better */
  GATT_SEC_ENCRYPT_MITM = 5,    /* authenticated encryption */
  GATT_SEC_ENC_PENDING = 6,     /* wait for link encryption pending */
} tGATT_SEC_ACTION;

#define GATT_INDEX_INVALID 0xff

+2 −2
Original line number Diff line number Diff line
@@ -37,11 +37,11 @@ bool gatt_security_check_start(tGATT_CLCB* p_clcb) {
}
tGATT_SEC_ACTION gatt_determine_sec_act(tGATT_CLCB* p_clcb) {
  mock_function_count_map[__func__]++;
  return 0;
  return GATT_SEC_NONE;
}
tGATT_SEC_ACTION gatt_get_sec_act(tGATT_TCB* p_tcb) {
  mock_function_count_map[__func__]++;
  return 0;
  return GATT_SEC_NONE;
}
tGATT_STATUS gatt_get_link_encrypt_status(tGATT_TCB& tcb) {
  mock_function_count_map[__func__]++;