Index: sources/canbus/messageglobals.h =================================================================== diff -u -re58b907a69d4ca7daa77d69791593b886d1b80e8 -r8c69137f18382bdc55a5678e6ed44a7683fe4dea --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision e58b907a69d4ca7daa77d69791593b886d1b80e8) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision 8c69137f18382bdc55a5678e6ed44a7683fe4dea) @@ -18,10 +18,19 @@ // Project #include "guiglobals.h" +#include "types.h" namespace Can { /*! + * \brief Sequence + * \details the messages sequence type + */ +typedef qint16 Sequence; +typedef Types::S16 Sequence_Bytes; +#define SEQUENCE_MAX INT16_MAX + +/*! * \brief Payload Length * \details List of each ActionID required data (in byte) length in the message. * So the data collector has to collect this amount of bytes as payload of a message. @@ -50,11 +59,7 @@ */ enum Frame_Data : quint8 { eLenCanFrame = 8, ///< The length of each can frame. Should be padded by 0x00 if is less. -#ifdef DISABLE_SEQUENCE - eLenHeaderInfo = 3, ///< The Header length witch is included in CRC after Sync byte -#else eLenHeaderInfo = 5, ///< The Header length witch is included in CRC after Sync byte (it's the sum of eLenSequence + eLenActionId + eLenLength) -#endif eLenMaxHeaderData = 3, ///< Maximum data byte can be in one frame as header data portion eLenMaxData = 255, ///< Maximum data length in a Can Message since data length value kept in one byte @@ -90,8 +95,8 @@ eChlid_DG_HD = 0x010, ///< DG => HD // UI is listening - eChlid_HD = 0x020, ///< HD => UI - eChlid_UI = 0x100, ///< UI => HD [Out] + eChlid_HD_UI = 0x020, ///< HD => UI + eChlid_UI_HD = 0x100, ///< UI => HD [Out] // UI lessens occasionally eChlid_DG_UI = eChlid_DG_Alarm, ///< No direct channel has been defined between DG&UI, May be required for logging @@ -104,7 +109,7 @@ */ struct Message { // TODO : Should be converted to MessageModel class // no time left for now !!! Can_Id can_id; - qint16 sequence = 0; // seq 0 is invalid + Sequence sequence = 0; // seq 0 is invalid Gui::GuiActionType actionId = Gui::GuiActionType::Unknown; int length = 0; QByteArray head;