Skip to content

Commit 6851295

Browse files
committed
Add magic printout
1 parent abc1508 commit 6851295

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

plugins/dogma/dogma/defines.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ namespace dogma {
5353

5454
inline bool IsMagicTdc5() const { return GetMagicType() == 0x1e; }
5555

56+
inline uint32_t GetMagic() const { return SWAP_VALUE(tuMagic); }
57+
5658
inline uint32_t GetAddr() const { return SWAP_VALUE(tuAddr); }
5759

5860
inline uint32_t GetTrigType() const { return SWAP_VALUE(tuTrigTypeNumber) >> 24; }
@@ -85,12 +87,12 @@ namespace dogma {
8587
tuLenPayload = SWAP_VALUE(new_payload);
8688
}
8789

88-
inline uint32_t SetTdc5PaketLength(uint32_t sz)
90+
inline uint32_t SetTdc5PaketLength(uint32_t sz)
8991
{
9092
if (sz < sizeof(DogmaTu))
9193
sz = sizeof(DogmaTu);
9294
uint32_t sz4 = sz / 4, odd_len = sz - sz4 * 4;
93-
if (odd_len > 0)
95+
if (odd_len > 0)
9496
sz4++;
9597
SetPayloadLen(sz4 - sizeof(DogmaTu) / 4);
9698
SetFrameBits(odd_len); // store in frame bits extra bytes not match to 4 bytes borders

plugins/dogma/src/UdpTransport.cxx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ bool dogma::UdpAddon::ReadUdp()
185185
errmsg = "Magic number not match";
186186
} else if (tu->IsMagicDefault()) {
187187
msgsize = tu->GetSize(); // size must match with number of received bytes
188-
if (res != msgsize)
188+
if (res != msgsize)
189189
errmsg = dabc::format("Send buffer %u differ from message size %u - ignore it", (unsigned) res, (unsigned) msgsize);
190190
} else if (tu->IsMagicTdc5()) {
191191
msgsize = tu->SetTdc5PaketLength(res); // total size will be rounded by 4 bytes boundary
@@ -195,6 +195,7 @@ bool dogma::UdpAddon::ReadUdp()
195195
} else {
196196
fTotalDiscardMagic++;
197197
errmsg = "Magic subtype not match";
198+
DOUT0("Magic %08x", tu->GetMagic());
198199
}
199200

200201
if (!errmsg.empty()) {

0 commit comments

Comments
 (0)