Index: firmware/App/Services/NVMsgQ.c =================================================================== diff -u -r0face6417892ea9de28d146bf88d44a9f30cf2a4 -r63c3a65e681810f037718377c6ed5a28c897d0ca --- firmware/App/Services/NVMsgQ.c (.../NVMsgQ.c) (revision 0face6417892ea9de28d146bf88d44a9f30cf2a4) +++ firmware/App/Services/NVMsgQ.c (.../NVMsgQ.c) (revision 63c3a65e681810f037718377c6ed5a28c897d0ca) @@ -99,10 +99,8 @@ static U08 recordQueueFrontIndex; ///< Record queue front index. static U08 recordQueueCount; ///< Record queue count. static PROCESS_RECORD_JOB_T recordCurrentJob; ///< Record queue current job. - static NVDATAMGMT_RECORDS_READ_STATUS_T recordsReadStatus; ///< NVDataMgmt records read status. static BOOL isNewNVRecordAvailable; ///< Signal to indicate whether a new NVM data is available. - static RECORD_JOBS_STATE_T recordToPublish; ///< Record to publish (i.e. calibration, system) static RECORD_JOBS_STATE_T nvPublishRecordType; static SEND_RECORD_STATE_T nvMExecSendRecordState; ///< NVDataMgmt exec process record state. @@ -117,8 +115,6 @@ static U32 recordReceiveStartTime; ///< Time stamp the calibration/service was received. static U32 newRecordStartTimer; ///< New record availability start timer. - - // ********** private function prototypes ********** // Process record functions @@ -491,83 +487,8 @@ return recordsReadStatus; } -BOOL testDDGetNVRecord( MESSAGE_T *message ) -{ - BOOL result = FALSE; - RECORD_JOBS_STATE_T job; - // verify payload length - if ( 1 == message->hdr.payloadLen ) - { - job = ( RECORD_JOBS_STATE_T )message->payload[ 0 ]; -// job = getNVMRecordJobState( msgID ); - if ( ( job < NUM_OF_NVDATMGMT_RECORDS_JOBS ) && - ( NVM_SEND_RECORD_STATE_IDLE == nvMExecSendRecordState ) ) - { - isPublishRecordRequested[ job ] = TRUE; - recordToPublish = job; - result = TRUE; - } - - } - - return result; -} - -BOOL testDDSetNVSystemRecord( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - // System record can be updated only in service mode - if ( DD_MODE_SERV == getCurrentOperationMode() ) - { - result = receiveDDRecord ( message ); - } - - return result; -} - -BOOL testDDSetNVServiceRecord( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - // Service record can be updated only in service mode - if ( DD_MODE_SERV == getCurrentOperationMode() ) - { - result = receiveDDRecord ( message ); - } - - return result; -} - -BOOL testDDSetNVCalibrationRecord( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - // Calibration record can be updated only in service mode - if ( DD_MODE_SERV == getCurrentOperationMode() ) - { - result = receiveDDRecord ( message ); - } - - return result; -} - -BOOL testDDSetNVInstitutionalRecord( MESSAGE_T *message ) -{ - BOOL result = FALSE; - result = receiveDDRecord ( message ); - return result; -} - -BOOL testDDSetNVUsageInfoRecord( MESSAGE_T *message ) -{ - BOOL result = FALSE; - result = receiveDDRecord ( message ); - return result; -} - /*********************************************************************//** * @brief * The sendDDCalibrationRecord function sends out the DD calibration @@ -843,4 +764,88 @@ return recordCurrentJob; } + + +/************************************************************************* + * TEST SUPPORT FUNCTIONS + *************************************************************************/ + + +BOOL testDDGetNVRecord( MESSAGE_T *message ) +{ + BOOL result = FALSE; + RECORD_JOBS_STATE_T job; + + // verify payload length + if ( 1 == message->hdr.payloadLen ) + { + job = ( RECORD_JOBS_STATE_T )message->payload[ 0 ]; +// job = getNVMRecordJobState( msgID ); + + if ( ( job < NUM_OF_NVDATMGMT_RECORDS_JOBS ) && + ( NVM_SEND_RECORD_STATE_IDLE == nvMExecSendRecordState ) ) + { + isPublishRecordRequested[ job ] = TRUE; + recordToPublish = job; + result = TRUE; + } + + } + + return result; +} + +BOOL testDDSetNVSystemRecord( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // System record can be updated only in service mode + if ( DD_MODE_SERV == getCurrentOperationMode() ) + { + result = receiveDDRecord ( message ); + } + + return result; +} + +BOOL testDDSetNVServiceRecord( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // Service record can be updated only in service mode + if ( DD_MODE_SERV == getCurrentOperationMode() ) + { + result = receiveDDRecord ( message ); + } + + return result; +} + +BOOL testDDSetNVCalibrationRecord( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // Calibration record can be updated only in service mode + if ( DD_MODE_SERV == getCurrentOperationMode() ) + { + result = receiveDDRecord ( message ); + } + + return result; +} + +BOOL testDDSetNVInstitutionalRecord( MESSAGE_T *message ) +{ + BOOL result = FALSE; + result = receiveDDRecord ( message ); + return result; +} + +BOOL testDDSetNVUsageInfoRecord( MESSAGE_T *message ) +{ + BOOL result = FALSE; + result = receiveDDRecord ( message ); + return result; +} + /**@}*/