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

Commit b222811d authored by Chris Manton's avatar Chris Manton
Browse files

Localize BD_FEATURES to used file

Bug: 163134718
Tag: #refactor
Test: gd/cert/run
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I9691f1f7b4a37c1c08d210c46c426c896f88d395
parent 3122b935
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 */