@@ -58,6 +58,9 @@ class ProgramStatus : public Program
5858 options.add_options ()(" onu-status" ,
5959 po::bool_switch (&mOptions .onu ),
6060 " Toggle ONU status output" );
61+ options.add_options ()(" fec-status" ,
62+ po::bool_switch (&mOptions .fec ),
63+ " Toggle FEC status output" );
6164 options.add_options ()(" links" ,
6265 po::value<std::string>(&mOptions .links )->default_value (" 0-11" ),
6366 " Links to show (all by default)" );
@@ -304,6 +307,43 @@ class ProgramStatus : public Program
304307 }
305308 }
306309
310+ /* FEC PARAMETERS */
311+ if (mOptions .fec ) {
312+ Cru::FecStatus fecStatus = cruBar2->reportFecStatus ();
313+
314+ if (mOptions .monitoring ) {
315+ monitoring->send (Metric{ " fec" }
316+ .addValue (fecStatus.clearFecCrcError , " clearFecCrcErrors" )
317+ .addValue (fecStatus.latchFecCrcError , " latchFecCrcErrors" )
318+ .addValue (fecStatus.slowControlFramingLocked , " slowControlFramingLocked" )
319+ .addValue (fecStatus.fecSingleErrorCount , " fecSingleErrorCount" )
320+ .addValue (fecStatus.fecDoubleErrorCount , " fecDoubleErrorCount" )
321+ .addValue (fecStatus.crcErrorCount , " crcErrorCount" )
322+ .addTag (tags::Key::SerialId, card.serialId .getSerial ())
323+ .addTag (tags::Key::Endpoint, card.serialId .getEndpoint ())
324+ .addTag (tags::Key::ID, card.sequenceId )
325+ .addTag (tags::Key::Type, tags::Value::CRU));
326+ } else if (mOptions .jsonOut ) {
327+ root.put (" clearFecCrcErrors" , fecStatus.clearFecCrcError );
328+ root.put (" latchFecCrcErrors" , fecStatus.latchFecCrcError );
329+ root.put (" slowControlFramingLocked" , fecStatus.slowControlFramingLocked );
330+ root.put (" fecSingleErrorCount" , fecStatus.fecSingleErrorCount );
331+ root.put (" fecDoubleErrorCount" , fecStatus.fecDoubleErrorCount );
332+ root.put (" crcErrorCount" , fecStatus.crcErrorCount );
333+ } else {
334+ std::cout << " =====================================" << std::endl;
335+ std::cout << " Clear FEC & CRC errors: \t " << std::boolalpha << fecStatus.clearFecCrcError << std::endl;
336+ std::cout << " Latch FEC & CRC errors: \t " << std::boolalpha << fecStatus.latchFecCrcError << std::endl;
337+ std::cout << " Slow Control Framing locked: \t " << std::boolalpha << fecStatus.slowControlFramingLocked << std::endl;
338+ std::cout << " FEC single error count: \t "
339+ << " 0x" << std::hex << fecStatus.fecSingleErrorCount << std::endl;
340+ std::cout << " FEC double error count: \t "
341+ << " 0x" << std::hex << fecStatus.fecDoubleErrorCount << std::endl;
342+ std::cout << " CRC error count: \t\t "
343+ << " 0x" << std::hex << fecStatus.crcErrorCount << std::endl;
344+ }
345+ }
346+
307347 /* PARAMETERS PER LINK */
308348 for (const auto & el : reportInfo.linkMap ) {
309349 auto link = el.second ;
@@ -409,6 +449,7 @@ class ProgramStatus : public Program
409449 bool jsonOut = false ;
410450 bool monitoring = false ;
411451 bool onu = false ;
452+ bool fec = false ;
412453 } mOptions ;
413454};
414455
0 commit comments