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

Commit 6df30ff4 authored by Henri Chataing's avatar Henri Chataing
Browse files

RootCanal: Reserve the range of connection handles 0xe00-0xefe for CIS

connections

Bug: 253535400
Test: m root-canal
Change-Id: Iaaa6130799e56a7aadf56999394c247f6460dcc7
parent aabf926d
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -46,7 +46,11 @@ bool AclConnectionHandler::HasScoHandle(uint16_t handle) const {
}

uint16_t AclConnectionHandler::GetUnusedHandle() {
  while (HasHandle(last_handle_) || HasScoHandle(last_handle_)) {
  // Keep a reserved range of handles for CIS connections implemented
  // in the rust module.
  while (HasHandle(last_handle_) || HasScoHandle(last_handle_) ||
         (last_handle_ >= kCisHandleRangeStart &&
          last_handle_ < kCisHandleRangeEnd)) {
    last_handle_ = (last_handle_ + 1) % kReservedHandle;
  }
  uint16_t unused_handle = last_handle_;
+2 −0
Original line number Diff line number Diff line
@@ -29,6 +29,8 @@

namespace rootcanal {
static constexpr uint16_t kReservedHandle = 0xF00;
static constexpr uint16_t kCisHandleRangeStart = 0xE00;
static constexpr uint16_t kCisHandleRangeEnd = 0xEFE;

class AclConnectionHandler {
 public: