Communication: Add LogDataMessage

This commit is contained in:
Keith Nash
2025-05-16 19:36:27 +00:00
committed by Kyle Schwarz
parent b94ade1ef6
commit b3d47f2ae5
10 changed files with 63 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
#include "icsneo/communication/message/logdatamessage.h"
#include <iostream>
using namespace icsneo;
std::shared_ptr<LogDataMessage> LogDataMessage::DecodeToMessage(const std::vector<uint8_t>& bytestream) {
if(bytestream.size() % 2 != 0)
return nullptr;
const auto* begin = (char16_t*)bytestream.data();
const auto* end = begin + (bytestream.size() / sizeof(char16_t));
return std::make_shared<LogDataMessage>(std::wstring(begin,end));
}