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

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

Add stack/include/btm_api_types::power_mode_status_text

Towards loggable code

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

Change-Id: I0b45c76cec34d7bcd1358066514a5c09c6d5f6bf
parent 4abfab56
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -973,6 +973,27 @@ enum : uint8_t {
};
typedef uint8_t tBTM_PM_STATUS;

inline std::string power_mode_status_text(tBTM_PM_STATUS status) {
  switch (status) {
    case BTM_PM_STS_ACTIVE:
      return std::string("active");
    case BTM_PM_STS_HOLD:
      return std::string("hold");
    case BTM_PM_STS_SNIFF:
      return std::string("sniff");
    case BTM_PM_STS_PARK:
      return std::string("park");
    case BTM_PM_STS_SSR:
      return std::string("sniff_subrating");
    case BTM_PM_STS_PENDING:
      return std::string("pending");
    case BTM_PM_STS_ERROR:
      return std::string("error");
    default:
      return std::string("UNKNOWN");
  }
}

/* BTM Power manager modes */
enum : uint8_t {
  BTM_PM_MD_ACTIVE = HCI_MODE_ACTIVE,  // 0x00