示例#1
0
void FM_AcquireTablePointers(void)
{
    int32  Status;

    /* Allow cFE an opportunity to make table updates */
    CFE_TBL_Manage(FM_GlobalData.FreeSpaceTableHandle);

    /* Acquire pointer to file system free space table */
    Status = CFE_TBL_GetAddress((void *) &FM_GlobalData.FreeSpaceTablePtr,
                                          FM_GlobalData.FreeSpaceTableHandle);

    if (Status == CFE_TBL_ERR_NEVER_LOADED)
    {
        /* Make sure we don't try to use the empty table buffer */
        FM_GlobalData.FreeSpaceTablePtr = (FM_FreeSpaceTable_t *) NULL;
    }

    return;

} /* End FM_AcquireTablePointers */
示例#2
0
void TT_AccessCurrentData(void)
{
	void *TblPointer;
	int32 Status;
	
	CFE_TBL_Manage(TT4_AppData.TblHandle);
    Status = CFE_TBL_GetAddress(&TblPointer,TT4_AppData.TblHandle);
       
    if (Status ==  CFE_TBL_INFO_UPDATED)    
    {      	      	
        TT4_AppData.HkPacket.UpdateCount++; 
    }

	 UTF_put_text("The current table values are:%d %d %d %d\n",
     			*(int8*)TblPointer,*(int8*)(TblPointer+1),
     			*(int8*)(TblPointer+2),*(int8*)(TblPointer+3));
    	               
     Status = CFE_TBL_ReleaseAddress(TT4_AppData.TblHandle);

	
} /*TT_AccessCurrentData*/
示例#3
0
int32 TO_TableInit (void)
{
	int32 iStatus = CFE_SUCCESS;

    /* Register The TO config table */
    iStatus = CFE_TBL_Register (&TO_AppData.ConfigHandle,
    		TO_CONFIG_TABLENAME, (sizeof (TO_Table_t)),
    		CFE_TBL_OPT_DEFAULT,
    		(CFE_TBL_CallbackFuncPtr_t)TO_ValidateTable);

    if (iStatus != CFE_SUCCESS)
    {
    	CFE_EVS_SendEvent(TO_CONFIG_REG_ERR_EID, CFE_EVS_ERROR,
    			"CFE_TBL_Register() returned error %i.  Aborting table init.",
    			iStatus);

        goto end_of_function;
    }

    /* Load the TO configuration table file */
    iStatus = CFE_TBL_Load (TO_AppData.ConfigHandle, CFE_TBL_SRC_FILE,
    		TO_CONFIG_FILENAME);

    if (iStatus != CFE_SUCCESS)
    {
        CFE_EVS_SendEvent(TO_CONFIG_LD_ERR_EID, CFE_EVS_ERROR,
                  "CFE_TBL_Load() returned error %i.  Aborting table init.",
                  iStatus);

        goto end_of_function;
    }

    /* Manage the TO config table */
    iStatus = CFE_TBL_Manage(TO_AppData.ConfigHandle);
    if (iStatus != CFE_SUCCESS)
    {
    	CFE_EVS_SendEvent(TO_CONFIG_MNG_ERR_EID, CFE_EVS_ERROR,
           "CFE_TBL_Manage() returned error %i.  Aborting table init.",
           iStatus);

        goto end_of_function;
    }

    /* Make sure the CI iLoad Table is accessible */
    iStatus = CFE_TBL_GetAddress ((void **) (& TO_AppData.Config),
    		                                TO_AppData.ConfigHandle);
    /* Status should be CFE_TBL_INFO_UPDATED because we loaded it above */
    if (iStatus != CFE_TBL_INFO_UPDATED)
    {
    	CFE_EVS_SendEvent(TO_CONFIG_GADR_ERR_EID, CFE_EVS_ERROR,
    			"CFE_TBL_GetAddress() returned error %i.  Aborting table init.",
    			iStatus);

    	goto end_of_function;
    }

    iStatus = CFE_SUCCESS;

end_of_function:
    return iStatus;

}