@@ -172,20 +172,18 @@ void HS_MonitorApplications(void)
172
172
break ;
173
173
174
174
/*
175
- ** Also the case for Message Action types
175
+ ** Message Action types processing (invalid will be skipped)
176
176
*/
177
- case HS_AMT_ACT_NOACT :
178
177
default :
178
+
179
+ /* Calculate the requested message action index */
180
+ MsgActsIndex = ActionType - HS_AMT_ACT_LAST_NONMSG - 1 ;
181
+
179
182
/*
180
- ** Check to see if this is a Message Action Type
183
+ ** Check to see if this is a valid Message Action Type
181
184
*/
182
- if ((HS_AppData .MsgActsState == HS_STATE_ENABLED ) &&
183
- (ActionType > HS_AMT_ACT_LAST_NONMSG ) &&
184
- (ActionType <= (HS_AMT_ACT_LAST_NONMSG + HS_MAX_MSG_ACT_TYPES )))
185
+ if ((HS_AppData .MsgActsState == HS_STATE_ENABLED ) && (MsgActsIndex < HS_MAX_MSG_ACT_TYPES ))
185
186
{
186
- /* Calculate index in Message Action Table */
187
- MsgActsIndex = ActionType - HS_AMT_ACT_LAST_NONMSG - 1 ;
188
-
189
187
/*
190
188
** Send the message if off cooldown and not disabled
191
189
*/
@@ -332,17 +330,18 @@ void HS_MonitorEvent(const CFE_EVS_LongEventTlm_t *EventPtr)
332
330
break ;
333
331
334
332
/*
335
- ** Also the case for Message Action types
333
+ ** Message Action types processing (invalid will be skipped)
336
334
*/
337
- case HS_EMT_ACT_NOACT :
338
335
default :
336
+
337
+ /* Calculate the requested message action index */
338
+ MsgActsIndex = ActionType - HS_AMT_ACT_LAST_NONMSG - 1 ;
339
+
339
340
/*
340
- ** Check to see if this is a Message Action Type
341
+ ** Check to see if this is a valid Message Action Type
341
342
*/
342
- if ((HS_AppData .MsgActsState == HS_STATE_ENABLED ) && (ActionType > HS_EMT_ACT_LAST_NONMSG ) &&
343
- (ActionType <= (HS_EMT_ACT_LAST_NONMSG + HS_MAX_MSG_ACT_TYPES )))
343
+ if ((HS_AppData .MsgActsState == HS_STATE_ENABLED ) && (MsgActsIndex < HS_MAX_MSG_ACT_TYPES ))
344
344
{
345
- MsgActsIndex = ActionType - HS_EMT_ACT_LAST_NONMSG - 1 ;
346
345
347
346
/*
348
347
** Send the message if off cooldown and not disabled
0 commit comments