mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Repo: Normalize source files to LF
This commit is contained in:
@@ -1,23 +1,23 @@
|
||||
#ifndef __DEVICEFINDER_H_
|
||||
#define __DEVICEFINDER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class DeviceFinder {
|
||||
public:
|
||||
static std::vector<std::shared_ptr<Device>> FindAll();
|
||||
static const std::vector<DeviceType>& GetSupportedDevices();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __DEVICEFINDER_H_
|
||||
#define __DEVICEFINDER_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class DeviceFinder {
|
||||
public:
|
||||
static std::vector<std::shared_ptr<Device>> FindAll();
|
||||
static const std::vector<DeviceType>& GetSupportedDevices();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,90 +1,90 @@
|
||||
#ifndef __RADMOON2_H_
|
||||
#define __RADMOON2_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/device/tree/radmoon2/radmoon2settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADMoon2 : public Device {
|
||||
public:
|
||||
// Serial numbers start with RM
|
||||
// USB PID is 0x1202, standard driver is FTDI3
|
||||
ICSNEO_FINDABLE_DEVICE(RADMoon2, DeviceType::RADMoon2, "RM");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
APM1000E, // Keysight Branding
|
||||
APM1000E_CLK, // Clock Option and Keysight Branding
|
||||
};
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
case 'B':
|
||||
return SKU::APM1000E;
|
||||
case 'C':
|
||||
case 'D':
|
||||
return SKU::APM1000E_CLK;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::APM1000E:
|
||||
return "Keysight APM1000E";
|
||||
case SKU::APM1000E_CLK:
|
||||
return "Keysight APM1000E-CLK";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
// RADMoon 2 does not go online, you can only set settings and
|
||||
// view PHY information (when supported)
|
||||
bool goOnline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool goOffline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool getEthPhyRegControlSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
RADMoon2(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADMoon2Settings>(makeDriver);
|
||||
}
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
Device::setupPacketizer(packetizer);
|
||||
packetizer.disableChecksum = true;
|
||||
packetizer.align16bit = false;
|
||||
}
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportEthPhy = true;
|
||||
}
|
||||
|
||||
void setupDecoder(Decoder& decoder) override {
|
||||
Device::setupDecoder(decoder);
|
||||
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
}
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __RADMOON2_H_
|
||||
#define __RADMOON2_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/device/tree/radmoon2/radmoon2settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADMoon2 : public Device {
|
||||
public:
|
||||
// Serial numbers start with RM
|
||||
// USB PID is 0x1202, standard driver is FTDI3
|
||||
ICSNEO_FINDABLE_DEVICE(RADMoon2, DeviceType::RADMoon2, "RM");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
APM1000E, // Keysight Branding
|
||||
APM1000E_CLK, // Clock Option and Keysight Branding
|
||||
};
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
case 'B':
|
||||
return SKU::APM1000E;
|
||||
case 'C':
|
||||
case 'D':
|
||||
return SKU::APM1000E_CLK;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::APM1000E:
|
||||
return "Keysight APM1000E";
|
||||
case SKU::APM1000E_CLK:
|
||||
return "Keysight APM1000E-CLK";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
// RADMoon 2 does not go online, you can only set settings and
|
||||
// view PHY information (when supported)
|
||||
bool goOnline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool goOffline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool getEthPhyRegControlSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
RADMoon2(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADMoon2Settings>(makeDriver);
|
||||
}
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
Device::setupPacketizer(packetizer);
|
||||
packetizer.disableChecksum = true;
|
||||
packetizer.align16bit = false;
|
||||
}
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportEthPhy = true;
|
||||
}
|
||||
|
||||
void setupDecoder(Decoder& decoder) override {
|
||||
Device::setupDecoder(decoder);
|
||||
decoder.timestampResolution = 10; // Timestamps are in 10ns increments instead of the usual 25ns
|
||||
}
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,54 +1,54 @@
|
||||
#ifndef __RADMOONDUO_H_
|
||||
#define __RADMOONDUO_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/device/tree/radmoonduo/radmoonduosettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADMoonDuo : public Device {
|
||||
public:
|
||||
// Serial numbers start with MD
|
||||
// USB PID is 1106, standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(RADMoonDuo, DeviceType::RADMoonDuo, "MD");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
// If Converter1 Target is set to USB/CM, OP_Ethernet2 will be exposed to the PC
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::OP_Ethernet2
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
bool getEthPhyRegControlSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
RADMoonDuo(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADMoonDuoSettings>(makeDriver);
|
||||
}
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportEthPhy = true;
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __RADMOONDUO_H_
|
||||
#define __RADMOONDUO_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/device/tree/radmoonduo/radmoonduosettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADMoonDuo : public Device {
|
||||
public:
|
||||
// Serial numbers start with MD
|
||||
// USB PID is 1106, standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(RADMoonDuo, DeviceType::RADMoonDuo, "MD");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
// If Converter1 Target is set to USB/CM, OP_Ethernet2 will be exposed to the PC
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::OP_Ethernet2
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
bool getEthPhyRegControlSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
RADMoonDuo(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADMoonDuoSettings>(makeDriver);
|
||||
}
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportEthPhy = true;
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,88 +1,88 @@
|
||||
#ifndef __RADSUPERMOON_H_
|
||||
#define __RADSUPERMOON_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/device/tree/radsupermoon/radsupermoonsettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADSupermoon : public Device {
|
||||
public:
|
||||
// Serial numbers start with SM
|
||||
// USB PID is 0x1201, standard driver is FTDI3
|
||||
ICSNEO_FINDABLE_DEVICE(RADSupermoon, DeviceType::RADSupermoon, "SM");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
APM1000ET, // Keysight Branding
|
||||
};
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::Ethernet,
|
||||
Network::NetID::OP_Ethernet1,
|
||||
Network::NetID::OP_Ethernet2
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
return SKU::APM1000ET;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::APM1000ET:
|
||||
return "Keysight APM1000ET";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
bool getEthPhyRegControlSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
RADSupermoon(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADSupermoonSettings>(makeDriver);
|
||||
}
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
Device::setupPacketizer(packetizer);
|
||||
packetizer.disableChecksum = true;
|
||||
packetizer.align16bit = false;
|
||||
}
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
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); }
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __RADSUPERMOON_H_
|
||||
#define __RADSUPERMOON_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/device/tree/radsupermoon/radsupermoonsettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class RADSupermoon : public Device {
|
||||
public:
|
||||
// Serial numbers start with SM
|
||||
// USB PID is 0x1201, standard driver is FTDI3
|
||||
ICSNEO_FINDABLE_DEVICE(RADSupermoon, DeviceType::RADSupermoon, "SM");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
APM1000ET, // Keysight Branding
|
||||
};
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::Ethernet,
|
||||
Network::NetID::OP_Ethernet1,
|
||||
Network::NetID::OP_Ethernet2
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
return SKU::APM1000ET;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::APM1000ET:
|
||||
return "Keysight APM1000ET";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
bool getEthPhyRegControlSupported() const override { return true; }
|
||||
|
||||
protected:
|
||||
RADSupermoon(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<RADSupermoonSettings>(makeDriver);
|
||||
}
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
Device::setupPacketizer(packetizer);
|
||||
packetizer.disableChecksum = true;
|
||||
packetizer.align16bit = false;
|
||||
}
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
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); }
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,46 +1,46 @@
|
||||
#ifndef __VALUECAN3_H_
|
||||
#define __VALUECAN3_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/platform/ftdi.h"
|
||||
#include "icsneo/device/tree/valuecan3/valuecan3settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN3 : public Device {
|
||||
public:
|
||||
// USB PID is 0x0601, standard driver is FTDI
|
||||
ICSNEO_FINDABLE_DEVICE_BY_PID(ValueCAN3, DeviceType::VCAN3, 0x0701);
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::MSCAN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
private:
|
||||
ValueCAN3(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<ValueCAN3Settings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __VALUECAN3_H_
|
||||
#define __VALUECAN3_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/platform/ftdi.h"
|
||||
#include "icsneo/device/tree/valuecan3/valuecan3settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN3 : public Device {
|
||||
public:
|
||||
// USB PID is 0x0601, standard driver is FTDI
|
||||
ICSNEO_FINDABLE_DEVICE_BY_PID(ValueCAN3, DeviceType::VCAN3, 0x0701);
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::MSCAN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
private:
|
||||
ValueCAN3(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<ValueCAN3Settings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,47 +1,47 @@
|
||||
#ifndef __VALUECAN4_1_H_
|
||||
#define __VALUECAN4_1_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4-1settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4_1 : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with V1 for 4-1
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4_1, DeviceType::VCAN4_1, "V1");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_1(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4_1Settings>(makeDriver);
|
||||
}
|
||||
|
||||
void setupEncoder(Encoder& encoder) override {
|
||||
ValueCAN4::setupEncoder(encoder);
|
||||
encoder.supportCANFD = false; // VCAN 4-1 does not support CAN FD
|
||||
}
|
||||
|
||||
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); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __VALUECAN4_1_H_
|
||||
#define __VALUECAN4_1_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4-1settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4_1 : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with V1 for 4-1
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4_1, DeviceType::VCAN4_1, "V1");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_1(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4_1Settings>(makeDriver);
|
||||
}
|
||||
|
||||
void setupEncoder(Encoder& encoder) override {
|
||||
ValueCAN4::setupEncoder(encoder);
|
||||
encoder.supportCANFD = false; // VCAN 4-1 does not support CAN FD
|
||||
}
|
||||
|
||||
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); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,67 +1,67 @@
|
||||
#ifndef __VALUECAN4_2_H_
|
||||
#define __VALUECAN4_2_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4-2settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4_2 : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with V2 for 4-2
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4_2, DeviceType::VCAN4_2, "V2");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP0200A, // USB A and Keysight Branding
|
||||
};
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
case 'B':
|
||||
return SKU::AP0200A;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP0200A:
|
||||
return "Keysight AP0200A";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_2(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4_2Settings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __VALUECAN4_2_H_
|
||||
#define __VALUECAN4_2_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4-2settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4_2 : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with V2 for 4-2
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4_2, DeviceType::VCAN4_2, "V2");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP0200A, // USB A and Keysight Branding
|
||||
};
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
case 'B':
|
||||
return SKU::AP0200A;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP0200A:
|
||||
return "Keysight AP0200A";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_2(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4_2Settings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,98 +1,98 @@
|
||||
#ifndef __VALUECAN4_2EL_H_
|
||||
#define __VALUECAN4_2EL_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4-2elsettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4_2EL : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with VE for 4-2EL
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
// Ethernet MAC allocation is 0x0B, standard driver is Raw
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4_2EL, DeviceType::VCAN4_2EL, "VE");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP04E0A_D26, // HDB26, USB A, and Keysight Branding
|
||||
AP04E0A_MUL, // Multi-connectors, USB A, and Keysight Branding
|
||||
AP04E0A_OBD, // OBD, USB A, and Keysight Branding
|
||||
};
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
return SKU::AP04E0A_D26;
|
||||
case 'B':
|
||||
return SKU::AP04E0A_MUL;
|
||||
case 'C':
|
||||
return SKU::AP04E0A_OBD;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP04E0A_D26:
|
||||
return "Keysight AP04E0A-D26";
|
||||
case SKU::AP04E0A_MUL:
|
||||
return "Keysight AP04E0A-MUL";
|
||||
case SKU::AP04E0A_OBD:
|
||||
return "Keysight AP04E0A-OBD";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
|
||||
Network::NetID::Ethernet,
|
||||
|
||||
Network::NetID::LIN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_2EL(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4_2ELSettings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<RawMessage>& message) override {
|
||||
if(message->data.size() < sizeof(valuecan4_2el_status_t))
|
||||
return;
|
||||
std::lock_guard<std::mutex> lk(ioMutex);
|
||||
const valuecan4_2el_status_t* status = reinterpret_cast<const valuecan4_2el_status_t*>(message->data.data());
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
}
|
||||
|
||||
bool currentDriverSupportsDFU() const override { return com->driver->isEthernet(); }
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
ValueCAN4::setupPacketizer(packetizer);
|
||||
packetizer.align16bit = !com->driver->isEthernet();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __VALUECAN4_2EL_H_
|
||||
#define __VALUECAN4_2EL_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4-2elsettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4_2EL : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with VE for 4-2EL
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
// Ethernet MAC allocation is 0x0B, standard driver is Raw
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4_2EL, DeviceType::VCAN4_2EL, "VE");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP04E0A_D26, // HDB26, USB A, and Keysight Branding
|
||||
AP04E0A_MUL, // Multi-connectors, USB A, and Keysight Branding
|
||||
AP04E0A_OBD, // OBD, USB A, and Keysight Branding
|
||||
};
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
return SKU::AP04E0A_D26;
|
||||
case 'B':
|
||||
return SKU::AP04E0A_MUL;
|
||||
case 'C':
|
||||
return SKU::AP04E0A_OBD;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP04E0A_D26:
|
||||
return "Keysight AP04E0A-D26";
|
||||
case SKU::AP04E0A_MUL:
|
||||
return "Keysight AP04E0A-MUL";
|
||||
case SKU::AP04E0A_OBD:
|
||||
return "Keysight AP04E0A-OBD";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
|
||||
Network::NetID::Ethernet,
|
||||
|
||||
Network::NetID::LIN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_2EL(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4_2ELSettings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
size_t getEthernetActivationLineCount() const override { return 1; }
|
||||
|
||||
void handleDeviceStatus(const std::shared_ptr<RawMessage>& message) override {
|
||||
if(message->data.size() < sizeof(valuecan4_2el_status_t))
|
||||
return;
|
||||
std::lock_guard<std::mutex> lk(ioMutex);
|
||||
const valuecan4_2el_status_t* status = reinterpret_cast<const valuecan4_2el_status_t*>(message->data.data());
|
||||
ethActivationStatus = status->ethernetActivationLineEnabled;
|
||||
}
|
||||
|
||||
bool currentDriverSupportsDFU() const override { return com->driver->isEthernet(); }
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
ValueCAN4::setupPacketizer(packetizer);
|
||||
packetizer.align16bit = !com->driver->isEthernet();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,78 +1,78 @@
|
||||
#ifndef __VALUECAN4_4_H_
|
||||
#define __VALUECAN4_4_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4-4settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4_4 : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with V4 for 4-4
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4_4, DeviceType::VCAN4_4, "V4");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP0400A_D26, // HDB26, USB A, and Keysight Branding
|
||||
AP0400A_DB9, // 4xDB9, USB A, and Keysight Branding
|
||||
AP0400A_OBD, // OBD, USB A, and Keysight Branding
|
||||
};
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
Network::NetID::HSCAN3,
|
||||
Network::NetID::HSCAN4
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
return SKU::AP0400A_D26;
|
||||
case 'B':
|
||||
return SKU::AP0400A_DB9;
|
||||
case 'C':
|
||||
return SKU::AP0400A_OBD;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP0400A_D26:
|
||||
return "Keysight AP0400A-D26";
|
||||
case SKU::AP0400A_DB9:
|
||||
return "Keysight AP0400A-DB9";
|
||||
case SKU::AP0400A_OBD:
|
||||
return "Keysight AP0400A-OBD";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_4(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4_4Settings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __VALUECAN4_4_H_
|
||||
#define __VALUECAN4_4_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4-4settings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4_4 : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with V4 for 4-4
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4_4, DeviceType::VCAN4_4, "V4");
|
||||
|
||||
enum class SKU {
|
||||
Standard,
|
||||
AP0400A_D26, // HDB26, USB A, and Keysight Branding
|
||||
AP0400A_DB9, // 4xDB9, USB A, and Keysight Branding
|
||||
AP0400A_OBD, // OBD, USB A, and Keysight Branding
|
||||
};
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
Network::NetID::HSCAN3,
|
||||
Network::NetID::HSCAN4
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
SKU getSKU() const {
|
||||
switch(getSerial().back()) {
|
||||
case 'A':
|
||||
return SKU::AP0400A_D26;
|
||||
case 'B':
|
||||
return SKU::AP0400A_DB9;
|
||||
case 'C':
|
||||
return SKU::AP0400A_OBD;
|
||||
default:
|
||||
return SKU::Standard;
|
||||
}
|
||||
}
|
||||
|
||||
std::string getProductName() const override {
|
||||
switch(getSKU()) {
|
||||
case SKU::Standard: break;
|
||||
case SKU::AP0400A_D26:
|
||||
return "Keysight AP0400A-D26";
|
||||
case SKU::AP0400A_DB9:
|
||||
return "Keysight AP0400A-DB9";
|
||||
case SKU::AP0400A_OBD:
|
||||
return "Keysight AP0400A-OBD";
|
||||
}
|
||||
return Device::getProductName();
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4_4(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4_4Settings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,30 +1,30 @@
|
||||
#ifndef __VALUECAN4_H_
|
||||
#define __VALUECAN4_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4 : public Device {
|
||||
public:
|
||||
// All ValueCAN 4 devices share a USB PID of 0x1101
|
||||
|
||||
protected:
|
||||
using Device::Device;
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportCANFD = true;
|
||||
}
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __VALUECAN4_H_
|
||||
#define __VALUECAN4_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4 : public Device {
|
||||
public:
|
||||
// All ValueCAN 4 devices share a USB PID of 0x1101
|
||||
|
||||
protected:
|
||||
using Device::Device;
|
||||
|
||||
virtual void setupEncoder(Encoder& encoder) override {
|
||||
Device::setupEncoder(encoder);
|
||||
encoder.supportCANFD = true;
|
||||
}
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,55 +1,55 @@
|
||||
#ifndef __VALUECAN4INDUSTRIAL_H_
|
||||
#define __VALUECAN4INDUSTRIAL_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4industrialsettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4Industrial : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with IV for Industrial
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
// Ethernet MAC allocation is 0x12, standard driver is Raw
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4Industrial, DeviceType::VCAN4_IND, "IV");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
|
||||
Network::NetID::Ethernet,
|
||||
|
||||
Network::NetID::LIN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4Industrial(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4IndustrialSettings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
bool currentDriverSupportsDFU() const override { return com->driver->isEthernet(); }
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
ValueCAN4::setupPacketizer(packetizer);
|
||||
packetizer.align16bit = !com->driver->isEthernet();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __VALUECAN4INDUSTRIAL_H_
|
||||
#define __VALUECAN4INDUSTRIAL_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/tree/valuecan4/valuecan4.h"
|
||||
#include "icsneo/device/tree/valuecan4/settings/valuecan4industrialsettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class ValueCAN4Industrial : public ValueCAN4 {
|
||||
public:
|
||||
// Serial numbers start with IV for Industrial
|
||||
// USB PID is 0x1101 (shared by all ValueCAN 4s), standard driver is CDCACM
|
||||
// Ethernet MAC allocation is 0x12, standard driver is Raw
|
||||
ICSNEO_FINDABLE_DEVICE(ValueCAN4Industrial, DeviceType::VCAN4_IND, "IV");
|
||||
|
||||
static const std::vector<Network>& GetSupportedNetworks() {
|
||||
static std::vector<Network> supportedNetworks = {
|
||||
Network::NetID::HSCAN,
|
||||
Network::NetID::HSCAN2,
|
||||
|
||||
Network::NetID::Ethernet,
|
||||
|
||||
Network::NetID::LIN
|
||||
};
|
||||
return supportedNetworks;
|
||||
}
|
||||
|
||||
protected:
|
||||
ValueCAN4Industrial(neodevice_t neodevice, const driver_factory_t& makeDriver) : ValueCAN4(neodevice) {
|
||||
initialize<ValueCAN4IndustrialSettings>(makeDriver);
|
||||
}
|
||||
|
||||
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); }
|
||||
|
||||
bool currentDriverSupportsDFU() const override { return com->driver->isEthernet(); }
|
||||
|
||||
void setupPacketizer(Packetizer& packetizer) override {
|
||||
ValueCAN4::setupPacketizer(packetizer);
|
||||
packetizer.align16bit = !com->driver->isEthernet();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -1,42 +1,42 @@
|
||||
#ifndef __VIVIDCAN_H_
|
||||
#define __VIVIDCAN_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/platform/cdcacm.h"
|
||||
#include "icsneo/device/tree/vividcan/vividcansettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class VividCAN : public Device {
|
||||
public:
|
||||
// Serial numbers start with VV
|
||||
// USB PID is 0x1102, standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(VividCAN, DeviceType::VividCAN, "VV");
|
||||
|
||||
// VividCAN does not go online, you can only set settings
|
||||
bool goOnline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool goOffline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
VividCAN(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<VividCANSettings>(makeDriver);
|
||||
}
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#ifndef __VIVIDCAN_H_
|
||||
#define __VIVIDCAN_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
#include "icsneo/device/device.h"
|
||||
#include "icsneo/device/devicetype.h"
|
||||
#include "icsneo/platform/cdcacm.h"
|
||||
#include "icsneo/device/tree/vividcan/vividcansettings.h"
|
||||
|
||||
namespace icsneo {
|
||||
|
||||
class VividCAN : public Device {
|
||||
public:
|
||||
// Serial numbers start with VV
|
||||
// USB PID is 0x1102, standard driver is CDCACM
|
||||
ICSNEO_FINDABLE_DEVICE(VividCAN, DeviceType::VividCAN, "VV");
|
||||
|
||||
// VividCAN does not go online, you can only set settings
|
||||
bool goOnline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool goOffline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
protected:
|
||||
VividCAN(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
||||
initialize<VividCANSettings>(makeDriver);
|
||||
}
|
||||
|
||||
bool requiresVehiclePower() const override { return false; }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif // __cplusplus
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user