From: Chris Manton Date: Mon, 21 Sep 2020 20:55:50 +0000 (-0700) Subject: Add hci role text X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=68559b914b;p=android-x86%2Fsystem-bt.git Add hci role text Towards loggable code Bug: 163134718 Tag: #refactor Test: acts -tc BleCocTest Test: ble paired 2 phones Change-Id: I713403023a53905821e39ad9a8251bab9a8779ca --- diff --git a/stack/include/hcidefs.h b/stack/include/hcidefs.h index 69e517a42..f283d1742 100644 --- a/stack/include/hcidefs.h +++ b/stack/include/hcidefs.h @@ -848,6 +848,16 @@ enum : uint8_t { HCI_ROLE_UNKNOWN = 0xff, }; typedef uint8_t hci_role_t; +inline std::string RoleText(hci_role_t role) { + switch (role) { + case HCI_ROLE_MASTER: + return std::string("master"); + case HCI_ROLE_SLAVE: + return std::string("slave"); + default: + return std::string("unknown"); + } +} /* HCI mode defenitions */ #define HCI_MODE_ACTIVE 0x00