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

Commit 36b07485 authored by Jeongik Cha's avatar Jeongik Cha
Browse files

Send response as combined form

As-is: root-canal's response consists of packet type and payload
separately

In the case of several request in parallel, the responses could be
overlapped, so make it combined to avoid the situation.

Test: atest AdapterServiceTest
Bug: 182167189
Change-Id: I19b99f6399777e927b81c26366d8e02ae577936e
parent f40ecd9c
Loading
Loading
Loading
Loading
+1 −9
Original line number Diff line number Diff line
@@ -127,15 +127,7 @@ void HciSocketDevice::SendHci(
    return;
  }
  uint8_t type = static_cast<uint8_t>(packet_type);
  int bytes_written;
  bytes_written = write(socket_file_descriptor_, &type, sizeof(type));
  if (bytes_written != sizeof(type)) {
    LOG_WARN("bytes_written %d != sizeof(type)", bytes_written);
  }
  bytes_written = write(socket_file_descriptor_, packet->data(), packet->size());
  if (static_cast<size_t>(bytes_written) != packet->size()) {
    LOG_WARN("bytes_written %d != packet->size", bytes_written);
  }
  h4_.Send(type, packet->data(), packet->size());
}

void HciSocketDevice::RegisterCloseCallback(std::function<void()> close_callback) {