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

Commit 5499a8df authored by Chris Manton's avatar Chris Manton
Browse files

Add bta/include/bta_api::preferred_role_text

Towards loggable code

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

Change-Id: I105d807a90ede26af7b0ef59a3a0e5b989997799
parent a3243810
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

#include "bt_target.h"  // Must be first to define build configuration

#include "osi/include/log.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_api_types.h"
#include "stack/include/btm_ble_api_types.h"
@@ -127,6 +128,17 @@ typedef uint16_t tBTA_DM_CONN;

typedef uint8_t tBTA_PREF_ROLES;

inline std::string preferred_role_text(const tBTA_PREF_ROLES& role) {
  switch (role) {
    CASE_RETURN_TEXT(BTA_ANY_ROLE);
    CASE_RETURN_TEXT(BTA_CENTRAL_ROLE_PREF);
    CASE_RETURN_TEXT(BTA_CENTRAL_ROLE_ONLY);
    CASE_RETURN_TEXT(BTA_PERIPHERAL_ROLE_ONLY);
    default:
      return std::string("UNKNOWN:%hhu", role);
  }
}

enum {

  BTA_DM_NO_SCATTERNET,      /* Device doesn't support scatternet, it might