Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rfc12876da6930c955864352182aee2076513a1cc -r2b2d7945bca8305ecd7f9577ad7d8457089282f2 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision fc12876da6930c955864352182aee2076513a1cc) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2b2d7945bca8305ecd7f9577ad7d8457089282f2) @@ -265,10 +265,34 @@ msg.payload[ 0 ] = cmd; // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer - result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); return result; -} +} + +/*********************************************************************//** + * @brief + * The sendUIVersionRequest function constructs a UI version request msg + * to the UI and queues the msg for transmit on the appropriate CAN channel. + * @details Inputs: none + * @details Outputs: UI version request msg constructed and queued. + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendUIVersionRequest( void ) +{ + BOOL result; + MESSAGE_T msg; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_UI_VERSION_INFO_REQUEST; + msg.hdr.payloadLen = 0; + + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); + + return result; +} /*********************************************************************//** * @brief @@ -3467,15 +3491,9 @@ U08 *payloadPtr = msg.payload; // Get UI version data from this request msg and have it recorded - if ( sizeof(UI_VERSIONS_T) == message->hdr.payloadLen ) - { - UI_VERSIONS_T uiVersion; + handleUIVersionResponse( message ); - memcpy( &uiVersion, &message->payload[0], sizeof(UI_VERSIONS_T) ); - signalUIVersion( uiVersion ); - } - - // Populate payload + // Populate payload for response payload.major = (U08)HD_VERSION_MAJOR; payload.minor = (U08)HD_VERSION_MINOR; payload.micro = (U08)HD_VERSION_MICRO; @@ -3497,6 +3515,27 @@ /*********************************************************************//** * @brief + * The handleUIVersionResponse function handles a response to request for + * UI version information. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle. + * @return none + *************************************************************************/ +void handleUIVersionResponse( MESSAGE_T *message ) +{ + // Get UI version data and have it recorded + if ( sizeof(UI_VERSIONS_T) == message->hdr.payloadLen ) + { + UI_VERSIONS_T uiVersion; + + memcpy( &uiVersion, &message->payload[0], sizeof(UI_VERSIONS_T) ); + signalUIVersion( uiVersion ); + } +} + +/*********************************************************************//** + * @brief * The handleDGVersionResponse function handles a response for DG f/w version. * @details Inputs: none * @details Outputs: message handled, DG version info recorded.