Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r7f2cc554a3c0bd271d0221b29896f5866f56db94 -rcc7f1bd82e346521f0102b3398bd030fb3bb0e6f --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 7f2cc554a3c0bd271d0221b29896f5866f56db94) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision cc7f1bd82e346521f0102b3398bd030fb3bb0e6f) @@ -7,8 +7,8 @@ * * @file SystemCommMessages.c * -* @author (last) Michael Garthwaite -* @date (last) 18-Feb-2022 +* @author (last) Dara Navaei +* @date (last) 03-Mar-2022 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -152,7 +152,9 @@ data[ msgSize++ ] = 0; } +#ifndef _RELEASE_ if ( getSoftwareConfigStatus( SW_CONFIG_DISABLE_ACK_ERRORS ) != SW_CONFIG_ENABLE_VALUE ) +#endif { // If ACK required, add to pending ACK list if ( TRUE == ackReq ) @@ -1803,7 +1805,6 @@ payload.alarmsFlags |= ( almStatus.noResume ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_NO_RESUME) : 0 ); payload.alarmsFlags |= ( almStatus.noRinseback ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_NO_RINSEBACK) : 0 ); payload.alarmsFlags |= ( almStatus.noEndTreatment ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_NO_END_TREATMENT) : 0 ); - payload.alarmsFlags |= ( almStatus.noNewTreatment ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_NO_NEW_TREATMENT) : 0 ); payload.alarmsFlags |= ( almStatus.usrACKRequired ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_USER_MUST_ACK) : 0 ); payload.alarmsFlags |= ( almStatus.alarmsToEscalate ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_ALARMS_TO_ESCALATE) : 0 ); payload.alarmsFlags |= ( almStatus.alarmsSilenced ? BIT_BY_POS(ALARM_STATE_FLAG_BIT_POS_ALARMS_SILENCED) : 0 ); @@ -1980,105 +1981,7 @@ } } -/*********************************************************************//** - * @brief - * The sendHDSWConfigRecord function sends out the HD software configuration record. - * @details Inputs: none - * @details Outputs: HD software configuration record msg constructed and queued - * @param msgCurrNum: current payload number - * @param msgTotalNum: total number of payloads - * @param length: buffer length to be written - * @param swRcrdAddress: start address of the software configuration record - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL sendHDSWConfigRecord( U32 payloadCurrNum, U32 payloadTotalNum, U32 length, U08* swRcrdAddress ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - // Create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_HD_SEND_SW_CONFIG_RECORD; - msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ) + sizeof( U32 ) + length; - - memcpy( payloadPtr, &payloadCurrNum, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); - - memcpy( payloadPtr, &payloadTotalNum, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); - - memcpy( payloadPtr, &length, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); - - memcpy( payloadPtr, swRcrdAddress, length ); - - // 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_PC, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** -* @brief -* The handleGetHDSoftwareConfigRecord function handles a request to get the HD -* software configuration record. -* @details Inputs: none -* @details Outputs: message handled -* @param message a pointer to the message to handle -* @return none -*************************************************************************/ -void handleGetHDSoftwareConfigRecord( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - // verify payload length - if ( 0 == message->hdr.payloadLen ) - { - // Tester must be logged in - if ( TRUE == isTestingActivated() ) - { - result = sendRecordToDialin( NVDATAMGMT_SW_CONFIG_RECORD ); - } - } - - // respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** -* @brief -* The handleSetHDSoftwareConfigRecord function handles a request to set the HD -* software configuration record. -* @details Inputs: none -* @details Outputs: message handled -* @param message a pointer to the message to handle -* @return none -*************************************************************************/ -void handleSetHDSoftwareConfigRecord( MESSAGE_T *message ) -{ - U32 currentMessage; - U32 totalMessages; - U32 payloadLength; - - BOOL status = FALSE; - U08* payloadPtr = message->payload; - - memcpy(¤tMessage, payloadPtr, sizeof(U32)); - payloadPtr += sizeof(U32); - - memcpy(&totalMessages, payloadPtr, sizeof(U32)); - payloadPtr += sizeof(U32); - - memcpy(&payloadLength, payloadPtr, sizeof(U32)); - payloadPtr += sizeof(U32); - - status = receiveRecordFromDialin( NVDATAMGMT_SW_CONFIG_RECORD, currentMessage, totalMessages, payloadLength, payloadPtr ); - - // Respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, status ); -} - #ifdef EMC_TEST_BUILD BOOL broadcastCANErrorCount( U32 count ) { @@ -5929,6 +5832,7 @@ TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; BOOL result = FALSE; +#ifndef _RELEASE_ // Verify payload length if ( sizeof(TEST_OVERRIDE_ARRAY_PAYLOAD_T) == message->hdr.payloadLen ) { @@ -5942,6 +5846,7 @@ result = testResetValvesCurrentOverride( payload.index ); } } +#endif // Respond to request sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); @@ -5994,6 +5899,7 @@ TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; BOOL result = FALSE; +#ifndef _RELEASE_ // Verify payload length if ( sizeof(TEST_OVERRIDE_ARRAY_PAYLOAD_T) == message->hdr.payloadLen ) { @@ -6007,6 +5913,7 @@ result = testResetValvesPositionCountOverride( payload.index ); } } +#endif // Respond to request sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); @@ -6999,4 +6906,106 @@ return serializeMessage(msg, COMM_BUFFER_OUT_CAN_PC, ACK_REQUIRED ); } +/*********************************************************************//** + * @brief + * The sendHDSWConfigRecord function sends out the HD software configuration record. + * @details Inputs: none + * @details Outputs: HD software configuration record msg constructed and queued + * @param msgCurrNum: current payload number + * @param msgTotalNum: total number of payloads + * @param length: buffer length to be written + * @param swRcrdAddress: start address of the software configuration record + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendHDSWConfigRecord( U32 payloadCurrNum, U32 payloadTotalNum, U32 length, U08* swRcrdAddress ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_SEND_SW_CONFIG_RECORD; + msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ) + sizeof( U32 ) + length; + + memcpy( payloadPtr, &payloadCurrNum, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + + memcpy( payloadPtr, &payloadTotalNum, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + + memcpy( payloadPtr, &length, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + + memcpy( payloadPtr, swRcrdAddress, length ); + + // 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_PC, ACK_NOT_REQUIRED ); + + return result; +} + +/*********************************************************************//** +* @brief +* The handleGetHDSoftwareConfigRecord function handles a request to get the HD +* software configuration record. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ +void handleGetHDSoftwareConfigRecord( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + // verify payload length + if ( 0 == message->hdr.payloadLen ) + { + // Tester must be logged in + if ( TRUE == isTestingActivated() ) + { + result = sendRecordToDialin( NVDATAMGMT_SW_CONFIG_RECORD ); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** +* @brief +* The handleSetHDSoftwareConfigRecord function handles a request to set the HD +* software configuration record. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ +void handleSetHDSoftwareConfigRecord( MESSAGE_T *message ) +{ + U32 currentMessage; + U32 totalMessages; + U32 payloadLength; + + BOOL status = FALSE; + U08* payloadPtr = message->payload; + + if ( message->hdr.payloadLen >= ( sizeof(currentMessage) + sizeof(totalMessages) + sizeof(payloadLength) ) ) + { + memcpy(¤tMessage, payloadPtr, sizeof(U32)); + payloadPtr += sizeof(U32); + + memcpy(&totalMessages, payloadPtr, sizeof(U32)); + payloadPtr += sizeof(U32); + + memcpy(&payloadLength, payloadPtr, sizeof(U32)); + payloadPtr += sizeof(U32); + + status = receiveRecordFromDialin( NVDATAMGMT_SW_CONFIG_RECORD, currentMessage, totalMessages, payloadLength, payloadPtr ); + } + + // Respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, status ); +} + /**@}*/