Compare commits

...

6 Commits

Author SHA1 Message Date
vits71 074f4ef03d
Merge e233233b94 into 80904dd84c 2024-10-03 15:29:13 -04:00
Vedant Naik 80904dd84c Device: Gigastar: Add TC10 2024-10-03 19:14:33 +00:00
Kyle Schwarz e2bd0b5a3e Device: Fix getHardwareInfo() timeout 2024-10-02 22:19:54 +00:00
Bryant Jones 24f291dc83 Device: Comet: Update settings 2024-09-26 20:42:41 +00:00
Bryant Jones ee7b66625a Network: Add support for new networks on LIN, SPI, and OP Eth 2024-09-25 14:09:38 -04:00
Vít Šembera e233233b94 Fixed Npcap related errors in PCAPDLL::PCAPDLL() 2024-07-18 13:26:39 +02:00
8 changed files with 194 additions and 6 deletions

View File

@ -14,7 +14,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,

View File

@ -166,6 +166,24 @@ public:
MDIO6 = 550,
MDIO7 = 551,
MDIO8 = 552,
OP_Ethernet13 = 553,
OP_Ethernet14 = 554,
OP_Ethernet15 = 555,
OP_Ethernet16 = 556,
SPI3 = 557,
SPI4 = 558,
SPI5 = 559,
SPI6 = 560,
SPI7 = 561,
SPI8 = 562,
LIN9 = 563,
LIN10 = 564,
LIN11 = 565,
LIN12 = 566,
LIN13 = 567,
LIN14 = 568,
LIN15 = 569,
LIN16 = 570,
Any = 0xfffe, // Never actually set as type, but used as flag for filtering
Invalid = 0xffff
};
@ -270,6 +288,24 @@ public:
MDIO6 = 80,
MDIO7 = 81,
MDIO8 = 82,
OP_Ethernet13 = 83,
OP_Ethernet14 = 84,
OP_Ethernet15 = 85,
OP_Ethernet16 = 86,
SPI3 = 87,
SPI4 = 88,
SPI5 = 89,
SPI6 = 90,
SPI7 = 91,
SPI8 = 92,
LIN9 = 93,
LIN10 = 94,
LIN11 = 95,
LIN12 = 96,
LIN13 = 97,
LIN14 = 98,
LIN15 = 99,
LIN16 = 100,
};
static const char* GetTypeString(Type type) {
switch(type) {
@ -506,6 +542,14 @@ public:
case NetID::LIN6:
case NetID::LIN7:
case NetID::LIN8:
case NetID::LIN9:
case NetID::LIN10:
case NetID::LIN11:
case NetID::LIN12:
case NetID::LIN13:
case NetID::LIN14:
case NetID::LIN15:
case NetID::LIN16:
return Type::LIN;
case NetID::FlexRay:
case NetID::FlexRay1a:
@ -559,6 +603,10 @@ public:
case NetID::OP_Ethernet10:
case NetID::OP_Ethernet11:
case NetID::OP_Ethernet12:
case NetID::OP_Ethernet13:
case NetID::OP_Ethernet14:
case NetID::OP_Ethernet15:
case NetID::OP_Ethernet16:
return Type::Ethernet;
case NetID::LSFTCAN:
case NetID::LSFTCAN2:
@ -581,6 +629,12 @@ public:
return Type::A2B;
case NetID::SPI1:
case NetID::SPI2:
case NetID::SPI3:
case NetID::SPI4:
case NetID::SPI5:
case NetID::SPI6:
case NetID::SPI7:
case NetID::SPI8:
return Type::SPI;
case NetID::MDIO1:
case NetID::MDIO2:
@ -770,6 +824,14 @@ public:
return "FlexRay 2";
case NetID::OP_Ethernet12:
return "OP (BR) Ethernet 12";
case NetID::OP_Ethernet13:
return "OP (BR) Ethernet 13";
case NetID::OP_Ethernet14:
return "OP (BR) Ethernet 14";
case NetID::OP_Ethernet15:
return "OP (BR) Ethernet 15";
case NetID::OP_Ethernet16:
return "OP (BR) Ethernet 16";
case NetID::I2C:
return "I2C";
case NetID::MOST25:
@ -850,12 +912,40 @@ public:
return "LIN 07";
case NetID::LIN8:
return "LIN 08";
case NetID::LIN9:
return "LIN 09";
case NetID::LIN10:
return "LIN 10";
case NetID::LIN11:
return "LIN 11";
case NetID::LIN12:
return "LIN 12";
case NetID::LIN13:
return "LIN 13";
case NetID::LIN14:
return "LIN 14";
case NetID::LIN15:
return "LIN 15";
case NetID::LIN16:
return "LIN 16";
case NetID::WBMS:
return "WBMS";
case NetID::SPI1:
return "SPI 1";
case NetID::SPI2:
return "SPI 2";
case NetID::SPI3:
return "SPI 3";
case NetID::SPI4:
return "SPI 4";
case NetID::SPI5:
return "SPI 5";
case NetID::SPI6:
return "SPI 6";
case NetID::SPI7:
return "SPI 7";
case NetID::SPI8:
return "SPI 8";
case NetID::MDIO1:
return "MDIO 1";
case NetID::MDIO2:
@ -976,6 +1066,14 @@ public:
return CoreMini::OP_Ethernet11;
case NetID::OP_Ethernet12:
return CoreMini::OP_Ethernet12;
case NetID::OP_Ethernet13:
return CoreMini::OP_Ethernet13;
case NetID::OP_Ethernet14:
return CoreMini::OP_Ethernet14;
case NetID::OP_Ethernet15:
return CoreMini::OP_Ethernet15;
case NetID::OP_Ethernet16:
return CoreMini::OP_Ethernet16;
case NetID::TCP:
return CoreMini::TCPVirtual;
case NetID::UDP:
@ -1024,10 +1122,38 @@ public:
return CoreMini::LIN7;
case NetID::LIN8:
return CoreMini::LIN8;
case NetID::LIN9:
return CoreMini::LIN9;
case NetID::LIN10:
return CoreMini::LIN10;
case NetID::LIN11:
return CoreMini::LIN11;
case NetID::LIN12:
return CoreMini::LIN12;
case NetID::LIN13:
return CoreMini::LIN13;
case NetID::LIN14:
return CoreMini::LIN14;
case NetID::LIN15:
return CoreMini::LIN15;
case NetID::LIN16:
return CoreMini::LIN16;
case NetID::SPI1:
return CoreMini::SPI1;
case NetID::SPI2:
return CoreMini::SPI2;
case NetID::SPI3:
return CoreMini::SPI3;
case NetID::SPI4:
return CoreMini::SPI4;
case NetID::SPI5:
return CoreMini::SPI5;
case NetID::SPI6:
return CoreMini::SPI6;
case NetID::SPI7:
return CoreMini::SPI7;
case NetID::SPI8:
return CoreMini::SPI8;
case NetID::MDIO1:
return CoreMini::MDIO1;
case NetID::MDIO2:
@ -1146,6 +1272,14 @@ public:
return NetID::OP_Ethernet11;
case CoreMini::OP_Ethernet12:
return NetID::OP_Ethernet12;
case CoreMini::OP_Ethernet13:
return NetID::OP_Ethernet13;
case CoreMini::OP_Ethernet14:
return NetID::OP_Ethernet14;
case CoreMini::OP_Ethernet15:
return NetID::OP_Ethernet15;
case CoreMini::OP_Ethernet16:
return NetID::OP_Ethernet16;
case CoreMini::TCPVirtual:
return NetID::TCP;
case CoreMini::UDPVirtual:
@ -1194,10 +1328,38 @@ public:
return NetID::LIN7;
case CoreMini::LIN8:
return NetID::LIN8;
case CoreMini::LIN9:
return NetID::LIN9;
case CoreMini::LIN10:
return NetID::LIN10;
case CoreMini::LIN11:
return NetID::LIN11;
case CoreMini::LIN12:
return NetID::LIN12;
case CoreMini::LIN13:
return NetID::LIN13;
case CoreMini::LIN14:
return NetID::LIN14;
case CoreMini::LIN15:
return NetID::LIN15;
case CoreMini::LIN16:
return NetID::LIN16;
case CoreMini::SPI1:
return NetID::SPI1;
case CoreMini::SPI2:
return NetID::SPI2;
case CoreMini::SPI3:
return NetID::SPI3;
case CoreMini::SPI4:
return NetID::SPI4;
case CoreMini::SPI5:
return NetID::SPI5;
case CoreMini::SPI6:
return NetID::SPI6;
case CoreMini::SPI7:
return NetID::SPI7;
case CoreMini::SPI8:
return NetID::SPI8;
case CoreMini::MDIO1:
return NetID::MDIO1;
case CoreMini::MDIO2:

View File

@ -229,7 +229,7 @@ public:
virtual size_t getNetworkCountByType(Network::Type) const;
virtual Network getNetworkByNumber(Network::Type, size_t) const;
std::shared_ptr<HardwareInfo> getHardwareInfo(std::chrono::milliseconds timeout = std::chrono::milliseconds(2));
std::shared_ptr<HardwareInfo> getHardwareInfo(std::chrono::milliseconds timeout = std::chrono::milliseconds(100));
/**

View File

@ -395,6 +395,16 @@ typedef struct ETHERNET10T1S_SETTINGS_t
#define ETHERNET10T1S_SETTINGS_FLAG_ENABLE_PLCA 0x01
#define ETHERNET10T1S_SETTINGS_FLAG_TERMINATION 0x02
#define ETHERNET10T1S_SETTINGS_FLAG_BUS_DECODING_BEACONS 0x04
#define ETHERNET10T1S_SETTINGS_FLAG_BUS_DECODING_ALL 0x08
typedef struct ETHERNET10T1S_SETTINGS_EXT_t
{
uint8_t enable_multi_id; // Mask representing whether ID at corresponding bit enabled or not
uint8_t multi_id[7];
uint8_t rsvd[8];
} ETHERNET10T1S_SETTINGS_EXT;
#define ETHERNET10T1S_SETTINGS_EXT_SIZE 16
#define ETHERNET_SETTINGS10G_FLAG_FULL_DUPLEX 0x01
#define ETHERNET_SETTINGS10G_FLAG_AUTO_NEG 0x02

View File

@ -71,6 +71,9 @@ typedef struct {
ETHERNET10T1S_SETTINGS t1s2;
uint64_t network_enables_5;
LIN_SETTINGS lin1;
// 10T1S Extended settings
ETHERNET10T1S_SETTINGS_EXT t1s1Ext;
ETHERNET10T1S_SETTINGS_EXT t1s2Ext;
} radcomet_settings_t;
#pragma pack(pop)
@ -80,7 +83,7 @@ typedef struct {
#ifdef __cplusplus
static_assert(sizeof(radcomet_settings_t) == 466, "RADComet settings size mismatch");
static_assert(sizeof(radcomet_settings_t) == 498, "RADComet settings size mismatch");
#include <iostream>

View File

@ -68,11 +68,20 @@ typedef struct {
ETHERNET_SETTINGS2 ethT1s6;
ETHERNET10T1S_SETTINGS t1s6;
LIN_SETTINGS lin1;
// 10T1S Extended Settings
ETHERNET10T1S_SETTINGS_EXT t1s1Ext;
ETHERNET10T1S_SETTINGS_EXT t1s2Ext;
ETHERNET10T1S_SETTINGS_EXT t1s3Ext;
ETHERNET10T1S_SETTINGS_EXT t1s4Ext;
ETHERNET10T1S_SETTINGS_EXT t1s5Ext;
ETHERNET10T1S_SETTINGS_EXT t1s6Ext;
} radcomet3_settings_t;
#pragma pack(pop)
#ifdef __cplusplus
static_assert(sizeof(radcomet3_settings_t) == 674, "RADComet3 settings size mismatch");
#include <iostream>
class RADComet3Settings : public IDeviceSettings {

View File

@ -21,7 +21,8 @@ public:
size_t getEthernetActivationLineCount() const override { return 1; }
bool getEthPhyRegControlSupported() const override { return true; }
bool supportsTC10() const override { return true; }
protected:
RADGigastar(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
initialize<RADGigastarSettings>(makeDriver);

View File

@ -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);