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

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

Add stack/include/btm_api_types::security_mode_text

Towards loggable code

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

Change-Id: Ifbc618d55052ae6d090f2deb6d8f4de4e065fd85
parent dea60d08
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -471,6 +471,19 @@ typedef enum : uint8_t {
  BTM_SEC_MODE_SC = 6,
} tSECURITY_MODE;

inline std::string security_mode_text(const tSECURITY_MODE& security_mode) {
  switch (security_mode) {
    case BTM_SEC_MODE_SERVICE:
      return std::string("service");
    case BTM_SEC_MODE_SP:
      return std::string("simple pairing");
    case BTM_SEC_MODE_SC:
      return std::string("secure connections only");
    default:
      return std::string("UNKNOWN[%hhu]", security_mode);
  }
}

enum : uint16_t {
  /* Nothing required */
  BTM_SEC_NONE = 0x0000,