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

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

Move power mode types into acl header

Towards readable code

Bug: 163134718
Tag: #refactor
Test: gd/cert/run --host

Change-Id: I5bf2c549ee1230c1a229797d085ef44aefef8edc
parent db875ddd
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -197,7 +197,20 @@ typedef struct {
  uint8_t sca; /* Sleep clock accuracy */
} tACL_CONN;

// Power mode states.
// Used as both value and bitmask
enum : uint8_t {
  BTM_PM_ST_ACTIVE = HCI_MODE_ACTIVE,      // 0x00
  BTM_PM_ST_HOLD = HCI_MODE_HOLD,          // 0x01
  BTM_PM_ST_SNIFF = HCI_MODE_SNIFF,        // 0x02
  BTM_PM_ST_PARK = HCI_MODE_PARK,          // 0x03
  BTM_PM_ST_UNUSED,                        // 0x04
  BTM_PM_ST_PENDING = BTM_PM_STS_PENDING,  // 0x05
  BTM_PM_ST_INVALID = 0x7F,
  BTM_PM_STORED_MASK = 0x80, /* set this mask if the command is stored */
};
typedef uint8_t tBTM_PM_STATE;

typedef struct {
  bool chg_ind;
  tBTM_PM_PWR_MD req_mode[BTM_MAX_PM_RECORDS + 1];
+0 −1
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ StackAclBtmPm internal_;
/*****************************************************************************/
/*      to handle different modes                                            */
/*****************************************************************************/
#define BTM_PM_STORED_MASK 0x80 /* set this mask if the command is stored */
#define BTM_PM_NUM_SET_MODES 3  /* only hold, sniff & park */

#define BTM_PM_GET_MD1 1
+0 −10
Original line number Diff line number Diff line
@@ -77,16 +77,6 @@ typedef struct {
  uint8_t def_inq_scan_mode; /* ??? limited/general/none */
} tBTM_CFG;

typedef enum : uint8_t {
  BTM_PM_ST_ACTIVE = HCI_MODE_ACTIVE,      // 0x00
  BTM_PM_ST_HOLD = HCI_MODE_HOLD,          // 0x01
  BTM_PM_ST_SNIFF = HCI_MODE_SNIFF,        // 0x02
  BTM_PM_ST_PARK = HCI_MODE_PARK,          // 0x03
  BTM_PM_ST_UNUSED,                        // 0x04
  BTM_PM_ST_PENDING = BTM_PM_STS_PENDING,  // 0x05
  BTM_PM_ST_INVALID = 0xFF
} tPOWER_MODE_STATE;

#define BTM_PM_REC_NOT_USED 0
typedef struct {
  tBTM_PM_STATUS_CBACK*