Index: firmware/App/Services/AlarmMgmtTD.c =================================================================== diff -u -rd9b5f588d81e15ed3849222bed3362e15dbf4b0a -rb692af0986725e87431ca5e23c5721f1b242baac --- firmware/App/Services/AlarmMgmtTD.c (.../AlarmMgmtTD.c) (revision d9b5f588d81e15ed3849222bed3362e15dbf4b0a) +++ firmware/App/Services/AlarmMgmtTD.c (.../AlarmMgmtTD.c) (revision b692af0986725e87431ca5e23c5721f1b242baac) @@ -1316,40 +1316,44 @@ BOOL result = FALSE; U32 key; - memcpy( &key, message->payload, sizeof(U32) ); - - // 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 the flags when Dialin clears alarms - resumeBlockedByAlarmProperty = FALSE; - - // 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_T props = getAlarmProperties( a ); - ALARM_ID_DATA_PUBLISH_T data; + ALARM_ID_T a; - data.alarmID = (U32)a; + // clear the flags when Dialin clears alarms + resumeBlockedByAlarmProperty = FALSE; - broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_TD_ALARM, (U08*)&data, sizeof( ALARM_ID_DATA_PUBLISH_T ) ); - setAlarmActive( a , FALSE ); - alarmStartedAt[ a ].data = 0; - // Clear FIFO if this alarm was in it - if ( alarmPriorityFIFO[ props.alarmPriority ].alarmID == a ) + // Clear all active alarms + for ( a = ALARM_ID_NO_ALARM; a < NUM_OF_ALARM_IDS; a++ ) + { + if ( TRUE == isAlarmActive( a ) ) { - resetAlarmPriorityFIFO( props.alarmPriority ); + ALARM_T props = getAlarmProperties( a ); + ALARM_ID_DATA_PUBLISH_T data; + + data.alarmID = (U32)a; + + broadcastData( MSG_ID_ALARM_CLEARED, COMM_BUFFER_OUT_CAN_TD_ALARM, (U08*)&data, sizeof( ALARM_ID_DATA_PUBLISH_T ) ); + setAlarmActive( a , FALSE ); + alarmStartedAt[ a ].data = 0; + // Clear FIFO if this alarm was in it + if ( alarmPriorityFIFO[ props.alarmPriority ].alarmID == a ) + { + resetAlarmPriorityFIFO( props.alarmPriority ); + } } } + result = TRUE; } - result = TRUE; } }