mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Ethernet (DoIP) Activation Line support
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/platform/ftdi.h"
|
||||
#include "icsneo/device/tree/neovifire2/neovifire2settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
@@ -46,6 +47,10 @@ public:
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
size_t getUSBHostPowerCount() const override { return 1; }
|
||||
bool getBackupPowerSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
NeoVIFIRE2(neodevice_t neodevice) : Device(neodevice) {
|
||||
getWritableNeoDevice().type = DEVICE_TYPE;
|
||||
@@ -63,6 +68,16 @@ protected:
|
||||
|
||||
// The supported TX networks are the same as the supported RX networks for this device
|
||||
virtual void setupSupportedTXNetworks(std::vector<Network>& txNetworks) override { setupSupportedRXNetworks(txNetworks); }
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<Message>& message) override {
|
||||
if(!message || message->data.size() < sizeof(neovifire2_status_t))
|
||||
return;
|
||||
const neovifire2_status_t* status = reinterpret_cast<const neovifire2_status_t*>(message->data.data());
|
||||
backupPowerEnabled = status->backupPowerEnabled;
|
||||
backupPowerGood = status->backupPowerGood;
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
usbHostPowerStatus = status->usbHostPowerEnabled;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "icsneo/device/tree/neovifire2/neovifire2.h"
|
||||
#include "icsneo/platform/pcap.h"
|
||||
#include "icsneo/device/tree/neovifire2/neovifire2settings.h"
|
||||
#include <memory>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
@@ -106,6 +106,14 @@ typedef struct {
|
||||
TIMESYNC_ICSHARDWARE_SETTINGS timeSync;
|
||||
DISK_SETTINGS disk;
|
||||
} neovifire2_settings_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t backupPowerGood;
|
||||
uint8_t backupPowerEnabled;
|
||||
uint8_t usbHostPowerEnabled;
|
||||
uint8_t ethernetActivationLineEnabled;
|
||||
EthernetNetworkStatus ethernetStatus;
|
||||
} neovifire2_status_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
#include "icsneo/device/tree/neovifire2/neovifire2.h"
|
||||
#include "icsneo/platform/ftdi.h"
|
||||
#include "icsneo/device/tree/neovifire2/neovifire2settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
|
||||
@@ -41,6 +41,9 @@ public:
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
// Until VNET support is added, assume we have one FIRE 2 VNET or FlexRay VNETZ as the main
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
protected:
|
||||
virtual std::shared_ptr<Communication> makeCommunication(
|
||||
std::unique_ptr<Driver> transport,
|
||||
@@ -92,6 +95,13 @@ protected:
|
||||
return ret;
|
||||
}
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<Message>& message) override {
|
||||
if(!message || message->data.size() < sizeof(fire2vnet_status_t))
|
||||
return;
|
||||
const fire2vnet_status_t* status = reinterpret_cast<const fire2vnet_status_t*>(message->data.data());
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
}
|
||||
|
||||
public:
|
||||
Plasion(neodevice_t neodevice) : Device(neodevice) {}
|
||||
};
|
||||
|
||||
@@ -91,6 +91,8 @@ public:
|
||||
productId = PRODUCT_ID;
|
||||
}
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
protected:
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
Device::setupPacketizer(packetizer);
|
||||
@@ -115,6 +117,13 @@ protected:
|
||||
|
||||
// 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<Message>& message) override {
|
||||
if(!message || message->data.size() < sizeof(radgalaxy_status_t))
|
||||
return;
|
||||
const radgalaxy_status_t* status = reinterpret_cast<const radgalaxy_status_t*>(message->data.data());
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -87,6 +87,11 @@ typedef struct {
|
||||
DISK_SETTINGS disk;
|
||||
LOGGER_SETTINGS logger;
|
||||
} radgalaxy_settings_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t unused[3];
|
||||
uint8_t ethernetActivationLineEnabled;
|
||||
} radgalaxy_status_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -14,6 +14,8 @@ public:
|
||||
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::RADGigalog;
|
||||
static constexpr const char* SERIAL_START = "GL";
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
protected:
|
||||
RADGigalog(neodevice_t neodevice) : Device(neodevice) {
|
||||
getWritableNeoDevice().type = DEVICE_TYPE;
|
||||
@@ -74,6 +76,13 @@ protected:
|
||||
};
|
||||
txNetworks.insert(txNetworks.end(), supportedTxNetworks.begin(), supportedTxNetworks.end());
|
||||
}
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<Message>& message) override {
|
||||
if(!message || message->data.size() < sizeof(radgigalog_status_t))
|
||||
return;
|
||||
const radgigalog_status_t* status = reinterpret_cast<const radgigalog_status_t*>(message->data.data());
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -86,6 +86,11 @@ typedef struct {
|
||||
uint16_t network_enables_4;
|
||||
RAD_REPORTING_SETTINGS reporting;
|
||||
} radgigalog_settings_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t unused[3];
|
||||
uint8_t ethernetActivationLineEnabled;
|
||||
} radgigalog_status_t;
|
||||
#pragma pack(pop)
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -14,6 +14,8 @@ public:
|
||||
static constexpr DeviceType::Enum DEVICE_TYPE = DeviceType::RADGigastar;
|
||||
static constexpr const char* SERIAL_START = "GS";
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
protected:
|
||||
RADGigastar(neodevice_t neodevice) : Device(neodevice) {
|
||||
getWritableNeoDevice().type = DEVICE_TYPE;
|
||||
@@ -78,6 +80,13 @@ protected:
|
||||
};
|
||||
txNetworks.insert(txNetworks.end(), supportedTxNetworks.begin(), supportedTxNetworks.end());
|
||||
}
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<Message>& message) override {
|
||||
if(!message || message->data.size() < sizeof(radgigastar_status_t))
|
||||
return;
|
||||
const radgigastar_status_t* status = reinterpret_cast<const radgigastar_status_t*>(message->data.data());
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -135,6 +135,11 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
uint8_t unused[3];
|
||||
uint8_t ethernetActivationLineEnabled;
|
||||
} radgigastar_status_t;
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
@@ -76,6 +76,12 @@ typedef struct {
|
||||
uint16_t pwr_man_timeout;
|
||||
} valuecan4_4_2el_settings_t, valuecan4_4_settings_t, valuecan4_2el_settings_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint8_t ethernetActivationLineEnabled;
|
||||
uint8_t unused;
|
||||
} valuecan4_4_2el_status_t, valuecan4_4_status_t, valuecan4_2el_status_t;
|
||||
|
||||
typedef struct {
|
||||
CAN_SETTINGS can1;
|
||||
CANFD_SETTINGS canfd1;
|
||||
|
||||
@@ -19,6 +19,15 @@ protected:
|
||||
ValueCAN4_2EL(neodevice_t neodevice) : ValueCAN4(neodevice) {
|
||||
getWritableNeoDevice().type = DEVICE_TYPE;
|
||||
}
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<Message>& message) override {
|
||||
if(!message || message->data.size() < sizeof(valuecan4_2el_status_t))
|
||||
return;
|
||||
const valuecan4_2el_status_t* status = reinterpret_cast<const valuecan4_2el_status_t*>(message->data.data());
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user