@@ -398,23 +398,30 @@ class ProgramAliceLowlevelFrontendServer: public AliceO2::Common::Program
398398 auto sca = Sca (*bar2, bar2->getCardType ());
399399
400400 for (std::string token : tokenizer (parameter, sep)) {
401- // Walk through the tokens, these should be the pairs. The pairs are comma-separated, so we split those.
402- std::vector<std::string> pair = split (token, " ," );
403- if (pair.size () != 2 ) {
404- BOOST_THROW_EXCEPTION (
405- AlfException () << ErrorInfo::Message (" SCA command-data pair not formatted correctly" ));
406- }
407- auto command = convertHexString (pair[0 ]);
408- auto data = convertHexString (pair[1 ]);
409- try {
410- sca.write (command, data);
411- auto result = sca.read ();
412- getInfoLogger () << (b::format (" cmd=0x%x data=0x%x result=0x%x" ) % command % data % result.data ).str () << endm;
413- resultBuffer << std::hex << result.data << ' \n ' ;
414- } catch (const ScaException& e) {
415- // If an SCA error occurs, we stop executing the sequence of commands and return the results as far as we got
416- // them
417- break ;
401+ // Walk through the tokens, these should be the pairs (or comments).
402+ if (token.find (' #' ) == 0 ) {
403+ // We have a comment, skip this token
404+ continue ;
405+ } else {
406+ // The pairs are comma-separated, so we split them.
407+ std::vector<std::string> pair = split (token, " ," );
408+ if (pair.size () != 2 ) {
409+ BOOST_THROW_EXCEPTION (
410+ AlfException () << ErrorInfo::Message (" SCA command-data pair not formatted correctly" ));
411+ }
412+ auto command = convertHexString (pair[0 ]);
413+ auto data = convertHexString (pair[1 ]);
414+ try {
415+ sca.write (command, data);
416+ auto result = sca.read ();
417+ getInfoLogger () << (b::format (" cmd=0x%x data=0x%x result=0x%x" ) % command % data % result.data ).str ()
418+ << endm;
419+ resultBuffer << std::hex << result.data << ' \n ' ;
420+ } catch (const ScaException &e) {
421+ // If an SCA error occurs, we stop executing the sequence of commands and return the results as far as we got
422+ // them
423+ break ;
424+ }
418425 }
419426 }
420427
0 commit comments