aboutsummaryrefslogtreecommitdiffstats
path: root/etisnoop.cpp
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-29 14:52:55 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2016-01-29 14:52:55 +0100
commitd88b39936c92d37147f7f3a38d87c0aac8846c56 (patch)
tree2e956782258d57b9a2976d5412d7700ce82fd419 /etisnoop.cpp
parent282a550f6223f95f7251be8a719b1b62fa063fb5 (diff)
downloadetisnoop-d88b39936c92d37147f7f3a38d87c0aac8846c56.tar.gz
etisnoop-d88b39936c92d37147f7f3a38d87c0aac8846c56.tar.bz2
etisnoop-d88b39936c92d37147f7f3a38d87c0aac8846c56.zip
Clarify TIST decoding
Diffstat (limited to 'etisnoop.cpp')
-rw-r--r--etisnoop.cpp19
1 files changed, 12 insertions, 7 deletions
diff --git a/etisnoop.cpp b/etisnoop.cpp
index 70ac0be..ed9a420 100644
--- a/etisnoop.cpp
+++ b/etisnoop.cpp
@@ -269,7 +269,7 @@ int eti_analyse(eti_analyse_config_t& config)
uint8_t ficf,nst,fp,mid,ficl;
uint16_t fl,crch;
uint16_t crc;
- uint8_t scid,tpl,l1;
+ uint8_t scid,tpl;
uint16_t sad[64],stl[64];
char sdesc[256];
uint32_t frame_nb = 0, frame_sec = 0, frame_ms = 0, frame_h, frame_m, frame_s;
@@ -618,7 +618,8 @@ int eti_analyse(eti_analyse_config_t& config)
}
- // EOF
+ //* EOF (4 Bytes)
+ // CRC (2 Bytes)
crch = p[12 + 4*nst + ficf*ficl*4 + offset] * 256 + \
p[12 + 4*nst + ficf*ficl*4 + offset + 1];
@@ -635,14 +636,18 @@ int eti_analyse(eti_analyse_config_t& config)
printbuf("EOF", 1, p + 12 + 4*nst + ficf*ficl*4 + offset, 4);
printbuf("CRC", 2, p + 12 + 4*nst + ficf*ficl*4 + offset, 2, sdesc);
- //RFU
+ // RFU (2 Bytes)
printbuf("RFU", 2, p + 12 + 4*nst + ficf*ficl*4 + offset + 2, 2);
- //TIST
- l1 = (p[12 + 4*nst + ficf*ficl*4 + offset + 5] & 0xfe) >> 1;
- sprintf(sdesc, "%d ms", l1*8);
- printbuf("TIST - Time Stamp", 1, p+12+4*nst+ficf*ficl*4+offset+4, 4, sdesc);
+ //* TIST (4 Bytes)
+ const size_t tist_ix = 12 + 4*nst + ficf*ficl*4 + offset + 4;
+ uint32_t TIST = (uint32_t)(p[tist_ix]) << 24 |
+ (uint32_t)(p[tist_ix+1]) << 16 |
+ (uint32_t)(p[tist_ix+2]) << 8 |
+ (uint32_t)(p[tist_ix+3]);
+ sprintf(sdesc, "%f ms", (TIST & 0xFFFFFF) / 16384.0);
+ printbuf("TIST - Time Stamp", 1, p + tist_ix, 4, sdesc);
if (get_verbosity()) {
printf("-------------------------------------------------------------------------------------------------------------\n");