diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index baf8258..f8a3b13 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 diff --git a/README.md b/README.md index f0275ed..2724676 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index b2d8f07..1d8659c 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -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 diff --git a/bindings/python/icsneopy/communication/message/filter/messagefilter.cpp b/bindings/python/icsneopy/communication/message/filter/messagefilter.cpp index 680894a..e312cf9 100644 --- a/bindings/python/icsneopy/communication/message/filter/messagefilter.cpp +++ b/bindings/python/icsneopy/communication/message/filter/messagefilter.cpp @@ -8,6 +8,7 @@ namespace icsneo { void init_messagefilter(pybind11::module_& m) { pybind11::class_>(m, "MessageFilter") + .def(pybind11::init()) .def(pybind11::init<_icsneo_netid_t>()); } diff --git a/bindings/python/icsneopy/communication/message/linmessage.cpp b/bindings/python/icsneopy/communication/message/linmessage.cpp new file mode 100644 index 0000000..cfee887 --- /dev/null +++ b/bindings/python/icsneopy/communication/message/linmessage.cpp @@ -0,0 +1,59 @@ +#include +#include +#include + +#include "icsneo/communication/message/linmessage.h" + +namespace icsneo { + +void init_linmessage(pybind11::module_& m) { + pybind11::class_(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_(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_, Frame> linMessage(m, "LINMessage"); + + pybind11::enum_(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()) + .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 + diff --git a/bindings/python/icsneopy/communication/network.cpp b/bindings/python/icsneopy/communication/network.cpp index b44bcd7..6037061 100644 --- a/bindings/python/icsneopy/communication/network.cpp +++ b/bindings/python/icsneopy/communication/network.cpp @@ -9,7 +9,7 @@ namespace icsneo { void init_network(pybind11::module_& m) { pybind11::class_ network(m, "Network"); - pybind11::enum_<_icsneo_netid_t>(network, "_icsneo_netid_t") + pybind11::enum_<_icsneo_netid_t>(network, "icsneo_netid_t") .value("Device", _icsneo_netid_t::icsneo_netid_device) .value("HSCAN", _icsneo_netid_t::icsneo_netid_hscan) .value("MSCAN", _icsneo_netid_t::icsneo_netid_mscan) @@ -168,6 +168,31 @@ void init_network(pybind11::module_& m) { .value("Invalid", _icsneo_netid_t::icsneo_netid_invalid); network.def(pybind11::init<_icsneo_netid_t>()); + + pybind11::enum_<_icsneo_msg_bus_type_t>(network, "icsneo_msg_bus_type_t") + .value("Invalid", icsneo_msg_bus_type_invalid) + .value("Internal", icsneo_msg_bus_type_internal) + .value("CAN", icsneo_msg_bus_type_can) + .value("LIN", icsneo_msg_bus_type_lin) + .value("FlexRay", icsneo_msg_bus_type_flexray) + .value("MOST", icsneo_msg_bus_type_most) + .value("Ethernet", icsneo_msg_bus_type_ethernet) + .value("LSFTCAN", icsneo_msg_bus_type_lsftcan) + .value("SWCAN", icsneo_msg_bus_type_swcan) + .value("ISO9141", icsneo_msg_bus_type_iso9141) + .value("I2C", icsneo_msg_bus_type_i2c) + .value("A2B", icsneo_msg_bus_type_a2b) + .value("SPI", icsneo_msg_bus_type_spi) + .value("MDIO", icsneo_msg_bus_type_mdio) + .value("Any", icsneo_msg_bus_type_any) + .value("Other", icsneo_msg_bus_type_other); + + network + .def(pybind11::init<_icsneo_msg_bus_type_t>()) + .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 diff --git a/bindings/python/icsneopy/device/device.cpp b/bindings/python/icsneopy/device/device.cpp index 90051bc..fe34cbe 100644 --- a/bindings/python/icsneopy/device/device.cpp +++ b/bindings/python/icsneopy/device/device.cpp @@ -1,6 +1,7 @@ #include #include #include +#include #include "icsneo/device/device.h" diff --git a/bindings/python/icsneopy/icsneocpp.cpp b/bindings/python/icsneopy/icsneocpp.cpp index 98445f2..622b468 100644 --- a/bindings/python/icsneopy/icsneocpp.cpp +++ b/bindings/python/icsneopy/icsneocpp.cpp @@ -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); diff --git a/device/device.cpp b/device/device.cpp index 4e851fd..be4ffff 100644 --- a/device/device.cpp +++ b/device/device.cpp @@ -1951,7 +1951,7 @@ bool Device::setRTC(const std::chrono::time_point& ti } auto m51msg = std::dynamic_pointer_cast(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; } diff --git a/device/devicefinder.cpp b/device/devicefinder.cpp index 17770ab..f5ba93b 100644 --- a/device/devicefinder.cpp +++ b/device/devicefinder.cpp @@ -197,6 +197,10 @@ std::vector> DeviceFinder::FindAll() { makeIfSerialMatches(dev, newFoundDevices); #endif + #ifdef __RADGALAXY2_H_ + makeIfSerialMatches(dev, newFoundDevices); + #endif + #ifdef __RADMARS_H_ makeIfSerialMatches(dev, newFoundDevices); #endif @@ -352,6 +356,10 @@ const std::vector& DeviceFinder::GetSupportedDevices() { RADGalaxy::DEVICE_TYPE, #endif + #ifdef __RADGALAXY2_H_ + RADGalaxy2::DEVICE_TYPE, + #endif + #ifdef __RADMARS_H_ RADMars::DEVICE_TYPE, #endif diff --git a/include/icsneo/device/devicetype.h b/include/icsneo/device/devicetype.h index 216a9f0..4fdf14a 100644 --- a/include/icsneo/device/devicetype.h +++ b/include/icsneo/device/devicetype.h @@ -118,6 +118,8 @@ public: return "neoVI Flex"; case icsneo_devicetype_rad_galaxy: return "RAD-Galaxy"; + case icsneo_devicetype_rad_galaxy2: + return "RAD-Galaxy 2"; case icsneo_devicetype_rad_star2: return "RAD-Star 2"; case icsneo_devicetype_vividcan: @@ -151,4 +153,3 @@ private: }; // namespace icsneo -#endif // __cplusplus \ No newline at end of file diff --git a/include/icsneo/device/tree/radgalaxy2/radgalaxy2.h b/include/icsneo/device/tree/radgalaxy2/radgalaxy2.h new file mode 100644 index 0000000..1946438 --- /dev/null +++ b/include/icsneo/device/tree/radgalaxy2/radgalaxy2.h @@ -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& GetSupportedNetworks() { + static std::vector 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(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& 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& txNetworks) override { setupSupportedRXNetworks(txNetworks); } + + void handleDeviceStatus(const std::shared_ptr& message) override { + if(message->data.size() < sizeof(radgalaxy2_status_t)) + return; + std::lock_guard lk(ioMutex); + const radgalaxy2_status_t* status = reinterpret_cast(message->data.data()); + ethActivationStatus = status->ethernetActivationLineEnabled; + } + + std::optional getCoreminiStartAddressFlash() const override { + return 512*4; + } + + std::optional getCoreminiStartAddressSD() const override { + return 0; + } +}; + +} + +#endif // __cplusplus + +#endif \ No newline at end of file diff --git a/include/icsneo/device/tree/radgalaxy2/radgalaxy2settings.h b/include/icsneo/device/tree/radgalaxy2/radgalaxy2settings.h new file mode 100644 index 0000000..7639a41 --- /dev/null +++ b/include/icsneo/device/tree/radgalaxy2/radgalaxy2settings.h @@ -0,0 +1,192 @@ +#ifndef __RADGALAXY2SETTINGS_H_ +#define __RADGALAXY2SETTINGS_H_ + +#include "icsneo/device/idevicesettings.h" +#include + +#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 + +class RADGalaxy2Settings : public IDeviceSettings { +public: + RADGalaxy2Settings(std::shared_ptr com) : IDeviceSettings(com, sizeof(radgalaxy2_settings_t)) {} + const CAN_SETTINGS* getCANSettingsFor(Network net) const override { + auto cfg = getStructurePointer(); + 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(); + 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(); + 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 \ No newline at end of file diff --git a/include/icsneo/icsnVC40.h b/include/icsneo/icsnVC40.h index 5b86efb..7c30769 100644 --- a/include/icsneo/icsnVC40.h +++ b/include/icsneo/icsnVC40.h @@ -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); diff --git a/include/icsneo/platform/posix/devices.h b/include/icsneo/platform/posix/devices.h index a637600..0f35d5a 100644 --- a/include/icsneo/platform/posix/devices.h +++ b/include/icsneo/platform/posix/devices.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" diff --git a/include/icsneo/platform/windows/devices.h b/include/icsneo/platform/windows/devices.h index 6c41fb3..43a80a0 100644 --- a/include/icsneo/platform/windows/devices.h +++ b/include/icsneo/platform/windows/devices.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" diff --git a/platform/tcp.cpp b/platform/tcp.cpp index 85bddcc..1f44202 100644 --- a/platform/tcp.cpp +++ b/platform/tcp.cpp @@ -88,6 +88,21 @@ void TCP::Socket::poll(uint16_t event, uint32_t msTimeout) { } void TCP::Find(std::vector& found) { + static const auto tcpDisabled = []() -> bool { + #ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable : 4996) + #endif + const auto disabled = std::getenv("LIBICSNEO_DISABLE_TCP"); + return disabled ? std::stoi(disabled) : false; + #ifdef _MSC_VER + #pragma warning(pop) + #endif + }; + if(tcpDisabled()) { + return; + } + static const auto MDNS_PORT = htons((unsigned short)5353); static const auto MDNS_IP = htonl((((uint32_t)224U) << 24U) | ((uint32_t)251U));