Skip to content

Commit 518ac0f

Browse files
ALF: Change delimiter of SCA_WRITE_SEQUENCE from ';' to '\n'
1 parent 7bbd748 commit 518ac0f

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

src/CommandLineUtilities/AliceLowlevelFrontend/AliceLowlevelFrontend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ class ScaWriteSequence: DimRpcInfoWrapper
286286
for (size_t i = 0; i < sequence.size(); ++i) {
287287
buffer << sequence[i].first << ',' << sequence[i].second;
288288
if (i + 1 < sequence.size()) {
289-
buffer << ';';
289+
buffer << '\n';
290290
}
291291
}
292292
return write(buffer.str());

src/CommandLineUtilities/AliceLowlevelFrontend/ProgramAliceLowlevelFrontendServer.cxx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,11 +390,10 @@ class ProgramAliceLowlevelFrontendServer: public AliceO2::Common::Program
390390
{
391391
getInfoLogger() << "SCA_BLOB_WRITE size=" << parameter.size() << " bytes" << endm;
392392

393-
// We first split on ; to get the pairs of SCA command and SCA data
393+
// We first split on \n to get the pairs of SCA command and SCA data
394394
// Since this can be an enormous list of pairs, we walk through it using the tokenizer
395-
auto commandDataPairs = split(parameter, ";");
396395
using tokenizer = boost::tokenizer<boost::char_separator<char>>;
397-
boost::char_separator<char> sep(";", "", boost::drop_empty_tokens); // Drop ";" delimiters, keep none
396+
boost::char_separator<char> sep("\n", "", boost::drop_empty_tokens); // Drop '\n' delimiters, keep none
398397
std::stringstream resultBuffer;
399398
auto sca = Sca(*bar2, bar2->getCardType());
400399

@@ -411,7 +410,7 @@ class ProgramAliceLowlevelFrontendServer: public AliceO2::Common::Program
411410
sca.write(command, data);
412411
auto result = sca.read();
413412
getInfoLogger() << (b::format("cmd=0x%x data=0x%x result=0x%x") % command % data % result.data).str() << endm;
414-
resultBuffer << std::hex << result.data << ';';
413+
resultBuffer << std::hex << result.data << '\n';
415414
} catch (const ScaException& e) {
416415
// If an SCA error occurs, we stop executing the sequence of commands and return the results as far as we got
417416
// them

src/CommandLineUtilities/AliceLowlevelFrontend/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,22 @@ A basic write to the SCA
5555
Write a sequence of values to the SCA
5656
* Service type: RPC call
5757
* Service name: SCA_SEQUENCE_WRITE
58-
* Parameters: A sequence of pairs of SCA command and data. The pairs are separated by semicolon, the command and data by
58+
* Parameters: A sequence of pairs of SCA command and data. The pairs are separated by newline, the command and data by
5959
comma:
6060
~~~
61-
[command 0],[data 0];[command 1],[data 1]; ...
61+
"[command 0],[data 0]\n[command 1],[data 1]\n[etc.]"
6262
~~~
6363
For example:
6464
~~~
65-
10,11;20,21;30,31
65+
"10,11\n20,21\n30,31"
6666
~~~
6767
* Return: A sequence of SCA read return values corresponding to the commands from the input sequence:
6868
~~~
69-
[value 0];[value 1]; ...
69+
"[value 0]\n[value 1]\n[etc.]"
7070
~~~
7171
For example:
7272
~~~
73-
42;123;555
73+
"42\n123\n555"
7474
~~~
7575
If an SCA error occurred, the sequence of return values will go up to that point.
7676
If another type of error occurred (such as a formatting error), it will return a failure string.

0 commit comments

Comments
 (0)