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

Commit 6b4eef3e authored by Chris Manton's avatar Chris Manton
Browse files

Add types::BtTransportText

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working
Test: acts -tc BleCocTest
Change-Id: I6fc84ef84a169f2a04b9aa7726206c58d8848021
parent 679e6e10
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

#pragma once

#include <string>

#define BT_TRANSPORT_INVALID 0
#define BT_TRANSPORT_UNKNOWN BT_TRANSPORT_INVALID
#define BT_TRANSPORT_AUTO BT_TRANSPORT_INVALID
@@ -23,3 +25,14 @@
#define BT_TRANSPORT_BR_EDR 1
#define BT_TRANSPORT_LE 2
typedef uint8_t tBT_TRANSPORT;

inline std::string BtTransportText(tBT_TRANSPORT transport) {
  switch (transport) {
    case BT_TRANSPORT_BR_EDR:
      return std::string("br_edr");
    case BT_TRANSPORT_LE:
      return std::string("le");
    default:
      return std::string("unknown");
  }
}