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

Commit 798eaf16 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7239571 from e35217db to sc-release

Change-Id: Ice6da95ed635a62332671325214c33596403f1cd
parents b01b27ba e35217db
Loading
Loading
Loading
Loading
+20 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@
 *  Type definitions and return values
 ******************************************************************************/

typedef enum {
typedef enum : unsigned {
  BTIF_HH_DISABLED = 0,
  BTIF_HH_ENABLED,
  BTIF_HH_DISABLING,
@@ -56,6 +56,25 @@ typedef enum {
  BTIF_HH_DEV_DISCONNECTED
} BTIF_HH_STATUS;

#define CASE_RETURN_TEXT(code) \
  case code:                   \
    return #code

inline std::string btif_hh_status_text(const BTIF_HH_STATUS& status) {
  switch (status) {
    CASE_RETURN_TEXT(BTIF_HH_DISABLED);
    CASE_RETURN_TEXT(BTIF_HH_ENABLED);
    CASE_RETURN_TEXT(BTIF_HH_DISABLING);
    CASE_RETURN_TEXT(BTIF_HH_DEV_UNKNOWN);
    CASE_RETURN_TEXT(BTIF_HH_DEV_CONNECTING);
    CASE_RETURN_TEXT(BTIF_HH_DEV_CONNECTED);
    CASE_RETURN_TEXT(BTIF_HH_DEV_DISCONNECTED);
    default:
      return std::string("UNKNOWN[%hhu]", status);
  }
}
#undef CASE_RETURN_TEXT

typedef struct {
  bthh_connection_state_t dev_status;
  uint8_t dev_handle;