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

Commit 37f080af authored by Chris Manton's avatar Chris Manton
Browse files

Add stack/include/bt_types::AddressTypeText

Towards loggable code

Bug: 163134718
Tag: #refactor
Test: act.py -tc BleCocTest
Test: ble paired 2 phones
Test: classic paired Bose SoundLink

Change-Id: I43b7c46837435ea544eb2e8c90ef981a3bdf3e2f
parent 6ae59ef3
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -754,6 +754,24 @@ typedef struct {
#define BLE_ADDR_RANDOM_ID 0x03
#define BLE_ADDR_ANONYMOUS 0xFF
typedef uint8_t tBLE_ADDR_TYPE;
#ifdef __cplusplus
inline std::string AddressTypeText(tBLE_ADDR_TYPE type) {
  switch (type) {
    case BLE_ADDR_PUBLIC:
      return std::string("public");
    case BLE_ADDR_RANDOM:
      return std::string("random");
    case BLE_ADDR_PUBLIC_ID:
      return std::string("public identity");
    case BLE_ADDR_RANDOM_ID:
      return std::string("random identity");
    case BLE_ADDR_ANONYMOUS:
      return std::string("anonymous");
    default:
      return std::string("unknown");
  }
}
#endif  // __cplusplus

/* BLE ADDR type ID bit */
#define BLE_ADDR_TYPE_ID_BIT 0x02