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

Commit 572b0ac0 authored by Chris Manton's avatar Chris Manton
Browse files

enum-ify stack/include/hcidefs::HCI_ROLE_

Also add typed storage

Towards readable code

Bug: 163134718
Tag: #refactor
Test: acts -tc BleCocTest
Test: ble paired 2 phones
Change-Id: I7d7097e8ba92bd6035ba027df93a905274eaec27
parent 92e03229
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -842,9 +842,12 @@ constexpr uint8_t HCI_LE_STATES_INIT_MASTER_SLAVE_BIT = 41;
#define HCI_MAX_INQ_LAP 0x9E8B3F

/* HCI role defenitions */
#define HCI_ROLE_MASTER 0x00
#define HCI_ROLE_SLAVE 0x01
#define HCI_ROLE_UNKNOWN 0xff
enum : uint8_t {
  HCI_ROLE_MASTER = 0x00,
  HCI_ROLE_SLAVE = 0x01,
  HCI_ROLE_UNKNOWN = 0xff,
};
typedef uint8_t hci_role_t;

/* HCI mode defenitions */
#define HCI_MODE_ACTIVE 0x00