From ff01cc62531c9346a9b7955b49115e0f641d8727 Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Thu, 25 Jun 2020 17:20:41 +0200
Subject: [PATCH] In raw StsXyter message class, adapt the error flags width
 and add enum class describing them

---
 core/data/raw/StsXyterMessage.h | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/core/data/raw/StsXyterMessage.h b/core/data/raw/StsXyterMessage.h
index 973904fd56..28f44cb431 100644
--- a/core/data/raw/StsXyterMessage.h
+++ b/core/data/raw/StsXyterMessage.h
@@ -55,6 +55,14 @@ namespace stsxyter {
       msg_print_Human  = (0x1 << 3)
    };
    ENABLE_BITMASK_OPERATORS( stsxyter::MessagePrintMask ) // Preproc macro!
+      /// MS error flags
+   enum class MsErrorFlags : uint16_t
+   {
+      MsErrOutFifoAlmostFull =  (0x1 << 0),
+      MsErrOutFifoOverflow   =  (0x1 << 1),
+      MsErrTimeoutBinReadout =  (0x1 << 2),
+      MsErrBinOverflow       =  (0x1 << 3)
+   };
 
       /// Fields position (Start bit index)
    static const uint16_t kusPosNotHitFlag = 31;
@@ -79,8 +87,8 @@ namespace stsxyter {
    static const uint16_t kusPosStatCpFlag =  0;
          // Empty/End of MS
    static const uint16_t kusPosEmptyFlag  = 28;
-   static const uint16_t kusPosMsErrFlag  =  2;
-   static const uint16_t kusPosMsErrType  =  0;
+   static const uint16_t kusPosMsErrType  =  1;
+   static const uint16_t kusPosMsErrFlag  =  0;
 
       /// Fields length (bits)
    static const uint16_t kusLenNotHitFlag =  1;
@@ -107,8 +115,8 @@ namespace stsxyter {
    static const uint16_t kusLenStatCpFlag =  1;
          // Empty/End of MS
    static const uint16_t kusLenEmptyFlag  =  1;
+   static const uint16_t kusLenMsErrType  =  4;
    static const uint16_t kusLenMsErrFlag  =  1;
-   static const uint16_t kusLenMsErrType  =  2;
 
       /// Fields Info
    static const MessField kFieldLinkIndex(  kusPosLinkIndex,  kusLenLinkIndex );
-- 
GitLab