Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r6408d79e3a9a543e90b2fa7ab823be348befd391 -r9ff57b5ab7490ee5bbc2c51b25f738ee6c569ec1 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 6408d79e3a9a543e90b2fa7ab823be348befd391) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 9ff57b5ab7490ee5bbc2c51b25f738ee6c569ec1) @@ -24,6 +24,7 @@ #include "ConcentratePumps.h" #include "DialysatePumps.h" #include "Heaters.h" +#include "FpgaDD.h" #include "Level.h" #include "Messaging.h" #include "MessagePayloads.h" @@ -228,7 +229,7 @@ &testHeaterPWMPeriodOverride, &testDDPreGenDialysateDataPublishIntervalOverride, &testDDPostGenDialysateDataPublishIntervalOverride, - &testDDStartPreGenDialysateOverride, //65 + &testDDStartPreGenDialysateOverride, //65 &handlePreGenDialysateRequestMsg, &testDDStopPreGenDialysateOverride, &testDDStopGenDialysateOverride, @@ -249,6 +250,9 @@ /// List of message IDs that are requested not to be transmitted. //static BLOCKED_MSGS_DATA_T blockedMessagesForXmit = { 0, 0, 0, 0, 0, 0, 0, 0 }; +/// UI version information +static UI_VERSIONS_T uiVersionRecord = { 0, 0, 0, 0, 0 }; + // ********** private function prototypes ********** static BOOL sendTestAckResponseMsg( MSG_ID_T msgID, BOOL ack ); @@ -642,7 +646,43 @@ return status; } +/*********************************************************************//** + * @brief + * The handleVersionRequestMessage function handles a UI request for DD + * version information. + * @details \b Message \b Sent: MSG_ID_DD_VERSION_REPONSE + * @details \b Inputs: none + * @details \b Outputs: UI version info. + * @param message Pointer to the UI version request message which contains + * the UI version information as well. + * @return TRUE if request handled successfully, FALSE if not + *************************************************************************/ +BOOL handleVersionRequestMessage( MESSAGE_T *message ) +{ + BOOL result = FALSE; + if ( message->hdr.payloadLen == sizeof( UI_VERSIONS_T ) ) + { + DD_VERSIONS_T ddVersionRecord; + + // Record UI version information + memcpy( (U08*)(&uiVersionRecord), &message->payload, sizeof( UI_VERSIONS_T ) ); + + // Build TD version record + ddVersionRecord.major = DD_VERSION_MAJOR; + ddVersionRecord.minor = DD_VERSION_MINOR; + ddVersionRecord.micro = DD_VERSION_MICRO; + ddVersionRecord.build = DD_VERSION_BUILD; + getFPGAVersions( &ddVersionRecord.fpgaId, &ddVersionRecord.fpgaMajor, &ddVersionRecord.fpgaMinor, &ddVersionRecord.fpgaLab ); + ddVersionRecord.compatibilityRev = SW_COMPATIBILITY_REV; + + // Send TD version information + result = sendMessage( MSG_ID_DD_VERSION_REPONSE, COMM_BUFFER_OUT_CAN_DD_BROADCAST, (U08*)&ddVersionRecord, sizeof( DD_VERSIONS_T ) ); + } + + return result; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/