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

Commit 146c5308 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Merge "Add stack/btm/btm_ble_int_types::btm_ble_sec_req_act_text" am: 0725f113

parents 67aee568 0725f113
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -72,6 +72,24 @@ typedef enum : uint8_t {
  BTM_BLE_SEC_REQ_ACT_DISCARD = 3,
} tBTM_BLE_SEC_REQ_ACT;

#ifndef CASE_RETURN_TEXT
#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code
#endif

inline std::string btm_ble_sec_req_act_text(
    const tBTM_BLE_SEC_REQ_ACT& action) {
  switch (action) {
    CASE_RETURN_TEXT(BTM_BLE_SEC_REQ_ACT_NONE);
    CASE_RETURN_TEXT(BTM_BLE_SEC_REQ_ACT_ENCRYPT);
    CASE_RETURN_TEXT(BTM_BLE_SEC_REQ_ACT_PAIR);
    CASE_RETURN_TEXT(BTM_BLE_SEC_REQ_ACT_DISCARD);
  }
}

#undef CASE_RETURN_TEXT

#define BTM_VSC_CHIP_CAPABILITY_L_VERSION 55
#define BTM_VSC_CHIP_CAPABILITY_M_VERSION 95
#define BTM_VSC_CHIP_CAPABILITY_S_VERSION 98
+11 −0
Original line number Diff line number Diff line
@@ -360,3 +360,14 @@ TEST_F(StackBtmTest, sco_state_text) {
                                  std::numeric_limits<std::uint16_t>::max()))
                   .c_str());
}

TEST_F(StackBtmTest, btm_ble_sec_req_act_text) {
  ASSERT_EQ("BTM_BLE_SEC_REQ_ACT_NONE",
            btm_ble_sec_req_act_text(BTM_BLE_SEC_REQ_ACT_NONE));
  ASSERT_EQ("BTM_BLE_SEC_REQ_ACT_ENCRYPT",
            btm_ble_sec_req_act_text(BTM_BLE_SEC_REQ_ACT_ENCRYPT));
  ASSERT_EQ("BTM_BLE_SEC_REQ_ACT_PAIR",
            btm_ble_sec_req_act_text(BTM_BLE_SEC_REQ_ACT_PAIR));
  ASSERT_EQ("BTM_BLE_SEC_REQ_ACT_DISCARD",
            btm_ble_sec_req_act_text(BTM_BLE_SEC_REQ_ACT_DISCARD));
}