98 throw std::invalid_argument(
"buffer size should be a multiple of 8");
102 for (
size_t i = 0;
i <
buffer.size();
i += 8) {
103 uint64_t word = (
static_cast<uint64_t
>(
buffer[
i + 0])) |
104 (
static_cast<uint64_t
>(
buffer[
i + 1]) << 8) |
105 (
static_cast<uint64_t
>(
buffer[
i + 2]) << 16) |
106 (
static_cast<uint64_t
>(
buffer[
i + 3]) << 24) |
107 (
static_cast<uint64_t
>(
buffer[
i + 4]) << 32) |
108 (
static_cast<uint64_t
>(
buffer[
i + 5]) << 40) |
109 (
static_cast<uint64_t
>(
buffer[
i + 6]) << 48) |
110 (
static_cast<uint64_t
>(
buffer[
i + 7]) << 56);
112 if (word == 0xFEEDDEEDFEEDDEED) {
118 int gbt = ulword.linkID;
128 if (gbt < 0 || gbt > 11) {
131 DsElecId dsId{
static_cast<uint16_t
>(0),
static_cast<uint8_t
>(0),
static_cast<uint8_t
>(0)};
135 throw fmt::format(
"warning : out-of-range gbt {} word={:08X}\n", gbt, word);
141 auto d = mElinkDecoders.find(gbt);
142 if (d == mElinkDecoders.end()) {
147 auto solarId = mFee2SolarMapper(feeLinkId);
149 if (!solarId.has_value()) {
152 DsElecId dsId{
static_cast<uint16_t
>(0),
static_cast<uint8_t
>(0),
static_cast<uint8_t
>(0)};
156 throw std::logic_error(fmt::format(
"{} Could not get solarId from feeLinkId={}\n", __PRETTY_FUNCTION__,
asString(feeLinkId)));
160 mElinkDecoders.emplace(
static_cast<uint16_t
>(gbt),
161 impl::makeArray<40>([solarId, *
this](
size_t i) {
162 DsElecId dselec{solarId.value(),
static_cast<uint8_t
>(
i / 5),
static_cast<uint8_t
>(
i % 5)};
165 d = mElinkDecoders.find(gbt);
168 uint16_t dsid = ulword.dsID;
172 DsElecId dsId{
static_cast<uint16_t
>(0),
static_cast<uint8_t
>(0),
static_cast<uint8_t
>(0)};
176 throw fmt::format(
"warning : out-of-range DS ID {} word={:08X}\n", dsid, word);
180 int8_t error = ulword.error;
181 bool incomplete = ulword.incomplete > 0;
182 uint64_t data50 = ulword.data;
184 d->second.at(dsid).append(data50, error, incomplete);