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

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

Add stack/include/l2cdefs::l2cap_le_result_code_text am: be30d310 am: 3dd4be22

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1496549

Change-Id: I471c75c51df6672b033d815e4e4f3e659ea5898e
parents 6a27b94d 3dd4be22
Loading
Loading
Loading
Loading
+28 −0
Original line number Diff line number Diff line
@@ -131,6 +131,34 @@ typedef enum : uint8_t {
  L2CAP_LE_RESULT_INVALID_PARAMETERS = 0x0C
} tL2CAP_LE_RESULT_CODE;

inline std::string l2cap_le_result_code_text(
    const tL2CAP_LE_RESULT_CODE& code) {
  switch (code) {
    case L2CAP_LE_RESULT_CONN_OK:
      return std::string("le connection success");
    case L2CAP_LE_RESULT_NO_PSM:
      return std::string("le no psm service");
    case L2CAP_LE_RESULT_NO_RESOURCES:
      return std::string("le no resources");
    case L2CAP_LE_RESULT_INSUFFICIENT_AUTHENTICATION:
      return std::string("le authentication failed");
    case L2CAP_LE_RESULT_INSUFFICIENT_AUTHORIZATION:
      return std::string("le authorization failed");
    case L2CAP_LE_RESULT_INSUFFICIENT_ENCRYP_KEY_SIZE:
      return std::string("le encryption key size failed");
    case L2CAP_LE_RESULT_INSUFFICIENT_ENCRYP:
      return std::string("le encryption failed");
    case L2CAP_LE_RESULT_INVALID_SOURCE_CID:
      return std::string("le invalid source channel identifier");
    case L2CAP_LE_RESULT_SOURCE_CID_ALREADY_ALLOCATED:
      return std::string("le source channel identifier busy");
    case L2CAP_LE_RESULT_UNACCEPTABLE_PARAMETERS:
      return std::string("le unacceptable parameters");
    case L2CAP_LE_RESULT_INVALID_PARAMETERS:
      return std::string("invalid parameters");
  }
}

/* Credit based reconfig results code */
#define L2CAP_RECONFIG_SUCCEED 0
#define L2CAP_RECONFIG_REDUCTION_MTU_NO_ALLOWED 1