Basic introspection for device supported networks

This commit is contained in:
Paul Hollinsky
2019-01-03 17:00:15 -05:00
parent efd5547e5c
commit 7e9fbc4959
17 changed files with 317 additions and 38 deletions
@@ -21,12 +21,25 @@ public:
return found;
}
static constexpr Network::NetID SUPPORTED_NETWORKS[] = {
Network::NetID::HSCAN,
Network::NetID::HSCAN2
};
private:
NeoOBD2SIM(neodevice_t neodevice) : Device(neodevice) {
initialize<STM32>();
getWritableNeoDevice().type = DEVICE_TYPE;
productId = PRODUCT_ID;
}
virtual void setupSupportedRXNetworks(std::vector<Network>& rxNetworks) override {
for(auto& netid : SUPPORTED_NETWORKS)
rxNetworks.emplace_back(netid);
}
// 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); }
};
}