protobuf server

This commit is contained in:
Ivan I. Ovchinnikov
2026-07-28 20:46:41 +03:00
parent 5a702fe0f8
commit 8c4d40b66a
11 changed files with 150 additions and 56 deletions
+10 -5
View File
@@ -33,13 +33,18 @@ void PayloadWindow::sendHexPayload(const std::string& hexString, ConnectionWindo
return;
}
int bytes_written = sp_nonblocking_write(port, bytes.data(), bytes.size());
const int bytesWritten = sp_nonblocking_write(port, bytes.data(), bytes.size());
if (bytes_written >= 0) {
if (bytesWritten >= 0) {
std::stringstream log_ss;
log_ss << "[TX] Sent " << bytes_written << " bytes: ";
for (size_t i = 0; i < bytes.size(); ++i) {
log_ss << std::uppercase << std::hex << std::setw(2) << std::setfill('0') << (int)bytes[i] << " ";
log_ss << "[TX] Sent " << bytesWritten << " bytes: ";
for (unsigned char byte : bytes) {
log_ss << std::uppercase
<< std::hex
<< std::setw(2)
<< std::setfill('0')
<< static_cast<int>(byte)
<< " ";
}
connectionWindow.forceLogMessage(log_ss.str());
} else {