tGATT_CL_COMPLETE* p_data) {
auto iter = OngoingOps.find(conn_id);
- VLOG(1) << __func__ << " opcode: " << loghex(op) << " status: " << status
+ VLOG(1) << __func__ << " opcode: " << loghex(static_cast<uint8_t>(op))
+ << " status: " << status
<< " conn id: " << loghex(static_cast<uint8_t>(conn_id));
if (op != GATTC_OPTYPE_READ) return;
tGATT_STATUS encrypt_status;
uint8_t* p = p_data;
uint8_t i;
- uint8_t event = (op_code == GATT_HANDLE_VALUE_IND)
- ? GATTC_OPTYPE_INDICATION
- : GATTC_OPTYPE_NOTIFICATION;
+ tGATTC_OPTYPE event = (op_code == GATT_HANDLE_VALUE_IND)
+ ? GATTC_OPTYPE_INDICATION
+ : GATTC_OPTYPE_NOTIFICATION;
VLOG(1) << __func__;
uint16_t counter; /* used as offset, attribute length, num of prepare write */
uint16_t start_offset;
tGATT_AUTH_REQ auth_req; /* authentication requirement */
- uint8_t operation; /* one logic channel can have one operation active */
+ tGATTC_OPTYPE operation; /* one logic channel can have one operation active */
uint8_t op_subtype; /* operation subtype */
tGATT_STATUS status; /* operation status */
bool first_read_blob_after_read;
tGATT_CL_COMPLETE cb_data;
tGATT_CMPL_CBACK* p_cmpl_cb =
(p_clcb->p_reg) ? p_clcb->p_reg->app_cb.p_cmpl_cb : NULL;
- uint8_t op = p_clcb->operation;
+ tGATTC_OPTYPE op = p_clcb->operation;
tGATT_DISC_TYPE disc_type = GATT_DISC_MAX;
tGATT_DISC_CMPL_CB* p_disc_cmpl_cb =
(p_clcb->p_reg) ? p_clcb->p_reg->app_cb.p_disc_cmpl_cb : NULL;
/* GATT client operation type, used in client callback function
*/
-#define GATTC_OPTYPE_NONE 0
-#define GATTC_OPTYPE_DISCOVERY 1
-#define GATTC_OPTYPE_READ 2
-#define GATTC_OPTYPE_WRITE 3
-#define GATTC_OPTYPE_EXE_WRITE 4
-#define GATTC_OPTYPE_CONFIG 5
-#define GATTC_OPTYPE_NOTIFICATION 6
-#define GATTC_OPTYPE_INDICATION 7
-typedef uint8_t tGATTC_OPTYPE;
+typedef enum : uint8_t {
+ GATTC_OPTYPE_NONE = 0,
+ GATTC_OPTYPE_DISCOVERY = 1,
+ GATTC_OPTYPE_READ = 2,
+ GATTC_OPTYPE_WRITE = 3,
+ GATTC_OPTYPE_EXE_WRITE = 4,
+ GATTC_OPTYPE_CONFIG = 5,
+ GATTC_OPTYPE_NOTIFICATION = 6,
+ GATTC_OPTYPE_INDICATION = 7,
+} tGATTC_OPTYPE;
/* characteristic declaration
*/