Index: firmware/App/Modes/ModeInitPOST.c =================================================================== diff -u -r736cc5b56cc9c784ab1d8fc8687a73d190c35759 -redd44135869db32d23a0c809f6107b153c34d3bd --- firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision 736cc5b56cc9c784ab1d8fc8687a73d190c35759) +++ firmware/App/Modes/ModeInitPOST.c (.../ModeInitPOST.c) (revision edd44135869db32d23a0c809f6107b153c34d3bd) @@ -45,10 +45,10 @@ #include "Valves.h" #include "WatchdogMgmt.h" - /** - * @addtogroup HDInitAndPOSTMode - * @{ - */ +/** + * @addtogroup HDInitAndPOSTMode + * @{ + */ // ********** private definitions ********** @@ -77,6 +77,7 @@ static UI_VERSIONS_T uiVersion = { 0, 0, 0, 0, 0 }; ///< Version and compatibility information reported by UI. static DG_VERSIONS_T dgVersion = { 0, 0, 0, 0, 0, 0, 0, 0, 0 }; ///< Version and compatibility information reported by DG. static U32 startPOSTDelayCounter = 0; ///< Start POST delay counter. +static BOOL hasSNAndInstBeenSent; ///< Boolean flag to check whether serial number and institutional record been sent. extern U32 savedResetReasonCode; ///< Saved reset reason code from sys_startup.c. @@ -87,6 +88,8 @@ static SELF_TEST_STATUS_T execFWCompatibilityTest( void ); static SELF_TEST_STATUS_T execUITest( void ); +static void sendSerialNumberAndInstitutionalToUI( void ); + /*********************************************************************//** * @brief * The initInitAndPOSTMode function initializes the Initialize & POST Mode module. @@ -107,6 +110,7 @@ waitForUIPostTimerCtr = 0; postCompleteDelayTimerCtr = 0; startPOSTDelayCounter = 0; + hasSNAndInstBeenSent = FALSE; } /*********************************************************************//** @@ -157,6 +161,8 @@ // Ignore stop button in this mode. } + sendSerialNumberAndInstitutionalToUI(); + // Execute current POST state *Note - these switch cases must be in same order as enum HD_POST_States switch ( postState ) { @@ -609,4 +615,29 @@ return result; } +/*********************************************************************//** + * @brief + * The sendSerialNumberAndInstitutionalToUI function sends the serial number + * and institutional records to the UI unsolicited. + * @details Inputs: SNAndInstConfigSendStartTimeMS, postState + * @details Outputs: SNAndInstConfigSendStartTimeMS + * @return none + *************************************************************************/ +static void sendSerialNumberAndInstitutionalToUI( void ) +{ + if ( ( FALSE == hasSNAndInstBeenSent ) && ( postState > POST_STATE_NVDATAMGMT ) ) + { + MESSAGE_T message; + + // Create a message object with the payload length to be 0 for the institutional message + message.hdr.msgID = 0; + message.hdr.payloadLen = 0; + + handleHDSerialNumberRequest(); + handleSendInstitutionalRecordToUI( &message ); + + hasSNAndInstBeenSent = TRUE; + } +} + /**@}*/