Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion libraries/Netdump/src/Netdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,25 @@ void Netdump::fileDump(File& outfile, const Filter nf)
fileDumpProcess(outfile, ndp);
}, nf);
}
void Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf)
bool Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf)
{

if (!packetBuffer)
{
packetBuffer = new (std::nothrow) char[tcpBufferSize];

if (!packetBuffer)
{
return false;
}
}
bufferIndex = 0;

schedule_function([&tcpDumpServer, this, nf]()
{
tcpDumpLoop(tcpDumpServer, nf);
});
return true;
}

void Netdump::capture(int netif_idx, const char* data, size_t len, int out, int success)
Expand Down
2 changes: 1 addition & 1 deletion libraries/Netdump/src/Netdump.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Netdump

void printDump(Print& out, Packet::PacketDetail ndd, const Filter nf = nullptr);
void fileDump(File& outfile, const Filter nf = nullptr);
void tcpDump(WiFiServer &tcpDumpServer, const Filter nf = nullptr);
bool tcpDump(WiFiServer &tcpDumpServer, const Filter nf = nullptr);


private:
Expand Down