Skip to content

Commit 25c1534

Browse files
committed
[serial] Extend serial number to 4 digits
1 parent 6cec110 commit 25c1534

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/CommandLineUtilities/ProgramListCards.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ProgramListCards : public Program
9494

9595
// Pad the serial with 0s if necessary
9696
// It should always be used as 3 chars to avoid conflicts with the sequence id
97-
boost::format serialFormat("%03d");
97+
boost::format serialFormat("%04d");
9898
serialFormat % std::to_string(card.serialId.getSerial());
9999

100100
std::string serial = serialFormat.str();

src/Crorc/CrorcBar.cxx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,13 @@ boost::optional<int32_t> CrorcBar::getSerialNumber()
8181
return Crorc::getSerial(*(mPdaBar.get()));
8282
} else {
8383
// Register format e.g. 0x32343932
84-
// transltes to -> 2942 -> 942 (keep 3)
84+
// transltes to -> 2942
8585
std::stringstream serialString;
8686

8787
serialString << char(serial & 0xff)
8888
<< char((serial & 0xff00) >> 8)
89-
<< char((serial & 0xff0000) >> 16);
89+
<< char((serial & 0xff0000) >> 16)
90+
<< char((serial & 0xff000000) >> 24);
9091

9192
try {
9293
return std::stoi(serialString.str());

src/Cru/CruBar.cxx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,14 @@ boost::optional<int32_t> CruBar::getSerialNumber()
280280
boost::optional<int32_t> serial = eeprom.getSerial();
281281
return serial;
282282
} else { // v3.6.3+
283-
// Register format e.g. 0x343230
284-
// translates to -> 024
283+
// Register format e.g. 0x35343230
284+
// translates to -> 0245
285285
std::stringstream serialString;
286286

287287
serialString << char(serial & 0xff)
288288
<< char((serial & 0xff00) >> 8)
289-
<< char((serial & 0xff0000) >> 16);
289+
<< char((serial & 0xff0000) >> 16)
290+
<< char((serial & 0xff000000) >> 24);
290291

291292
try {
292293
return std::stoi(serialString.str());

0 commit comments

Comments
 (0)