|
| 1 | +// Copyright CERN and copyright holders of ALICE O2. This software is |
| 2 | +// distributed under the terms of the GNU General Public License v3 (GPL |
| 3 | +// Version 3), copied verbatim in the file "COPYING". |
| 4 | +// |
| 5 | +// See http://alice-o2.web.cern.ch/license for full licensing information. |
| 6 | +// |
| 7 | +// In applying this license CERN does not waive the privileges and immunities |
| 8 | +// granted to it by virtue of its status as an Intergovernmental Organization |
| 9 | +// or submit itself to any jurisdiction. |
| 10 | + |
| 11 | +/// \file ProgramFirmwareCheck.cxx |
| 12 | +/// \brief Tool that checks the FW compatibility of the ReadoutCards. |
| 13 | +/// |
| 14 | +/// \author Kostas Alexopoulos ([email protected]) |
| 15 | + |
| 16 | +#include "CommandLineUtilities/Options.h" |
| 17 | +#include "CommandLineUtilities/Program.h" |
| 18 | +#include "ReadoutCard/FirmwareChecker.h" |
| 19 | +#include "RocPciDevice.h" |
| 20 | + |
| 21 | +using namespace AliceO2::roc::CommandLineUtilities; |
| 22 | +using namespace AliceO2::roc; |
| 23 | +namespace po = boost::program_options; |
| 24 | + |
| 25 | +class ProgramFirmwareCheck : public Program |
| 26 | +{ |
| 27 | + public: |
| 28 | + ProgramFirmwareCheck() : Program() |
| 29 | + { |
| 30 | + } |
| 31 | + |
| 32 | + virtual Description getDescription() |
| 33 | + { |
| 34 | + return { "Firmware Check", "Check firmware compatibility of the ReadoutCard(s)", |
| 35 | + "roc-fw-check\n" }; |
| 36 | + } |
| 37 | + |
| 38 | + virtual void addOptions(boost::program_options::options_description&) |
| 39 | + { |
| 40 | + } |
| 41 | + |
| 42 | + virtual void run(const boost::program_options::variables_map&) |
| 43 | + { |
| 44 | + auto cardsFound = RocPciDevice::findSystemDevices(); |
| 45 | + for (auto const& card : cardsFound) { |
| 46 | + auto params = Parameters::makeParameters(card.pciAddress, 2); |
| 47 | + FirmwareChecker().checkFirmwareCompatibility(params); |
| 48 | + } |
| 49 | + return; |
| 50 | + } |
| 51 | +}; |
| 52 | + |
| 53 | +int main(int argc, char** argv) |
| 54 | +{ |
| 55 | + return ProgramFirmwareCheck().execute(argc, argv); |
| 56 | +} |
0 commit comments