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

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

Add main/shim/helpers::ToHciRole

Towards shimmable code

Bug: 176960731
Tag: #refactor
Test: gd/cert/run

Change-Id: I576be1908b70116b9aeeaa56c0e1601480ccbcb2
parent 79df2cab
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -128,6 +128,17 @@ inline uint8_t ToLegacyRole(hci::Role role) {
  return static_cast<uint8_t>(role);
}

inline hci::Role ToHciRole(hci_role_t role) {
  switch (role) {
    case HCI_ROLE_CENTRAL:
      return hci::Role::CENTRAL;
    case HCI_ROLE_PERIPHERAL:
      return hci::Role::PERIPHERAL;
    default:
      ASSERT_LOG(false, "Unable to determine legacy role:%u", role);
  }
}

inline tHCI_STATUS ToLegacyHciErrorCode(hci::ErrorCode reason) {
  switch (reason) {
    case hci::ErrorCode::SUCCESS: