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

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

Conform enum logging bt_transport_text

Bug: 188074901
Tag: #refactor
Test: gd/cert/run
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: Icb294f805afcded1cce149dabb1e6244d0bbdcc1
parent 5b480e9f
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -23,13 +23,18 @@
#define BT_TRANSPORT_LE 2
typedef uint8_t tBT_TRANSPORT;

inline std::string bt_transport_text(tBT_TRANSPORT transport) {
#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code

inline std::string bt_transport_text(const tBT_TRANSPORT& transport) {
  switch (transport) {
    case BT_TRANSPORT_BR_EDR:
      return std::string("br_edr");
    case BT_TRANSPORT_LE:
      return std::string("le");
    CASE_RETURN_TEXT(BT_TRANSPORT_AUTO);
    CASE_RETURN_TEXT(BT_TRANSPORT_BR_EDR);
    CASE_RETURN_TEXT(BT_TRANSPORT_LE);
    default:
      return std::string("unknown");
      return std::string("UNKNOWN[") + std::to_string(transport) +
             std::string("]");
  }
}
#undef CASE_RETURN_TEXT