Index: firmware/App/Services/AlarmMgmtTD.c =================================================================== diff -u -r2d40deb50ffb27667c3e57f427b1e197e163910e -r4997ea1db180eb5a0e0ad2ceecb453cdec135a12 --- firmware/App/Services/AlarmMgmtTD.c (.../AlarmMgmtTD.c) (revision 2d40deb50ffb27667c3e57f427b1e197e163910e) +++ firmware/App/Services/AlarmMgmtTD.c (.../AlarmMgmtTD.c) (revision 4997ea1db180eb5a0e0ad2ceecb453cdec135a12) @@ -683,6 +683,102 @@ /*********************************************************************//** * @brief + * The handleAlarmTriggered function handles the triggered alarm from the other + * stacks. + * @details \b Inputs: none + * @details \b Outputs: none + * @param message Pointer to the triggered alarm message + * @return TRUE if message handled successfully, FALSE if not + *************************************************************************/ +BOOL handleAlarmTriggered( MESSAGE_T *message ) +{ + BOOL status = FALSE; + + if ( message->hdr.payloadLen == sizeof( ALARM_TRIGGERED_PAYLOAD_T ) ) + { + ALARM_TRIGGERED_PAYLOAD_T payload; + U08 *payloadPtr = message->payload; + + memcpy( &payload, payloadPtr, sizeof( ALARM_TRIGGERED_PAYLOAD_T ) ); + + if ( (ALARM_ID_T)(payload.alarm) < NUM_OF_ALARM_IDS ) + { + ALARM_DATA_T alm1, alm2; + + status = TRUE; + alm1.dataType = (ALARM_DATA_TYPES_T)(payload.almDataType1); + alm1.data.uInt.data = payload.almData1; + alm2.dataType = (ALARM_DATA_TYPES_T)(payload.almDataType2); + alm2.data.uInt.data = payload.almData2; + activateAlarm2Data( (ALARM_ID_T)(payload.alarm), alm1, alm2, TRUE ); + } + } + + return status; +} + +/*********************************************************************//** + * @brief + * The handleAlarmConditionCleared function handles the cleared alarm from + * the other stacks. + * @details \b Inputs: none + * @details \b Outputs: none + * @param message Pointer to the cleared alarm message + * @return TRUE if message handled successfully, FALSE if not + *************************************************************************/ +BOOL handleAlarmConditionCleared( MESSAGE_T *message ) +{ + BOOL status = FALSE; + + if ( message->hdr.payloadLen == sizeof( U32 ) ) + { + U08 *payloadPtr = message->payload; + U32 alarmID; + + memcpy( &alarmID, payloadPtr, sizeof( U32 ) ); + + if ( (ALARM_ID_T)alarmID < NUM_OF_ALARM_IDS ) + { + clearAlarmCondition( (ALARM_ID_T)alarmID ); + status = TRUE; + } + } + + return status; +} + +/*********************************************************************//** + * @brief + * The handleAlarmUserAction function handles the alarm user action that is + * received from the UI. + * @details \b Inputs: none + * @details \b Outputs: none + * @param message Pointer to the user action request message + * @return TRUE if message handled successfully, FALSE if not + *************************************************************************/ +BOOL handleAlarmUserAction( MESSAGE_T *message ) +{ + BOOL status = FALSE; + + if ( message->hdr.payloadLen == sizeof( U32 ) ) + { + U08 *payloadPtr = message->payload; + U32 action; + + memcpy( &action, payloadPtr, sizeof( U32 ) ); + + if ( (ALARM_USER_ACTION_T)action < NUMBER_OF_ALARM_USER_ACTIONS ) + { + signalAlarmUserActionInitiated( (ALARM_USER_ACTION_T)action ); + status = TRUE; + } + } + + return status; +} + +/*********************************************************************//** + * @brief * The handleActiveAlarmListRequest function handles the active alarms list * request from UI. * @note Active alarm list is sorted by rank and is limited to maximum 10 alarm @@ -772,6 +868,27 @@ } } } + +/*********************************************************************//** + * @brief + * The handleAutoResumeAlarm function handles the auto resume status of an alarm. + * @details \b Inputs: alarmStatus + * @details \b Outputs: none + * @param alarmID ID of alarm to be handled. + * @return none + *************************************************************************/ +void handleAutoResumeAlarm( ALARM_ID_T alarm ) +{ + ALARM_T props = getAlarmProperties( alarm ); + + if ( TRUE == props.alarmAutoResume ) + { + if ( ( alarm == alarmStatus.alarmTop ) && ( FALSE == alarmStatus.noResume ) ) + { + signalAlarmUserActionInitiated( ALARM_USER_ACTION_RESUME ); + } + } +} /*********************************************************************//** * @brief