Index: firmware/App/Services/AlarmMgmtFP.c =================================================================== diff -u -rf79d3737907fd08293d56f60f9f439ac68c81855 -r6dd382e3988fac2f9ee041b4738d67305e17a6a2 --- firmware/App/Services/AlarmMgmtFP.c (.../AlarmMgmtFP.c) (revision f79d3737907fd08293d56f60f9f439ac68c81855) +++ firmware/App/Services/AlarmMgmtFP.c (.../AlarmMgmtFP.c) (revision 6dd382e3988fac2f9ee041b4738d67305e17a6a2) @@ -386,39 +386,47 @@ * @brief * The testClearAllAlarms function clears all active alarms, even if they * are non-recoverable or faults. The caller of this function must provide - * the correct 32-bit key. A Dialin user must also be logged into DD. + * the correct 32-bit key. A Dialin user must also be logged into TD. + * @details \b Message \b Sent: MSG_ID_ALARM_CLEARED for each active alarm. * @details \b Inputs: none * @details \b Outputs: alarmIsActive[], alarmStartedAt[] - * @details \b Message \b Sent: MSG_ID_ALARM_CLEARED to clear all alarms. - * @param key 32-bit supervisor alarm key required to perform this function - * @return TRUE if override reset successful, FALSE if not + * @param message Pointer to a clear all alarms message which contains a + * 32-bit supervisor alarm key required to perform this function + * @return TRUE if command was successful, FALSE if rejected *************************************************************************/ -BOOL testClearAllAlarms( U32 key ) +BOOL testClearAllAlarms( MESSAGE_T *message ) { BOOL result = FALSE; + U32 key; - // Verify key - if ( SUPERVISOR_ALARM_KEY == key ) + // Verify tester has logged in with TD + if ( TRUE == isTestingActivated() ) { - // Verify tester has logged in with HD - if ( TRUE == isTestingActivated() ) + // Verify payload length + if ( sizeof(U32) == message->hdr.payloadLen ) { - ALARM_ID_T a; + memcpy( &key, message->payload, sizeof(U32) ); - // Clear all active alarms - for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) + // Verify key + if ( SUPERVISOR_ALARM_KEY == key ) { - if ( TRUE == isAlarmActive( a ) ) + ALARM_ID_T a; + + // Clear all active alarms + for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) { - ALARM_NAME_DATA_T data; + if ( TRUE == isAlarmActive( a ) ) + { + ALARM_NAME_DATA_T data; - data.alarmName = (U32)a; + data.alarmName = (U32)a; - broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_FP_ALARM, (U08*)&data, sizeof( ALARM_NAME_DATA_T ) ); - setAlarmActive( a, FALSE ); + broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_FP_ALARM, (U08*)&data, sizeof( ALARM_NAME_DATA_T ) ); + setAlarmActive( a, FALSE ); + } } + result = TRUE; } - result = TRUE; } }