Compare commits
5 Commits
ab472a24df
...
3c242448cd
| Author | SHA1 | Date |
|---|---|---|
|
|
3c242448cd | |
|
|
b3d47f2ae5 | |
|
|
b94ade1ef6 | |
|
|
739ff4d637 | |
|
|
e233233b94 |
|
|
@ -13,7 +13,7 @@ option(LIBICSNEO_BUILD_ICSNEOC "Build dynamic C library" ON)
|
|||
option(LIBICSNEO_BUILD_ICSNEOC_STATIC "Build static C library" ON)
|
||||
option(LIBICSNEO_BUILD_ICSNEOLEGACY "Build icsnVC40 compatibility library" ON)
|
||||
option(LIBICSNEO_BUILD_ICSNEOLEGACY_STATIC "Build static icsnVC40 compatibility library" ON)
|
||||
set(LIBICSNEO_NPCAP_INCLUDE_DIR "" CACHE STRING "Npcap include directory; set to build with Npcap")
|
||||
set(LIBICSNEO_NPCAP_INCLUDE_DIR "C:/Users/Vit/source/repos/npcap-sdk-1.13/Include" CACHE STRING "Npcap include directory; set to build with Npcap")
|
||||
|
||||
# Device Drivers
|
||||
# You almost certainly don't want firmio for your build,
|
||||
|
|
@ -246,6 +246,7 @@ set(SRC_FILES
|
|||
communication/message/ethphymessage.cpp
|
||||
communication/message/linmessage.cpp
|
||||
communication/message/livedatamessage.cpp
|
||||
communication/message/logdatamessage.cpp
|
||||
communication/message/tc10statusmessage.cpp
|
||||
communication/message/gptpstatusmessage.cpp
|
||||
communication/message/ethernetstatusmessage.cpp
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@
|
|||
#include "icsneo/communication/message/mdiomessage.h"
|
||||
#include "icsneo/communication/message/extendeddatamessage.h"
|
||||
#include "icsneo/communication/message/livedatamessage.h"
|
||||
#include "icsneo/communication/message/logdatamessage.h"
|
||||
#include "icsneo/communication/message/diskdatamessage.h"
|
||||
#include "icsneo/communication/message/hardwareinfo.h"
|
||||
#include "icsneo/communication/message/tc10statusmessage.h"
|
||||
|
|
@ -491,7 +492,16 @@ bool Decoder::decode(std::shared_ptr<Message>& result, const std::shared_ptr<Pac
|
|||
result = std::make_shared<DiskDataMessage>(std::move(packet->data));
|
||||
return true;
|
||||
}
|
||||
case Network::NetID::Data_To_Host: {
|
||||
result = LogDataMessage::DecodeToMessage(packet->data);
|
||||
if(!result) {
|
||||
report(APIEvent::Type::PacketDecodingError, APIEvent::Severity::EventWarning);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
|
|
@ -405,6 +405,14 @@ bool Device::close() {
|
|||
return com->close();
|
||||
}
|
||||
|
||||
bool Device::enableLogData() {
|
||||
return com->sendCommand(Command::EnableLogData, true);
|
||||
}
|
||||
|
||||
bool Device::disableLogData() {
|
||||
return com->sendCommand(Command::EnableLogData, false);
|
||||
}
|
||||
|
||||
bool Device::goOnline() {
|
||||
if(!enableNetworkCommunication(true))
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ enum class Command : uint8_t {
|
|||
FlexRayControl = 0xF3,
|
||||
CoreMiniPreload = 0xF4, // Previously known as RED_CMD_COREMINI_PRELOAD
|
||||
PHYControlRegisters = 0xEF,
|
||||
EnableLogData = 0xF6,
|
||||
};
|
||||
|
||||
enum class ExtendedCommand : uint16_t {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
#ifndef __LOGDATAMESSAGE_H_
|
||||
#define __LOGDATAMESSAGE_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/communication/message/message.h"
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class LogDataMessage : public RawMessage {
|
||||
public:
|
||||
static std::shared_ptr<LogDataMessage> DecodeToMessage(const std::vector<uint8_t>& bytestream);
|
||||
|
||||
LogDataMessage(std::wstring logDataString) :
|
||||
RawMessage(Message::Type::LogData, Network::NetID::Data_To_Host), logMessage(logDataString) {}
|
||||
|
||||
std::wstring logMessage;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
|
|
@ -44,6 +44,7 @@ public:
|
|||
AppError = 0x8012,
|
||||
GPTPStatus = 0x8013,
|
||||
EthernetStatus = 0x8014,
|
||||
LogData = 0x8015,
|
||||
};
|
||||
|
||||
Message(Type t) : type(t) {}
|
||||
|
|
|
|||
|
|
@ -583,6 +583,7 @@ public:
|
|||
case NetID::RED_GET_RTC:
|
||||
case NetID::DiskData:
|
||||
case NetID::RED_App_Error:
|
||||
case NetID::Data_To_Host:
|
||||
return Type::Internal;
|
||||
case NetID::Invalid:
|
||||
case NetID::Any:
|
||||
|
|
|
|||
|
|
@ -151,6 +151,8 @@ public:
|
|||
virtual bool isDisconnected() const { return com->isDisconnected(); }
|
||||
virtual bool goOnline();
|
||||
virtual bool goOffline();
|
||||
virtual bool enableLogData();
|
||||
virtual bool disableLogData();
|
||||
|
||||
enum class PreloadReturn : uint8_t
|
||||
{
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ public:
|
|||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
size_t getEthernetActivationLineCount() const override { return 2; }
|
||||
protected:
|
||||
NeoVIFIRE3(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<NeoVIFIRE3Settings, Disk::ExtExtractorDiskReadDriver, Disk::NeoMemoryDiskDriver>(makeDriver);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "icsneo/communication/message/a2bmessage.h"
|
||||
#include "icsneo/communication/message/linmessage.h"
|
||||
#include "icsneo/communication/message/mdiomessage.h"
|
||||
#include "icsneo/communication/message/logdatamessage.h"
|
||||
|
||||
#include "icsneo/communication/message/callback/streamoutput/a2bwavoutput.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -34,9 +34,12 @@ PCAPDLL::PCAPDLL()
|
|||
int len = GetSystemDirectory(dllPath, 480); // be safe
|
||||
if (len) {
|
||||
_tcscat_s(dllPath, 512, TEXT("\\Npcap"));
|
||||
cookie = AddDllDirectory(dllPath);
|
||||
WCHAR dllPath_w[512] = { 0 };
|
||||
if (mbstowcs(dllPath_w, dllPath, 512)) {
|
||||
cookie = AddDllDirectory(dllPath_w);
|
||||
}
|
||||
}
|
||||
dll = LoadLibraryEx(TEXT("wpcap.dll"), nullptr, LOAD_LIBRARY_SEARCH_USER_DIRS);
|
||||
dll = LoadLibraryEx(TEXT("wpcap.dll"), nullptr, LOAD_LIBRARY_SEARCH_DEFAULT_DIRS);
|
||||
|
||||
if (cookie)
|
||||
RemoveDllDirectory(cookie);
|
||||
|
|
|
|||
Loading…
Reference in New Issue