65 lines
1.8 KiB
C++
65 lines
1.8 KiB
C++
#ifndef __NEOVIRED2_H_
|
|
#define __NEOVIRED2_H_
|
|
|
|
#include "icsneo/device/device.h"
|
|
#include "icsneo/device/devicetype.h"
|
|
#include "icsneo/disk/extextractordiskreaddriver.h"
|
|
#include "icsneo/disk/neomemorydiskdriver.h"
|
|
#include "icsneo/device/tree/neovired2/neovired2settings.h"
|
|
|
|
namespace icsneo {
|
|
|
|
class NeoVIRED2 : public Device {
|
|
public:
|
|
// Serial numbers start with D2
|
|
// Ethernet MAC allocation is 0x0E, standard driver is Raw
|
|
ICSNEO_FINDABLE_DEVICE(NeoVIRED2, DeviceType::RED2, "D2");
|
|
|
|
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::Ethernet,
|
|
|
|
Network::NetID::LIN,
|
|
Network::NetID::LIN2
|
|
};
|
|
return supportedNetworks;
|
|
}
|
|
|
|
protected:
|
|
NeoVIRED2(neodevice_t neodevice, const driver_factory_t& makeDriver) : Device(neodevice) {
|
|
initialize<NeoVIRED2Settings, Disk::ExtExtractorDiskReadDriver, Disk::NeoMemoryDiskDriver>(makeDriver);
|
|
}
|
|
|
|
virtual void setupEncoder(Encoder& encoder) override {
|
|
Device::setupEncoder(encoder);
|
|
encoder.supportCANFD = true;
|
|
}
|
|
|
|
void setupPacketizer(Packetizer& packetizer) override {
|
|
Device::setupPacketizer(packetizer);
|
|
packetizer.align16bit = false;
|
|
}
|
|
|
|
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 supportsWiVI() const override { return true; }
|
|
};
|
|
|
|
}
|
|
|
|
#endif |