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

Commit 89c4799f authored by Chris Manton's avatar Chris Manton
Browse files

Add stack/include/btm_api_types::power_mode_text

Towards loggable code

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

Change-Id: I18da64eab0ff3e30a8aa7554c6469ae25b9beb07
parent d9f10104
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -1004,6 +1004,22 @@ enum : uint8_t {
};
typedef uint8_t tBTM_PM_MODE;

inline std::string power_mode_text(tBTM_PM_MODE mode) {
  std::string s = base::StringPrintf((mode & BTM_PM_MD_FORCE) ? "" : "forced:");
  switch (mode & ~BTM_PM_MD_FORCE) {
    case BTM_PM_MD_ACTIVE:
      return s + std::string("active");
    case BTM_PM_MD_HOLD:
      return s + std::string("hold");
    case BTM_PM_MD_SNIFF:
      return s + std::string("sniff");
    case BTM_PM_MD_PARK:
      return s + std::string("park");
    default:
      return s + std::string("UNKNOWN");
  }
}

#define BTM_PM_SET_ONLY_ID 0x80

/* Operation codes */