Merge remote-tracking branch 'origin/master' into icsneo_api
commit
894d51953c
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ namespace icsneo {
|
|||
|
||||
void init_messagefilter(pybind11::module_& m) {
|
||||
pybind11::class_<MessageFilter, std::shared_ptr<MessageFilter>>(m, "MessageFilter")
|
||||
.def(pybind11::init())
|
||||
.def(pybind11::init<_icsneo_netid_t>());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
@ -9,7 +9,7 @@ namespace icsneo {
|
|||
void init_network(pybind11::module_& m) {
|
||||
pybind11::class_<Network> 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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -88,6 +88,21 @@ void TCP::Socket::poll(uint16_t event, uint32_t msTimeout) {
|
|||
}
|
||||
|
||||
void TCP::Find(std::vector<FoundDevice>& 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));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue