From 7f27b30954bd5003943027c4234b5750a6d5bfc7 Mon Sep 17 00:00:00 2001 From: Jeffrey Quesnelle Date: Fri, 26 Feb 2021 10:38:38 -0500 Subject: [PATCH] Make icsneo::Plasion::GetSupportedNetworks public --- include/icsneo/device/tree/plasion/plasion.h | 53 ++++++++++---------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/include/icsneo/device/tree/plasion/plasion.h b/include/icsneo/device/tree/plasion/plasion.h index 8cd65d1..f28df3d 100644 --- a/include/icsneo/device/tree/plasion/plasion.h +++ b/include/icsneo/device/tree/plasion/plasion.h @@ -11,32 +11,7 @@ namespace icsneo { class Plasion : public Device { -protected: - virtual std::shared_ptr makeCommunication( - std::unique_ptr transport, - std::function()> makeConfiguredPacketizer, - std::unique_ptr encoder, - std::unique_ptr decoder - ) override { - return std::make_shared( - report, - std::move(transport), - makeConfiguredPacketizer, - std::move(encoder), - std::move(decoder) - ); - } - - // TODO This is done so that Plasion can still transmit it's basic networks, awaiting slave VNET support - virtual bool isSupportedRXNetwork(const Network&) const override { return true; } - virtual bool isSupportedTXNetwork(const Network&) const override { return true; } - virtual void setupExtensions() override { - std::vector flexRayControllers; - flexRayControllers.push_back(Network::NetID::FlexRay); - flexRayControllers.push_back(Network::NetID::FlexRay); // TODO Becomes FlexRay2 if not in coldstart mode - addExtension(std::make_shared(*this, flexRayControllers)); - } - +public: static const std::vector& GetSupportedNetworks() { static std::vector supportedNetworks = { Network::NetID::HSCAN, @@ -66,6 +41,32 @@ protected: return supportedNetworks; } +protected: + virtual std::shared_ptr makeCommunication( + std::unique_ptr transport, + std::function()> makeConfiguredPacketizer, + std::unique_ptr encoder, + std::unique_ptr decoder + ) override { + return std::make_shared( + report, + std::move(transport), + makeConfiguredPacketizer, + std::move(encoder), + std::move(decoder) + ); + } + + // TODO This is done so that Plasion can still transmit it's basic networks, awaiting slave VNET support + virtual bool isSupportedRXNetwork(const Network&) const override { return true; } + virtual bool isSupportedTXNetwork(const Network&) const override { return true; } + virtual void setupExtensions() override { + std::vector flexRayControllers; + flexRayControllers.push_back(Network::NetID::FlexRay); + flexRayControllers.push_back(Network::NetID::FlexRay); // TODO Becomes FlexRay2 if not in coldstart mode + addExtension(std::make_shared(*this, flexRayControllers)); + } + virtual void setupSupportedRXNetworks(std::vector& rxNetworks) override { for(auto& netid : GetSupportedNetworks()) rxNetworks.emplace_back(netid);