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

Commit e2dae5a9 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Localize BD_FEATURES to used file am: b222811d

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1749835

Change-Id: Iefe421858efc05b5d497fbc32f63bf706a5a8a4f
parents 39804281 b222811d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <unordered_set>
#include <vector>

#include "stack/acl/peer_packet_types.h"
#include "stack/include/acl_api_types.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_api_types.h"
+16 −0
Original line number Diff line number Diff line
@@ -19,6 +19,22 @@
#include "stack/include/bt_types.h"
#include "stack/include/hcidefs.h"

#define BD_FEATURES_LEN 8
typedef uint8_t
    BD_FEATURES[BD_FEATURES_LEN]; /* LMP features supported by device */

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

/**
 * Create a bitmask of packet types from the remote feature
 */
+0 −18
Original line number Diff line number Diff line
@@ -348,24 +348,6 @@ typedef uint8_t PIN_CODE[PIN_CODE_LEN]; /* Pin Code (upto 128 bits) MSB is 0 */
#define BD_NAME_LEN 248
typedef uint8_t BD_NAME[BD_NAME_LEN + 1]; /* Device name */

#define BD_FEATURES_LEN 8
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(const BD_FEATURES& features) {
  uint8_t len = BD_FEATURES_LEN;
  char buf[255];
  char* pbuf = buf;
  const 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 */