Index: sources/canbus/messageglobals.h =================================================================== diff -u -r227f28b202f81ab3dd04a81868697025ccab6220 -re58b907a69d4ca7daa77d69791593b886d1b80e8 --- sources/canbus/messageglobals.h (.../messageglobals.h) (revision 227f28b202f81ab3dd04a81868697025ccab6220) +++ sources/canbus/messageglobals.h (.../messageglobals.h) (revision e58b907a69d4ca7daa77d69791593b886d1b80e8) @@ -29,9 +29,10 @@ const QHash payloadLen { {Gui::GuiActionType::PowerOff , 1 }, {Gui::GuiActionType::KeepAlive , 0 }, - {Gui::GuiActionType::BloodFlow , 7 * 4 } , // 7 parameters each 4bytes - {Gui::GuiActionType::DialysateFlow , 7 * 4 } , // 7 parameters each 4bytes + {Gui::GuiActionType::BloodFlow , 7 * 4 }, // 7 parameters each 4bytes + {Gui::GuiActionType::DialysateFlow , 7 * 4 }, // 7 parameters each 4bytes {Gui::GuiActionType::String , 255 }, + {Gui::GuiActionType::Acknow , 0 }, }; /*! @@ -49,12 +50,17 @@ */ 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 eLenSyncByte = 1, ///< The length of Sync byte at the beginning of each header frame - eLenActionId = 2, ///< The length of MessageID bytes (2) at the beginning of each header frame after sync + eLenSequence = 2, ///< The length of Sequence number bytes (2) at the beginning of each header frame after sync + eLenActionId = 2, ///< The length of MessageID bytes eLenLength = 1, ///< The length of data length value byte at the beginning of each header frame after MessageID eLenCRCDigits = 2, @@ -98,6 +104,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 Gui::GuiActionType actionId = Gui::GuiActionType::Unknown; int length = 0; QByteArray head;