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

Commit 17cbccae authored by Chris Manton's avatar Chris Manton
Browse files

Specialize data structures tBTM_PM_STATUS tBTM_PM_MODE

Towards readable code

Bug: 163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I4868fd81c0a5c6c788382f0c81a4d908685642e6
parent 36d0ff84
Loading
Loading
Loading
Loading
+18 −16
Original line number Original line Diff line number Diff line
@@ -986,11 +986,11 @@ typedef void(tBTM_LSTO_CBACK)(const RawAddress& remote_bda, uint16_t timeout);
 *  Power Manager Constants
 *  Power Manager Constants
 ****************************/
 ****************************/
/* BTM Power manager status codes */
/* BTM Power manager status codes */
enum {
enum : uint8_t {
  BTM_PM_STS_ACTIVE = HCI_MODE_ACTIVE,
  BTM_PM_STS_ACTIVE = HCI_MODE_ACTIVE,  // 0x00
  BTM_PM_STS_HOLD = HCI_MODE_HOLD,
  BTM_PM_STS_HOLD = HCI_MODE_HOLD,      // 0x01
  BTM_PM_STS_SNIFF = HCI_MODE_SNIFF,
  BTM_PM_STS_SNIFF = HCI_MODE_SNIFF,    // 0x02
  BTM_PM_STS_PARK = HCI_MODE_PARK,
  BTM_PM_STS_PARK = HCI_MODE_PARK,      // 0x03
  BTM_PM_STS_SSR,     /* report the SSR parameters in HCI_SNIFF_SUB_RATE_EVT */
  BTM_PM_STS_SSR,     /* report the SSR parameters in HCI_SNIFF_SUB_RATE_EVT */
  BTM_PM_STS_PENDING, /* when waiting for status from controller */
  BTM_PM_STS_PENDING, /* when waiting for status from controller */
  BTM_PM_STS_ERROR    /* when HCI command status returns error */
  BTM_PM_STS_ERROR    /* when HCI command status returns error */
@@ -998,11 +998,11 @@ enum {
typedef uint8_t tBTM_PM_STATUS;
typedef uint8_t tBTM_PM_STATUS;


/* BTM Power manager modes */
/* BTM Power manager modes */
enum {
enum : uint8_t {
  BTM_PM_MD_ACTIVE = BTM_PM_STS_ACTIVE,
  BTM_PM_MD_ACTIVE = HCI_MODE_ACTIVE,  // 0x00
  BTM_PM_MD_HOLD = BTM_PM_STS_HOLD,
  BTM_PM_MD_HOLD = HCI_MODE_HOLD,      // 0x01
  BTM_PM_MD_SNIFF = BTM_PM_STS_SNIFF,
  BTM_PM_MD_SNIFF = HCI_MODE_SNIFF,    // 0x02
  BTM_PM_MD_PARK = BTM_PM_STS_PARK,
  BTM_PM_MD_PARK = HCI_MODE_PARK,      // 0x03
  BTM_PM_MD_FORCE = 0x10 /* OR this to force ACL link to a certain mode */
  BTM_PM_MD_FORCE = 0x10 /* OR this to force ACL link to a certain mode */
};
};
typedef uint8_t tBTM_PM_MODE;
typedef uint8_t tBTM_PM_MODE;
@@ -1010,12 +1010,14 @@ typedef uint8_t tBTM_PM_MODE;
#define BTM_PM_SET_ONLY_ID 0x80
#define BTM_PM_SET_ONLY_ID 0x80


/* Operation codes */
/* Operation codes */
typedef enum : uint8_t {
  /* The module wants to set the desired power mode */
  /* The module wants to set the desired power mode */
#define BTM_PM_REG_SET 1
  BTM_PM_REG_SET = (1u << 0),
  /* The module wants to receive mode change event */
  /* The module wants to receive mode change event */
#define BTM_PM_REG_NOTIF 2
  BTM_PM_REG_NOTIF = (1u << 1),
  /* The module does not want to involve with PM anymore */
  /* The module does not want to involve with PM anymore */
#define BTM_PM_DEREG 4
  BTM_PM_DEREG = (1u << 2),
} tBTM_PM_REGISTER;


/************************
/************************
 *  Power Manager Types
 *  Power Manager Types