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

Commit 704cfaee authored by Hansong Zhang's avatar Hansong Zhang Committed by android-build-merger
Browse files

SnoopLogger: Always flush for host build am: 06ec489e am: 35ec7ced am: f4c1a500

am: c46bc4bb

Change-Id: I9b9793469b7273a9c385430f847520ab0b4f8bec
parents 5fc57417 c46bc4bb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -113,6 +113,7 @@ class InternalHciCallbacks : public IBluetoothHciCallbacks {
}  // namespace

const std::string SnoopLogger::DefaultFilePath = "/data/misc/bluetooth/logs/btsnoop_hci.log";
const bool SnoopLogger::AlwaysFlush = false;

class HciHalHidl : public HciHal {
 public:
+1 −0
Original line number Diff line number Diff line
@@ -87,6 +87,7 @@ namespace bluetooth {
namespace hal {

const std::string SnoopLogger::DefaultFilePath = "/tmp/btsnoop_hci.log";
const bool SnoopLogger::AlwaysFlush = true;

class HciHalHostRootcanal : public HciHal {
 public:
+1 −0
Original line number Diff line number Diff line
@@ -119,6 +119,7 @@ void SnoopLogger::capture(const HciPacket& packet, Direction direction, PacketTy
                                    .type = static_cast<uint8_t>(type)};
  btsnoop_ostream_.write(reinterpret_cast<const char*>(&header), sizeof(btsnoop_packet_header_t));
  btsnoop_ostream_.write(reinterpret_cast<const char*>(packet.data()), packet.size());
  if (AlwaysFlush) btsnoop_ostream_.flush();
}

void SnoopLogger::ListDependencies(ModuleList* list) {
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ class SnoopLogger : public ::bluetooth::Module {
  static const std::string DefaultFilePath;
  // Set File Path before module is started to ensure all packets are written to the right file
  static void SetFilePath(const std::string& filename);
  // Flag to allow flush into persistent memory on every packet captured. This is enabled on host for debugging.
  static const bool AlwaysFlush;

  enum class PacketType {
    CMD = 1,