|
25 | 25 | #include "ReadoutCard/CardDescriptor.h" |
26 | 26 | #include "ReadoutCard/CardFinder.h" |
27 | 27 | #include "ReadoutCard/ChannelFactory.h" |
| 28 | +#include "ReadoutCard/Exception.h" |
| 29 | +#include "ReadoutCard/FirmwareChecker.h" |
28 | 30 |
|
29 | 31 | namespace ip = boost::asio::ip; |
30 | 32 | namespace po = boost::program_options; |
@@ -53,6 +55,9 @@ class Alf : public AliceO2::Common::Program |
53 | 55 | options.add_options()("dim-dns-node", |
54 | 56 | po::value<std::string>(&mOptions.dimDnsNode)->default_value(""), |
55 | 57 | "The DIM DNS node to set the env var if not already set"); |
| 58 | + options.add_options()("no-fw-check", |
| 59 | + po::bool_switch(&mOptions.noFirmwareCheck)->default_value(false), |
| 60 | + "Disable firmware compatibility check"); |
56 | 61 | } |
57 | 62 |
|
58 | 63 | virtual void run(const po::variables_map&) override |
@@ -89,8 +94,16 @@ class Alf : public AliceO2::Common::Program |
89 | 94 | std::shared_ptr<roc::BarInterface> bar2; |
90 | 95 |
|
91 | 96 | // Make the RPC services for every card & link |
92 | | - if (card.cardType == roc::CardType::Cru) { //TODO: To be deprecated when findCards supports types |
93 | | - //TODO: What about CRORC ???????? |
| 97 | + if (card.cardType == roc::CardType::Cru) { |
| 98 | + |
| 99 | + if (!mOptions.noFirmwareCheck) { |
| 100 | + try { |
| 101 | + roc::FirmwareChecker().checkFirmwareCompatibility(card.pciAddress); |
| 102 | + } catch (const roc::Exception& e) { |
| 103 | + getWarningLogger() << boost::diagnostic_information(e) << endm; |
| 104 | + continue; |
| 105 | + } |
| 106 | + } |
94 | 107 |
|
95 | 108 | //auto serialMaybe = card.serialNumber.get(); |
96 | 109 | //int serial = serialMaybe ? serialMaybe : fakeSerial++; |
@@ -124,6 +137,7 @@ class Alf : public AliceO2::Common::Program |
124 | 137 | private: |
125 | 138 | struct OptionsStruct { |
126 | 139 | std::string dimDnsNode = ""; |
| 140 | + bool noFirmwareCheck = false; |
127 | 141 | } mOptions; |
128 | 142 | }; |
129 | 143 |
|
|
0 commit comments