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

Commit 9edb70df authored by Chris Manton's avatar Chris Manton
Browse files

Add bd_features_text

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

Change-Id: If341f69a65b484d88275d95a60cfd15ab64ede5e
parent e0821e6a
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -611,6 +611,20 @@ typedef uint8_t BD_NAME[BD_NAME_LEN + 1]; /* Device name */
typedef uint8_t
    BD_FEATURES[BD_FEATURES_LEN]; /* LMP features supported by device */

#ifdef __cplusplus
// Bit order [0]:0-7 [1]:8-15 ... [7]:56-63
inline std::string bd_features_text(BD_FEATURES features) {
  uint8_t len = BD_FEATURES_LEN;
  char buf[255];
  char* pbuf = buf;
  uint8_t* b = features;
  while (len--) {
    pbuf += sprintf(pbuf, "0x%02x ", *b++);
  }
  return std::string(buf);
}
#endif  // __cplusplus

#define BT_EVENT_MASK_LEN 8
typedef uint8_t BT_EVENT_MASK[BT_EVENT_MASK_LEN]; /* Event Mask */