Compare commits
8 Commits
d29148eec9
...
db9da30f94
| Author | SHA1 | Date |
|---|---|---|
|
|
db9da30f94 | |
|
|
4f83614037 | |
|
|
38a4af8062 | |
|
|
3b95b41be4 | |
|
|
3da31a29b4 | |
|
|
d0f3e593df | |
|
|
90268a4f04 | |
|
|
e233233b94 |
|
|
@ -437,7 +437,7 @@ build python/linux/amd64:
|
|||
CIBW_BEFORE_ALL: yum install -y flex && sh ci/bootstrap-libpcap.sh && sh ci/bootstrap-libusb.sh
|
||||
CIBW_BUILD: "*manylinux*" # no musl
|
||||
CIBW_ARCHS: x86_64
|
||||
DOCKER_HOST: tcp://docker:2375/
|
||||
DOCKER_HOST: unix:///var/run/docker.sock
|
||||
DOCKER_DRIVER: overlay2
|
||||
DOCKER_TLS_CERTDIR: ""
|
||||
CIBW_ENVIRONMENT: CMAKE_PREFIX_PATH=/project/libpcap/install:/project/libusb/install
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ each of the respective APIs.
|
|||
- RAD-Comet 2
|
||||
- RAD-Comet 3
|
||||
- RAD-Galaxy
|
||||
- RAD-Galaxy 2
|
||||
- RAD-Gigastar
|
||||
- RAD-Gigastar 2
|
||||
- RAD-Moon 2
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ pybind11_add_module(icsneopy
|
|||
icsneopy/communication/message/message.cpp
|
||||
icsneopy/communication/message/canmessage.cpp
|
||||
icsneopy/communication/message/ethernetmessage.cpp
|
||||
icsneopy/communication/message/linmessage.cpp
|
||||
icsneopy/communication/message/tc10statusmessage.cpp
|
||||
icsneopy/communication/message/mdiomessage.cpp
|
||||
icsneopy/communication/message/callback/messagecallback.cpp
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
#include <pybind11/functional.h>
|
||||
|
||||
#include "icsneo/communication/message/linmessage.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
void init_linmessage(pybind11::module_& m) {
|
||||
pybind11::class_<LINErrorFlags>(m, "LINErrorFlags")
|
||||
.def_readwrite("ErrRxBreakOnly", &LINErrorFlags::ErrRxBreakOnly)
|
||||
.def_readwrite("ErrRxBreakSyncOnly", &LINErrorFlags::ErrRxBreakSyncOnly)
|
||||
.def_readwrite("ErrTxRxMismatch", &LINErrorFlags::ErrTxRxMismatch)
|
||||
.def_readwrite("ErrRxBreakNotZero", &LINErrorFlags::ErrRxBreakNotZero)
|
||||
.def_readwrite("ErrRxBreakTooShort", &LINErrorFlags::ErrRxBreakTooShort)
|
||||
.def_readwrite("ErrRxSyncNot55", &LINErrorFlags::ErrRxSyncNot55)
|
||||
.def_readwrite("ErrRxDataLenOver8", &LINErrorFlags::ErrRxDataLenOver8)
|
||||
.def_readwrite("ErrFrameSync", &LINErrorFlags::ErrFrameSync)
|
||||
.def_readwrite("ErrFrameMessageID", &LINErrorFlags::ErrFrameMessageID)
|
||||
.def_readwrite("ErrFrameResponderData", &LINErrorFlags::ErrFrameResponderData)
|
||||
.def_readwrite("ErrChecksumMatch", &LINErrorFlags::ErrChecksumMatch);
|
||||
|
||||
pybind11::class_<LINStatusFlags>(m, "LINStatusFlags")
|
||||
.def_readwrite("TxChecksumEnhanced", &LINStatusFlags::TxChecksumEnhanced)
|
||||
.def_readwrite("TxCommander", &LINStatusFlags::TxCommander)
|
||||
.def_readwrite("TxResponder", &LINStatusFlags::TxResponder)
|
||||
.def_readwrite("TxAborted", &LINStatusFlags::TxAborted)
|
||||
.def_readwrite("UpdateResponderOnce", &LINStatusFlags::UpdateResponderOnce)
|
||||
.def_readwrite("HasUpdatedResponderOnce", &LINStatusFlags::HasUpdatedResponderOnce)
|
||||
.def_readwrite("BusRecovered", &LINStatusFlags::BusRecovered)
|
||||
.def_readwrite("BreakOnly", &LINStatusFlags::BreakOnly);
|
||||
|
||||
pybind11::class_<LINMessage, std::shared_ptr<LINMessage>, Frame> linMessage(m, "LINMessage");
|
||||
|
||||
pybind11::enum_<LINMessage::Type>(linMessage, "Type")
|
||||
.value("NOT_SET", LINMessage::Type::NOT_SET)
|
||||
.value("LIN_COMMANDER_MSG", LINMessage::Type::LIN_COMMANDER_MSG)
|
||||
.value("LIN_HEADER_ONLY", LINMessage::Type::LIN_HEADER_ONLY)
|
||||
.value("LIN_BREAK_ONLY", LINMessage::Type::LIN_BREAK_ONLY)
|
||||
.value("LIN_SYNC_ONLY", LINMessage::Type::LIN_SYNC_ONLY)
|
||||
.value("LIN_UPDATE_RESPONDER", LINMessage::Type::LIN_UPDATE_RESPONDER)
|
||||
.value("LIN_ERROR", LINMessage::Type::LIN_ERROR);
|
||||
|
||||
linMessage
|
||||
.def(pybind11::init<>())
|
||||
.def(pybind11::init<uint8_t>())
|
||||
.def_static("calc_checksum", &LINMessage::calcChecksum)
|
||||
.def("calc_protected_id", &LINMessage::calcProtectedID)
|
||||
.def_readwrite("ID", &LINMessage::ID)
|
||||
.def_readwrite("protectedID", &LINMessage::protectedID)
|
||||
.def_readwrite("checksum", &LINMessage::checksum)
|
||||
.def_readwrite("linMsgType", &LINMessage::linMsgType)
|
||||
.def_readwrite("isEnhancedChecksum", &LINMessage::isEnhancedChecksum)
|
||||
.def_readwrite("errFlags", &LINMessage::errFlags)
|
||||
.def_readwrite("statusFlags", &LINMessage::statusFlags);
|
||||
}
|
||||
|
||||
} // namespace icsneo
|
||||
|
||||
|
|
@ -167,7 +167,30 @@ void init_network(pybind11::module_& m) {
|
|||
.value("Any", Network::NetID::Any)
|
||||
.value("Invalid", Network::NetID::Invalid);
|
||||
|
||||
network.def(pybind11::init<Network::NetID>());
|
||||
pybind11::enum_<Network::Type>(network, "Type")
|
||||
.value("Invalid", Network::Type::Invalid)
|
||||
.value("Internal", Network::Type::Internal)
|
||||
.value("CAN", Network::Type::CAN)
|
||||
.value("LIN", Network::Type::LIN)
|
||||
.value("FlexRay", Network::Type::FlexRay)
|
||||
.value("MOST", Network::Type::MOST)
|
||||
.value("Ethernet", Network::Type::Ethernet)
|
||||
.value("LSFTCAN", Network::Type::LSFTCAN)
|
||||
.value("SWCAN", Network::Type::SWCAN)
|
||||
.value("ISO9141", Network::Type::ISO9141)
|
||||
.value("I2C", Network::Type::I2C)
|
||||
.value("A2B", Network::Type::A2B)
|
||||
.value("SPI", Network::Type::SPI)
|
||||
.value("MDIO", Network::Type::MDIO)
|
||||
.value("Any", Network::Type::Any)
|
||||
.value("Other", Network::Type::Other);
|
||||
|
||||
network
|
||||
.def(pybind11::init<Network::NetID>())
|
||||
.def("__repr__", [](Network& self) { return Network::GetNetIDString(self.getNetID()); })
|
||||
.def_static("get_net_id_string", &Network::GetNetIDString, pybind11::arg("netid"), pybind11::arg("expand") = true)
|
||||
.def("get_net_id", &Network::getNetID)
|
||||
.def("get_type", &Network::getType);
|
||||
}
|
||||
|
||||
} // namespace icsneo
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include <pybind11/pybind11.h>
|
||||
#include <pybind11/stl.h>
|
||||
#include <pybind11/functional.h>
|
||||
#include <pybind11/chrono.h>
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ void init_devicetype(pybind11::module_& m) {
|
|||
.value("EtherBADGE", DeviceType::Enum::EtherBADGE)
|
||||
.value("RAD_A2B", DeviceType::Enum::RAD_A2B)
|
||||
.value("RADEpsilon", DeviceType::Enum::RADEpsilon)
|
||||
.value("RADGalaxy2", DeviceType::Enum::RADGalaxy2)
|
||||
.value("RADMoon3", DeviceType::Enum::RADMoon3)
|
||||
.value("RADComet", DeviceType::Enum::RADComet)
|
||||
.value("FIRE3_FlexRay", DeviceType::Enum::FIRE3_FlexRay)
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ void init_devicetype(pybind11::module_&);
|
|||
void init_message(pybind11::module_&);
|
||||
void init_canmessage(pybind11::module_&);
|
||||
void init_ethernetmessage(pybind11::module_&);
|
||||
void init_linmessage(pybind11::module_&);
|
||||
void init_tc10statusmessage(pybind11::module_&);
|
||||
void init_mdiomessage(pybind11::module_&);
|
||||
void init_device(pybind11::module_&);
|
||||
|
|
@ -33,6 +34,7 @@ PYBIND11_MODULE(icsneopy, m) {
|
|||
init_message(m);
|
||||
init_canmessage(m);
|
||||
init_ethernetmessage(m);
|
||||
init_linmessage(m);
|
||||
init_tc10statusmessage(m);
|
||||
init_mdiomessage(m);
|
||||
init_messagefilter(m);
|
||||
|
|
|
|||
|
|
@ -1951,7 +1951,7 @@ bool Device::setRTC(const std::chrono::time_point<std::chrono::system_clock>& ti
|
|||
}
|
||||
|
||||
auto m51msg = std::dynamic_pointer_cast<Main51Message>(generic);
|
||||
if(!m51msg || m51msg->data.size() != 1) {
|
||||
if(!m51msg || m51msg->data.empty() || m51msg->data.size() > 2) {
|
||||
report(APIEvent::Type::MessageFormattingError, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -197,6 +197,10 @@ std::vector<std::shared_ptr<Device>> DeviceFinder::FindAll() {
|
|||
makeIfSerialMatches<RADGalaxy>(dev, newFoundDevices);
|
||||
#endif
|
||||
|
||||
#ifdef __RADGALAXY2_H_
|
||||
makeIfSerialMatches<RADGalaxy2>(dev, newFoundDevices);
|
||||
#endif
|
||||
|
||||
#ifdef __RADMARS_H_
|
||||
makeIfSerialMatches<RADMars>(dev, newFoundDevices);
|
||||
#endif
|
||||
|
|
@ -352,6 +356,10 @@ const std::vector<DeviceType>& DeviceFinder::GetSupportedDevices() {
|
|||
RADGalaxy::DEVICE_TYPE,
|
||||
#endif
|
||||
|
||||
#ifdef __RADGALAXY2_H_
|
||||
RADGalaxy2::DEVICE_TYPE,
|
||||
#endif
|
||||
|
||||
#ifdef __RADMARS_H_
|
||||
RADMars::DEVICE_TYPE,
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@ public:
|
|||
EtherBADGE = (0x00000016),
|
||||
RAD_A2B = (0x00000017),
|
||||
RADEpsilon = (0x00000018),
|
||||
RADGalaxy2 = (0x00000021),
|
||||
RADMoon3 = (0x00000023),
|
||||
RADComet = (0x00000024),
|
||||
FIRE3_FlexRay = (0x00000025),
|
||||
|
|
@ -182,6 +183,8 @@ public:
|
|||
return "neoVI Flex";
|
||||
case RADGalaxy:
|
||||
return "RAD-Galaxy";
|
||||
case RADGalaxy2:
|
||||
return "RAD-Galaxy 2";
|
||||
case RADStar2:
|
||||
return "RAD-Star 2";
|
||||
case VividCAN:
|
||||
|
|
@ -248,6 +251,7 @@ private:
|
|||
#define ICSNEO_DEVICETYPE_ETHERBADGE ((devicetype_t)0x00000016)
|
||||
#define ICSNEO_DEVICETYPE_RAD_A2B ((devicetype_t)0x00000017)
|
||||
#define ICSNEO_DEVICETYPE_RADEPSILON ((devicetype_t)0x00000018)
|
||||
#define ICSNEO_DEVICETYPE_RADGALAXY2 ((devicetype_t)0x00000021)
|
||||
#define ICSNEO_DEVICETYPE_RADMoon3 ((devicetype_t)0x00000023)
|
||||
#define ICSNEO_DEVICETYPE_RADCOMET ((devicetype_t)0x00000024)
|
||||
#define ICSNEO_DEVICETYPE_FIRE3FLEXRAY ((devicetype_t)0x00000025)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,120 @@
|
|||
#ifndef __RADGALAXY2_H_
|
||||
#define __RADGALAXY2_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/communication/packetizer.h"
|
||||
#include "icsneo/communication/decoder.h"
|
||||
#include "icsneo/disk/extextractordiskreaddriver.h"
|
||||
#include "icsneo/disk/neomemorydiskdriver.h"
|
||||
#include "icsneo/device/tree/radgalaxy2/radgalaxy2settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADGalaxy2 : public Device {
|
||||
public:
|
||||
// Serial numbers start with G2
|
||||
// Ethernet MAC allocation is 0x17, standard driver is Raw
|
||||
ICSNEO_FINDABLE_DEVICE(RADGalaxy2, DeviceType::RADGalaxy2, "G2");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::MSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
Network::NetID::HSCAN3,
|
||||
Network::NetID::HSCAN4,
|
||||
Network::NetID::HSCAN5,
|
||||
Network::NetID::HSCAN6,
|
||||
Network::NetID::HSCAN7,
|
||||
|
||||
Network::NetID::LIN,
|
||||
Network::NetID::LIN2,
|
||||
|
||||
Network::NetID::Ethernet,
|
||||
Network::NetID::Ethernet2,
|
||||
Network::NetID::Ethernet3,
|
||||
|
||||
Network::NetID::OP_Ethernet1,
|
||||
Network::NetID::OP_Ethernet2,
|
||||
Network::NetID::OP_Ethernet3,
|
||||
Network::NetID::OP_Ethernet4,
|
||||
Network::NetID::OP_Ethernet5,
|
||||
Network::NetID::OP_Ethernet6,
|
||||
Network::NetID::OP_Ethernet7,
|
||||
Network::NetID::OP_Ethernet8,
|
||||
Network::NetID::OP_Ethernet9,
|
||||
Network::NetID::OP_Ethernet10,
|
||||
Network::NetID::OP_Ethernet11,
|
||||
Network::NetID::OP_Ethernet12,
|
||||
|
||||
Network::NetID::ISO9141,
|
||||
Network::NetID::ISO9141_2,
|
||||
|
||||
Network::NetID::MDIO1,
|
||||
Network::NetID::MDIO2,
|
||||
Network::NetID::MDIO3,
|
||||
Network::NetID::MDIO4,
|
||||
Network::NetID::MDIO5,
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
bool supportsTC10() const override { return true; }
|
||||
|
||||
protected:
|
||||
RADGalaxy2(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADGalaxy2Settings, Disk::ExtExtractorDiskReadDriver, Disk::NeoMemoryDiskDriver>(makeDriver);
|
||||
}
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
Device::setupPacketizer(packetizer);
|
||||
packetizer.disableChecksum = true;
|
||||
packetizer.align16bit = false;
|
||||
}
|
||||
|
||||
void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportCANFD = true;
|
||||
encoder.supportEthPhy = true;
|
||||
}
|
||||
|
||||
void setupDecoder(Decoder& decoder) override {
|
||||
Device::setupDecoder(decoder);
|
||||
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
}
|
||||
|
||||
void setupSupportedRXNetworks(std::vector<Network>& rxNetworks) override {
|
||||
for(auto& netid : GetSupportedNetworks())
|
||||
rxNetworks.emplace_back(netid);
|
||||
}
|
||||
|
||||
// The supported TX networks are the same as the supported RX networks for this device
|
||||
void setupSupportedTXNetworks(std::vector<Network>& txNetworks) override { setupSupportedRXNetworks(txNetworks); }
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<RawMessage>& message) override {
|
||||
if(message->data.size() < sizeof(radgalaxy2_status_t))
|
||||
return;
|
||||
std::lock_guard<std::mutex> lk(ioMutex);
|
||||
const radgalaxy2_status_t* status = reinterpret_cast<const radgalaxy2_status_t*>(message->data.data());
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
}
|
||||
|
||||
std::optional<MemoryAddress> getCoreminiStartAddressFlash() const override {
|
||||
return 512*4;
|
||||
}
|
||||
|
||||
std::optional<MemoryAddress> getCoreminiStartAddressSD() const override {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
#ifndef __RADGALAXY2SETTINGS_H_
|
||||
#define __RADGALAXY2SETTINGS_H_
|
||||
|
||||
#include "icsneo/device/idevicesettings.h"
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 2)
|
||||
|
||||
typedef struct {
|
||||
uint32_t ecu_id;
|
||||
uint16_t perf_en;
|
||||
|
||||
/* CAN */
|
||||
CAN_SETTINGS can1;
|
||||
CANFD_SETTINGS canfd1;
|
||||
CAN_SETTINGS can2;
|
||||
CANFD_SETTINGS canfd2;
|
||||
CAN_SETTINGS can3;
|
||||
CANFD_SETTINGS canfd3;
|
||||
CAN_SETTINGS can4;
|
||||
CANFD_SETTINGS canfd4;
|
||||
CAN_SETTINGS can5;
|
||||
CANFD_SETTINGS canfd5;
|
||||
CAN_SETTINGS can6;
|
||||
CANFD_SETTINGS canfd6;
|
||||
CAN_SETTINGS can7;
|
||||
CANFD_SETTINGS canfd7;
|
||||
CAN_SETTINGS can8;
|
||||
CANFD_SETTINGS canfd8;
|
||||
|
||||
// SWCAN_SETTINGS swcan1; G2 does not have SWCAN.
|
||||
uint16_t network_enables;
|
||||
// SWCAN_SETTINGS swcan2; G2 does not have SWCAN.
|
||||
uint16_t network_enables_2;
|
||||
|
||||
uint32_t pwr_man_timeout;
|
||||
uint16_t pwr_man_enable;
|
||||
|
||||
uint16_t network_enabled_on_boot;
|
||||
|
||||
/* ISO15765-2 Transport Layer */
|
||||
uint16_t iso15765_separation_time_offset;
|
||||
|
||||
/* ISO9141 - Keyword */
|
||||
uint16_t iso_9141_kwp_enable_reserved;
|
||||
ISO9141_KEYWORD2000_SETTINGS iso9141_kwp_settings_1;
|
||||
uint16_t iso_parity_1;
|
||||
|
||||
uint16_t iso_msg_termination_1;
|
||||
|
||||
uint16_t idle_wakeup_network_enables_1;
|
||||
uint16_t idle_wakeup_network_enables_2;
|
||||
|
||||
/* reserved for T1 networks such as BR1, BR2, etc.. */
|
||||
uint16_t network_enables_3;
|
||||
uint16_t idle_wakeup_network_enables_3;
|
||||
|
||||
STextAPISettings text_api;
|
||||
|
||||
uint64_t termination_enables; // New feature unlike Galaxy.
|
||||
|
||||
TIMESYNC_ICSHARDWARE_SETTINGS timeSyncSettings;
|
||||
struct
|
||||
{
|
||||
uint16_t hwComLatencyTestEn : 1;
|
||||
uint16_t reserved : 15;
|
||||
} flags;
|
||||
|
||||
LIN_SETTINGS lin1;
|
||||
|
||||
OP_ETH_GENERAL_SETTINGS opEthGen;
|
||||
OP_ETH_SETTINGS opEth1;
|
||||
OP_ETH_SETTINGS opEth2;
|
||||
OP_ETH_SETTINGS opEth3;
|
||||
OP_ETH_SETTINGS opEth4;
|
||||
OP_ETH_SETTINGS opEth5;
|
||||
OP_ETH_SETTINGS opEth6;
|
||||
OP_ETH_SETTINGS opEth7;
|
||||
OP_ETH_SETTINGS opEth8;
|
||||
OP_ETH_SETTINGS opEth9;
|
||||
OP_ETH_SETTINGS opEth10;
|
||||
OP_ETH_SETTINGS opEth11;
|
||||
OP_ETH_SETTINGS opEth12;
|
||||
OP_ETH_SETTINGS opEth13;
|
||||
OP_ETH_SETTINGS opEth14;
|
||||
OP_ETH_SETTINGS opEth15;
|
||||
OP_ETH_SETTINGS opEth16;
|
||||
|
||||
ETHERNET10G_SETTINGS ethernet10g;
|
||||
ETHERNET10G_SETTINGS ethernet10g_2;
|
||||
ETHERNET10G_SETTINGS ethernet10g_3;
|
||||
|
||||
uint16_t network_enables_4;
|
||||
RAD_REPORTING_SETTINGS reporting;
|
||||
RAD_GPTP_SETTINGS gPTP;
|
||||
|
||||
uint64_t network_enables_5;
|
||||
|
||||
LIN_SETTINGS lin2;
|
||||
} radgalaxy2_settings_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t unused[3];
|
||||
uint8_t ethernetActivationLineEnabled;
|
||||
} radgalaxy2_status_t;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include <iostream>
|
||||
|
||||
class RADGalaxy2Settings : public IDeviceSettings {
|
||||
public:
|
||||
RADGalaxy2Settings(std::shared_ptr<Communication> com) : IDeviceSettings(com, sizeof(radgalaxy2_settings_t)) {}
|
||||
const CAN_SETTINGS* getCANSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<radgalaxy2_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
return nullptr;
|
||||
switch(net.getNetID()) {
|
||||
case Network::NetID::HSCAN:
|
||||
return &(cfg->can1);
|
||||
case Network::NetID::MSCAN:
|
||||
return &(cfg->can2);
|
||||
case Network::NetID::HSCAN2:
|
||||
return &(cfg->can3);
|
||||
case Network::NetID::HSCAN3:
|
||||
return &(cfg->can4);
|
||||
case Network::NetID::HSCAN4:
|
||||
return &(cfg->can5);
|
||||
case Network::NetID::HSCAN5:
|
||||
return &(cfg->can6);
|
||||
case Network::NetID::HSCAN6:
|
||||
return &(cfg->can7);
|
||||
case Network::NetID::HSCAN7:
|
||||
return &(cfg->can8);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
const CANFD_SETTINGS* getCANFDSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<radgalaxy2_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
return nullptr;
|
||||
switch(net.getNetID()) {
|
||||
case Network::NetID::HSCAN:
|
||||
return &(cfg->canfd1);
|
||||
case Network::NetID::MSCAN:
|
||||
return &(cfg->canfd2);
|
||||
case Network::NetID::HSCAN2:
|
||||
return &(cfg->canfd3);
|
||||
case Network::NetID::HSCAN3:
|
||||
return &(cfg->canfd4);
|
||||
case Network::NetID::HSCAN4:
|
||||
return &(cfg->canfd5);
|
||||
case Network::NetID::HSCAN5:
|
||||
return &(cfg->canfd6);
|
||||
case Network::NetID::HSCAN6:
|
||||
return &(cfg->canfd7);
|
||||
case Network::NetID::HSCAN7:
|
||||
return &(cfg->canfd8);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
const LIN_SETTINGS* getLINSettingsFor(Network net) const override {
|
||||
auto cfg = getStructurePointer<radgalaxy2_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
return nullptr;
|
||||
switch(net.getNetID()) {
|
||||
case Network::NetID::LIN:
|
||||
return &(cfg->lin1);
|
||||
case Network::NetID::LIN2:
|
||||
return &(cfg->lin2);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
|
|
@ -220,7 +220,7 @@ typedef unsigned __int64 uint64_t;
|
|||
#define NEODEVICE_RADEPSILON_EXPRESS (0x0000001d)
|
||||
#define NEODEVICE_RADPROXIMA (0x0000001e)
|
||||
#define NEODEVICE_NEW_DEVICE_58 (0x0000001f)
|
||||
#define NEODEVICE_NEW_DEVICE_59 (0x00000021)
|
||||
#define NEODEVICE_RAD_GALAXY_2 (0x00000021)
|
||||
#define NEODEVICE_RAD_BMS (0x00000022)
|
||||
#define NEODEVICE_RADMOON3 (0x00000023)
|
||||
#define NEODEVICE_RADCOMET (0x00000024)
|
||||
|
|
@ -2999,6 +2999,100 @@ typedef struct _SRADGigastarSettings
|
|||
|
||||
#define SRADGigastarSettings_SIZE 710
|
||||
|
||||
typedef struct _SRADGalaxy2Settings
|
||||
{
|
||||
uint32_t ecu_id;
|
||||
uint16_t perf_en;
|
||||
|
||||
/* CAN */
|
||||
CAN_SETTINGS can1;
|
||||
CANFD_SETTINGS canfd1;
|
||||
CAN_SETTINGS can2;
|
||||
CANFD_SETTINGS canfd2;
|
||||
CAN_SETTINGS can3;
|
||||
CANFD_SETTINGS canfd3;
|
||||
CAN_SETTINGS can4;
|
||||
CANFD_SETTINGS canfd4;
|
||||
CAN_SETTINGS can5;
|
||||
CANFD_SETTINGS canfd5;
|
||||
CAN_SETTINGS can6;
|
||||
CANFD_SETTINGS canfd6;
|
||||
CAN_SETTINGS can7;
|
||||
CANFD_SETTINGS canfd7;
|
||||
CAN_SETTINGS can8;
|
||||
CANFD_SETTINGS canfd8;
|
||||
|
||||
// SWCAN_SETTINGS swcan1; G2 does not have SWCAN.
|
||||
uint16_t network_enables;
|
||||
// SWCAN_SETTINGS swcan2; G2 does not have SWCAN.
|
||||
uint16_t network_enables_2;
|
||||
|
||||
uint32_t pwr_man_timeout;
|
||||
uint16_t pwr_man_enable;
|
||||
|
||||
uint16_t network_enabled_on_boot;
|
||||
|
||||
/* ISO15765-2 Transport Layer */
|
||||
uint16_t iso15765_separation_time_offset;
|
||||
|
||||
/* ISO9141 - Keyword */
|
||||
uint16_t iso_9141_kwp_enable_reserved;
|
||||
ISO9141_KEYWORD2000_SETTINGS iso9141_kwp_settings_1;
|
||||
uint16_t iso_parity_1;
|
||||
|
||||
uint16_t iso_msg_termination_1;
|
||||
|
||||
uint16_t idle_wakeup_network_enables_1;
|
||||
uint16_t idle_wakeup_network_enables_2;
|
||||
|
||||
/* reserved for T1 networks such as BR1, BR2, etc.. */
|
||||
uint16_t network_enables_3;
|
||||
uint16_t idle_wakeup_network_enables_3;
|
||||
|
||||
STextAPISettings text_api;
|
||||
|
||||
uint64_t termination_enables; // New feature unlike Galaxy.
|
||||
|
||||
TIMESYNC_ICSHARDWARE_SETTINGS timeSyncSettings;
|
||||
struct
|
||||
{
|
||||
uint16_t hwComLatencyTestEn : 1;
|
||||
uint16_t reserved : 15;
|
||||
} flags;
|
||||
|
||||
LIN_SETTINGS lin1;
|
||||
|
||||
OP_ETH_GENERAL_SETTINGS opEthGen;
|
||||
OP_ETH_SETTINGS opEth1;
|
||||
OP_ETH_SETTINGS opEth2;
|
||||
OP_ETH_SETTINGS opEth3;
|
||||
OP_ETH_SETTINGS opEth4;
|
||||
OP_ETH_SETTINGS opEth5;
|
||||
OP_ETH_SETTINGS opEth6;
|
||||
OP_ETH_SETTINGS opEth7;
|
||||
OP_ETH_SETTINGS opEth8;
|
||||
OP_ETH_SETTINGS opEth9;
|
||||
OP_ETH_SETTINGS opEth10;
|
||||
OP_ETH_SETTINGS opEth11;
|
||||
OP_ETH_SETTINGS opEth12;
|
||||
OP_ETH_SETTINGS opEth13;
|
||||
OP_ETH_SETTINGS opEth14;
|
||||
OP_ETH_SETTINGS opEth15;
|
||||
OP_ETH_SETTINGS opEth16;
|
||||
|
||||
ETHERNET10G_SETTINGS ethernet10g;
|
||||
ETHERNET10G_SETTINGS ethernet10g_2;
|
||||
ETHERNET10G_SETTINGS ethernet10g_3;
|
||||
|
||||
uint16_t network_enables_4;
|
||||
RAD_REPORTING_SETTINGS reporting;
|
||||
RAD_GPTP_SETTINGS gPTP;
|
||||
|
||||
uint64_t network_enables_5;
|
||||
LIN_SETTINGS lin2;
|
||||
} SRADGalaxy2Settings;
|
||||
#define SRADGalaxy2Settings_SIZE 840
|
||||
|
||||
typedef struct _SVividCANSettings
|
||||
{
|
||||
uint32_t ecu_id;
|
||||
|
|
@ -5425,6 +5519,7 @@ CHECK_STRUCT_SIZE(SPendantSettings);
|
|||
CHECK_STRUCT_SIZE(SIEVBSettings);
|
||||
CHECK_STRUCT_SIZE(SEEVBSettings);
|
||||
CHECK_STRUCT_SIZE(SRADGalaxySettings);
|
||||
CHECK_STRUCT_SIZE(SRADGalaxy2Settings);
|
||||
CHECK_STRUCT_SIZE(SRADStar2Settings);
|
||||
CHECK_STRUCT_SIZE(SOBD2SimSettings)
|
||||
CHECK_STRUCT_SIZE(CmProbeSettings);
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "icsneo/device/tree/radmoont1s/radmoont1s.h"
|
||||
#include "icsneo/device/tree/radepsilon/radepsilon.h"
|
||||
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
|
||||
#include "icsneo/device/tree/radgalaxy2/radgalaxy2.h"
|
||||
#include "icsneo/device/tree/radgigastar/radgigastar.h"
|
||||
#include "icsneo/device/tree/radgigastar2/radgigastar2.h"
|
||||
#include "icsneo/device/tree/radjupiter/radjupiter.h"
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
#include "icsneo/device/tree/radmoont1s/radmoont1s.h"
|
||||
#include "icsneo/device/tree/radepsilon/radepsilon.h"
|
||||
#include "icsneo/device/tree/radgalaxy/radgalaxy.h"
|
||||
#include "icsneo/device/tree/radgalaxy2/radgalaxy2.h"
|
||||
#include "icsneo/device/tree/radgigastar/radgigastar.h"
|
||||
#include "icsneo/device/tree/radgigastar2/radgigastar2.h"
|
||||
#include "icsneo/device/tree/radjupiter/radjupiter.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