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

Commit 84d68db5 authored by Henri Chataing's avatar Henri Chataing Committed by Gerrit Code Review
Browse files

Merge "RootCanal: Rectify the value of the direction field in PCAP records"

parents bd88eaf8 0551d1d9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -52,6 +52,9 @@ void HciSniffer::AppendRecord(PacketDirection packet_direction,
  pcap::WriteRecordHeader(*output_, 4 + 1 + packet.size());

  // http://www.tcpdump.org/linktypes.html LINKTYPE_BLUETOOTH_HCI_H4_WITH_PHDR
  // Note: the description given for the direction bit by tcpdump
  // is in opposition with the implementation in wireshark.
  // The values match wireshark's implementation here.
  char direction[4] = {0, 0, 0, static_cast<char>(packet_direction)};
  uint8_t idc = static_cast<uint8_t>(packet_type);
  output_->write(direction, sizeof(direction));
+2 −2
Original line number Diff line number Diff line
@@ -28,8 +28,8 @@
namespace rootcanal {

enum class PacketDirection : uint8_t {
  CONTROLLER_TO_HOST = 0,
  HOST_TO_CONTROLLER = 1,
  HOST_TO_CONTROLLER = 0,
  CONTROLLER_TO_HOST = 1,
};

// A Hci Transport that logs all the in and out going