@@ -479,14 +479,11 @@ int32 CFE_EVS_SetFilterCmd(const CFE_EVS_SetFilterCmd_t *data)
479
479
int32 CFE_EVS_EnablePortsCmd (const CFE_EVS_EnablePortsCmd_t * data )
480
480
{
481
481
const CFE_EVS_BitMaskCmd_Payload_t * CmdPtr = & data -> Payload ;
482
- int32 ReturnCode ;
482
+ int32 ReturnCode = CFE_SUCCESS ;
483
483
484
484
/* Need to check for an out of range bitmask, since oue bit masks are only 4 bits */
485
- if (CmdPtr -> BitMask == 0x0 || CmdPtr -> BitMask > 0x0F )
485
+ if (EVS_IsInvalidBitMask ( CmdPtr -> BitMask , CFE_EVS_ENABLE_PORTS_CC ) )
486
486
{
487
- EVS_SendEvent (CFE_EVS_ERR_INVALID_BITMASK_EID , CFE_EVS_EventType_ERROR ,
488
- "Bit Mask = 0x%08x out of range: CC = %lu" , (unsigned int )CmdPtr -> BitMask ,
489
- (long unsigned int )CFE_EVS_ENABLE_PORTS_CC );
490
487
ReturnCode = CFE_EVS_INVALID_PARAMETER ;
491
488
}
492
489
else
@@ -496,7 +493,6 @@ int32 CFE_EVS_EnablePortsCmd(const CFE_EVS_EnablePortsCmd_t *data)
496
493
497
494
EVS_SendEvent (CFE_EVS_ENAPORT_EID , CFE_EVS_EventType_DEBUG ,
498
495
"Enable Ports Command Received with Port Bit Mask = 0x%02x" , (unsigned int )CmdPtr -> BitMask );
499
- ReturnCode = CFE_SUCCESS ;
500
496
}
501
497
502
498
return ReturnCode ;
@@ -511,14 +507,11 @@ int32 CFE_EVS_EnablePortsCmd(const CFE_EVS_EnablePortsCmd_t *data)
511
507
int32 CFE_EVS_DisablePortsCmd (const CFE_EVS_DisablePortsCmd_t * data )
512
508
{
513
509
const CFE_EVS_BitMaskCmd_Payload_t * CmdPtr = & data -> Payload ;
514
- int32 ReturnCode ;
510
+ int32 ReturnCode = CFE_SUCCESS ;
515
511
516
512
/* Need to check for an out of range bitmask, since oue bit masks are only 4 bits */
517
- if (CmdPtr -> BitMask == 0x0 || CmdPtr -> BitMask > 0x0F )
513
+ if (EVS_IsInvalidBitMask ( CmdPtr -> BitMask , CFE_EVS_DISABLE_PORTS_CC ) )
518
514
{
519
- EVS_SendEvent (CFE_EVS_ERR_INVALID_BITMASK_EID , CFE_EVS_EventType_ERROR ,
520
- "Bit Mask = 0x%08x out of range: CC = %lu" , (unsigned int )CmdPtr -> BitMask ,
521
- (long unsigned int )CFE_EVS_DISABLE_PORTS_CC );
522
515
ReturnCode = CFE_EVS_INVALID_PARAMETER ;
523
516
}
524
517
else
@@ -528,8 +521,6 @@ int32 CFE_EVS_DisablePortsCmd(const CFE_EVS_DisablePortsCmd_t *data)
528
521
529
522
EVS_SendEvent (CFE_EVS_DISPORT_EID , CFE_EVS_EventType_DEBUG ,
530
523
"Disable Ports Command Received with Port Bit Mask = 0x%02x" , (unsigned int )CmdPtr -> BitMask );
531
-
532
- ReturnCode = CFE_SUCCESS ;
533
524
}
534
525
535
526
return ReturnCode ;
@@ -545,15 +536,12 @@ int32 CFE_EVS_EnableEventTypeCmd(const CFE_EVS_EnableEventTypeCmd_t *data)
545
536
{
546
537
uint32 i ;
547
538
const CFE_EVS_BitMaskCmd_Payload_t * CmdPtr = & data -> Payload ;
548
- int32 ReturnCode ;
539
+ int32 ReturnCode = CFE_SUCCESS ;
549
540
EVS_AppData_t * AppDataPtr ;
550
541
551
542
/* Need to check for an out of range bitmask, since our bit masks are only 4 bits */
552
- if (CmdPtr -> BitMask == 0x0 || CmdPtr -> BitMask > 0x0F )
543
+ if (EVS_IsInvalidBitMask ( CmdPtr -> BitMask , CFE_EVS_ENABLE_EVENT_TYPE_CC ) )
553
544
{
554
- EVS_SendEvent (CFE_EVS_ERR_INVALID_BITMASK_EID , CFE_EVS_EventType_ERROR ,
555
- "Bit Mask = 0x%08x out of range: CC = %lu" , (unsigned int )CmdPtr -> BitMask ,
556
- (long unsigned int )CFE_EVS_ENABLE_EVENT_TYPE_CC );
557
545
ReturnCode = CFE_EVS_INVALID_PARAMETER ;
558
546
}
559
547
else
@@ -572,8 +560,6 @@ int32 CFE_EVS_EnableEventTypeCmd(const CFE_EVS_EnableEventTypeCmd_t *data)
572
560
EVS_SendEvent (CFE_EVS_ENAEVTTYPE_EID , CFE_EVS_EventType_DEBUG ,
573
561
"Enable Event Type Command Received with Event Type Bit Mask = 0x%02x" ,
574
562
(unsigned int )CmdPtr -> BitMask );
575
-
576
- ReturnCode = CFE_SUCCESS ;
577
563
}
578
564
579
565
return ReturnCode ;
@@ -590,17 +576,13 @@ int32 CFE_EVS_DisableEventTypeCmd(const CFE_EVS_DisableEventTypeCmd_t *data)
590
576
uint32 i ;
591
577
const CFE_EVS_BitMaskCmd_Payload_t * CmdPtr = & data -> Payload ;
592
578
int32 ReturnCode ;
593
- EVS_AppData_t * AppDataPtr ;
579
+ EVS_AppData_t * AppDataPtr = CFE_SUCCESS ;
594
580
595
581
/* Need to check for an out of range bitmask, since our bit masks are only 4 bits */
596
- if (CmdPtr -> BitMask == 0x0 || CmdPtr -> BitMask > 0x0F )
582
+ if (EVS_IsInvalidBitMask ( CmdPtr -> BitMask , CFE_EVS_DISABLE_EVENT_TYPE_CC ) )
597
583
{
598
- EVS_SendEvent (CFE_EVS_ERR_INVALID_BITMASK_EID , CFE_EVS_EventType_ERROR ,
599
- "Bit Mask = 0x%08x out of range: CC = %lu" , (unsigned int )CmdPtr -> BitMask ,
600
- (long unsigned int )CFE_EVS_DISABLE_EVENT_TYPE_CC );
601
584
ReturnCode = CFE_EVS_INVALID_PARAMETER ;
602
585
}
603
-
604
586
else
605
587
{
606
588
AppDataPtr = CFE_EVS_Global .AppData ;
@@ -617,8 +599,6 @@ int32 CFE_EVS_DisableEventTypeCmd(const CFE_EVS_DisableEventTypeCmd_t *data)
617
599
EVS_SendEvent (CFE_EVS_DISEVTTYPE_EID , CFE_EVS_EventType_DEBUG ,
618
600
"Disable Event Type Command Received with Event Type Bit Mask = 0x%02x" ,
619
601
(unsigned int )CmdPtr -> BitMask );
620
-
621
- ReturnCode = CFE_SUCCESS ;
622
602
}
623
603
624
604
return ReturnCode ;
@@ -676,11 +656,8 @@ int32 CFE_EVS_EnableAppEventTypeCmd(const CFE_EVS_EnableAppEventTypeCmd_t *data)
676
656
if (Status == CFE_SUCCESS )
677
657
{
678
658
/* Need to check for an out of range bitmask, since our bit masks are only 4 bits */
679
- if (CmdPtr -> BitMask == 0x0 || CmdPtr -> BitMask > 0x0F )
659
+ if (EVS_IsInvalidBitMask ( CmdPtr -> BitMask , CFE_EVS_ENABLE_APP_EVENT_TYPE_CC ) )
680
660
{
681
- EVS_SendEvent (CFE_EVS_ERR_INVALID_BITMASK_EID , CFE_EVS_EventType_ERROR ,
682
- "Bit Mask = 0x%08x out of range: CC = %lu" , (unsigned int )CmdPtr -> BitMask ,
683
- (long unsigned int )CFE_EVS_ENABLE_APP_EVENT_TYPE_CC );
684
661
Status = CFE_EVS_INVALID_PARAMETER ;
685
662
}
686
663
else
@@ -738,11 +715,8 @@ int32 CFE_EVS_DisableAppEventTypeCmd(const CFE_EVS_DisableAppEventTypeCmd_t *dat
738
715
if (Status == CFE_SUCCESS )
739
716
{
740
717
/* Need to check for an out of range bitmask, since our bit masks are only 4 bits */
741
- if (CmdPtr -> BitMask == 0x0 || CmdPtr -> BitMask > 0x0F )
718
+ if (EVS_IsInvalidBitMask ( CmdPtr -> BitMask , CFE_EVS_DISABLE_APP_EVENT_TYPE_CC ) )
742
719
{
743
- EVS_SendEvent (CFE_EVS_ERR_INVALID_BITMASK_EID , CFE_EVS_EventType_ERROR ,
744
- "Bit Mask = 0x%08x out of range: CC = %lu" , (unsigned int )CmdPtr -> BitMask ,
745
- (long unsigned int )CFE_EVS_DISABLE_APP_EVENT_TYPE_CC );
746
720
Status = CFE_EVS_INVALID_PARAMETER ;
747
721
}
748
722
else
0 commit comments