Index: firmware/App/Services/Messaging.c =================================================================== diff -u -rf4870116c87345ee0ea062df5b30187e1e113ddc -r8940f67c485a23e20e14e4dc24e79339f80cc584 --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision f4870116c87345ee0ea062df5b30187e1e113ddc) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision 8940f67c485a23e20e14e4dc24e79339f80cc584) @@ -108,6 +108,8 @@ { MSG_ID_FP_BOOST_PUMP_TARGET_PWM_OVERRIDE_REQUEST, &testBoostPumpTargetDutyCycleOverride }, { MSG_ID_FP_BOOST_PUMP_STOP_REQUEST, &testBoostPumpHardStop }, { MSG_ID_FP_RO_PUMP_STOP_REQUEST, &testROPumpHardStop }, +{ MSG_ID_FW_VERSIONS_REQUEST, &handleVersionRequestMessage }, + }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLER_LOOKUP) / sizeof(MSG_HANDLER_LOOKUP_T)) @@ -119,6 +121,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 MsgFuncPtr getMsgHandler( U16 msgID ); @@ -531,38 +536,39 @@ * @brief * The handleVersionRequestMessage function handles a UI request for FP * version information. - * @details \b Message \b Sent: MSG_ID_FP_VERSION_REPONSE + * @details \b Message \b Sent: MSG_ID_FP_VERSION_RESPONSE * @details \b Inputs: none - * @details \b Outputs: FP version info. + * @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 ) ) -// { -// FP_VERSIONS_T fpVersionRecord; -// -// // Record UI version information -// memcpy( (U08*)(&uiVersionRecord), &message->payload, sizeof( UI_VERSIONS_T ) ); -// -// // Build DD 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 DD version information -// result = sendMessage( MSG_ID_DD_VERSION_RESPONSE, COMM_BUFFER_OUT_CAN_DD_BROADCAST, (U08*)&ddVersionRecord, sizeof( DD_VERSIONS_T ) ); -// } -// -// return result; -//} +BOOL handleVersionRequestMessage( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + if ( message->hdr.payloadLen == sizeof( UI_VERSIONS_T ) ) + { + FP_VERSIONS_T fpVersionRecord; + + // Record UI version information + memcpy( (U08*)(&uiVersionRecord), &message->payload, sizeof( UI_VERSIONS_T ) ); + + // Build FP version record + fpVersionRecord.major = FP_VERSION_MAJOR; + fpVersionRecord.minor = FP_VERSION_MINOR; + fpVersionRecord.micro = FP_VERSION_MICRO; + fpVersionRecord.build = FP_VERSION_BUILD; + getFPGAVersions( &fpVersionRecord.fpgaId, &fpVersionRecord.fpgaMajor, &fpVersionRecord.fpgaMinor, &fpVersionRecord.fpgaLab ); + fpVersionRecord.compatibilityRev = SW_COMPATIBILITY_REV; + + // Send FP version information + result = sendMessage( MSG_ID_FP_VERSION_RESPONSE, COMM_BUFFER_OUT_CAN_FP_BROADCAST, (U08*)&fpVersionRecord, sizeof( FP_VERSIONS_T ) ); + } + + return result; +} + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/