27 mMinimumSize = isBare ? 5 : 6;
28 mMaximumSize = isBare ? 21 : 22;
29 mTotalSize = mMinimumSize;
32bool ELinkDecoder::add(
size_t& idx, gsl::span<const uint8_t> payload,
size_t nBytes,
size_t step)
35 auto size = payload.size();
36 auto end = idx + step * nBytes;
41 for (; idx <
end; idx += step) {
42 mBytes.emplace_back(payload[idx]);
45 return (nAdded == nBytes);
51 auto remaining = mTotalSize - mBytes.size();
52 if (
add(idx, payload, remaining, step)) {
53 if (mTotalSize == mMinimumSize) {
55 remaining = mTotalSize - mBytes.size();
57 return add(idx, payload, remaining, step);
68 mBytes.emplace_back(
byte);
69 if (mBytes.size() == mMinimumSize) {
74void ELinkDecoder::computeSize()
80 for (
int ich = 0; ich < 4; ++ich) {
81 if ((
mask >> ich) & 0x1) {
93 mTotalSize = mMinimumSize;
100 if (((
mask >> chamber) & 0x1) == 0) {
104 int idx = mBytes.size();
105 for (
int ich = 0; ich <= chamber; ++ich) {
106 if ((
mask >> ich) & 0x1) {
113 return joinBytes(idx);
unsigned short int uint16_t
uint8_t getInputs() const
Gets the inputs.
uint16_t getPattern(int cathode, int chamber) const
void add(const uint8_t byte)
Adds a byte.
void setBareDecoder(bool isBare)
void addAndComputeSize(const uint8_t byte)
bool isLoc(uint8_t statusWord)
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...