@@ -111,37 +111,38 @@ CFE_Status_t SAMPLE_APP_ResetCountersCmd(const SAMPLE_APP_ResetCountersCmd_t *Ms
111111/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
112112CFE_Status_t SAMPLE_APP_ProcessCmd (const SAMPLE_APP_ProcessCmd_t * Msg )
113113{
114- CFE_Status_t status ;
114+ CFE_Status_t Status ;
115115 void * TblAddr ;
116116 SAMPLE_APP_ExampleTable_t * TblPtr ;
117117 const char * TableName = "SAMPLE_APP.ExampleTable" ;
118118
119119 /* Sample Use of Example Table */
120-
121- status = CFE_TBL_GetAddress (& TblAddr , SAMPLE_APP_Data .TblHandles [0 ]);
122-
123- if (status < CFE_SUCCESS )
120+ SAMPLE_APP_Data .CmdCounter ++ ;
121+ Status = CFE_TBL_GetAddress (& TblAddr , SAMPLE_APP_Data .TblHandles [0 ]);
122+ if (Status < CFE_SUCCESS )
124123 {
125- CFE_ES_WriteToSysLog ("Sample App: Fail to get table address: 0x%08lx" , (unsigned long )status );
126- return status ;
124+ CFE_ES_WriteToSysLog ("Sample App: Fail to get table address: 0x%08lx" , (unsigned long )Status );
127125 }
128-
129- TblPtr = TblAddr ;
130- CFE_ES_WriteToSysLog ("Sample App: Example Table Value 1: %d Value 2: %d" , TblPtr -> Int1 , TblPtr -> Int2 );
131-
132- SAMPLE_APP_GetCrc (TableName );
133-
134- status = CFE_TBL_ReleaseAddress (SAMPLE_APP_Data .TblHandles [0 ]);
135- if (status != CFE_SUCCESS )
126+ else
136127 {
137- CFE_ES_WriteToSysLog ("Sample App: Fail to release table address: 0x%08lx" , (unsigned long )status );
138- return status ;
128+ TblPtr = TblAddr ;
129+ CFE_ES_WriteToSysLog ("Sample App: Example Table Value 1: %d Value 2: %d" , TblPtr -> Int1 , TblPtr -> Int2 );
130+
131+ SAMPLE_APP_GetCrc (TableName );
132+
133+ Status = CFE_TBL_ReleaseAddress (SAMPLE_APP_Data .TblHandles [0 ]);
134+ if (Status != CFE_SUCCESS )
135+ {
136+ CFE_ES_WriteToSysLog ("Sample App: Fail to release table address: 0x%08lx" , (unsigned long )Status );
137+ }
138+ else
139+ {
140+ /* Invoke a function provided by SAMPLE_APP_LIB */
141+ SAMPLE_LIB_Function ();
142+ }
139143 }
140144
141- /* Invoke a function provided by SAMPLE_APP_LIB */
142- SAMPLE_LIB_Function ();
143-
144- return CFE_SUCCESS ;
145+ return Status ;
145146}
146147
147148/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
@@ -151,6 +152,7 @@ CFE_Status_t SAMPLE_APP_ProcessCmd(const SAMPLE_APP_ProcessCmd_t *Msg)
151152/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * **/
152153CFE_Status_t SAMPLE_APP_DisplayParamCmd (const SAMPLE_APP_DisplayParamCmd_t * Msg )
153154{
155+ SAMPLE_APP_Data .CmdCounter ++ ;
154156 CFE_EVS_SendEvent (SAMPLE_APP_VALUE_INF_EID , CFE_EVS_EventType_INFORMATION ,
155157 "SAMPLE_APP: ValU32=%lu, ValI16=%d, ValStr=%s" , (unsigned long )Msg -> Payload .ValU32 ,
156158 (int )Msg -> Payload .ValI16 , Msg -> Payload .ValStr );
0 commit comments