From eca11103055ca7a686082b7539b46ba476c71029 Mon Sep 17 00:00:00 2001 From: Paul Hollinsky Date: Tue, 4 May 2021 23:08:34 -0400 Subject: [PATCH] ValueCAN 4-2EL: Allow the Ethernet network while communicating over it All frames except for the CAB1/CAB2 communication are reported --- .../device/tree/valuecan4/valuecan4-2el.h | 18 ++++++++++++++++++ .../device/tree/valuecan4/valuecan4-2eleth.h | 19 ------------------- .../device/tree/valuecan4/valuecan4-2elusb.h | 19 ------------------- 3 files changed, 18 insertions(+), 38 deletions(-) diff --git a/include/icsneo/device/tree/valuecan4/valuecan4-2el.h b/include/icsneo/device/tree/valuecan4/valuecan4-2el.h index 1bccb88..962fe6c 100644 --- a/include/icsneo/device/tree/valuecan4/valuecan4-2el.h +++ b/include/icsneo/device/tree/valuecan4/valuecan4-2el.h @@ -48,11 +48,29 @@ public: return Device::getProductName(); } + static const std::vector& GetSupportedNetworks() { + static std::vector supportedNetworks = { + Network::NetID::HSCAN, + Network::NetID::HSCAN2, + + Network::NetID::Ethernet + }; + return supportedNetworks; + } + protected: ValueCAN4_2EL(neodevice_t neodevice) : ValueCAN4(neodevice) { getWritableNeoDevice().type = DEVICE_TYPE; } + 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); } + size_t getEthernetActivationLineCount() const override { return 1; } void handleDeviceStatus(const std::shared_ptr& message) override { diff --git a/include/icsneo/device/tree/valuecan4/valuecan4-2eleth.h b/include/icsneo/device/tree/valuecan4/valuecan4-2eleth.h index 75aed6a..9560fcf 100644 --- a/include/icsneo/device/tree/valuecan4/valuecan4-2eleth.h +++ b/include/icsneo/device/tree/valuecan4/valuecan4-2eleth.h @@ -46,27 +46,8 @@ public: return found; } - static const std::vector& GetSupportedNetworks() { - static std::vector supportedNetworks = { - Network::NetID::HSCAN, - Network::NetID::HSCAN2, - - // No Network::NetID::Ethernet, since we're communicating over it instead - }; - return supportedNetworks; - } - bool currentDriverSupportsDFU() const override { return false; } -protected: - virtual 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 - virtual void setupSupportedTXNetworks(std::vector& txNetworks) override { setupSupportedRXNetworks(txNetworks); } - private: ValueCAN4_2EL_ETH(neodevice_t neodevice) : ValueCAN4_2EL(neodevice) { initialize(); diff --git a/include/icsneo/device/tree/valuecan4/valuecan4-2elusb.h b/include/icsneo/device/tree/valuecan4/valuecan4-2elusb.h index a5c24ec..ae9756b 100644 --- a/include/icsneo/device/tree/valuecan4/valuecan4-2elusb.h +++ b/include/icsneo/device/tree/valuecan4/valuecan4-2elusb.h @@ -22,25 +22,6 @@ public: return found; } - static const std::vector& GetSupportedNetworks() { - static std::vector supportedNetworks = { - Network::NetID::HSCAN, - Network::NetID::HSCAN2, - - Network::NetID::Ethernet - }; - return supportedNetworks; - } - -protected: - virtual 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 - virtual void setupSupportedTXNetworks(std::vector& txNetworks) override { setupSupportedRXNetworks(txNetworks); } - private: ValueCAN4_2EL_USB(neodevice_t neodevice) : ValueCAN4_2EL(neodevice) { initialize();