PREV TOC HOME INDEX NEXT


NCM_GetTDMBusValue( )


Description | Cautions | Example | Error Codes | See Also

}Name:

NCMRetCode NCM_GetTDMBusValue( pncmBus, pvariable, ppvalue)

Inputs:

NCMDevice *pncmBus
  • pointer to the structure containing a specific bus name
NCMVariable *pvariable
  • pointer to a structure containing the variable name to be retrieved

Outputs

NCMValue **ppvalue
  • address to pointer of value to be returned

Returns:

NCM_SUCCESS if success NCM error code if failure

Includes:

NCMApi.h

Mode:

synchronous

Description

The NCM_GetTDMBusValue( ) function gets the parameter value of the TDM bus. This function also allows the user to retrieve the value of user defined and resolved variables in the TDM Bus family. For additional information about using this function, see Section 2.10, Clock Master Fallback List.

The function parameters are defined as follows:

Parameter

Description

pncmBus pointer to the structure containing a specific bus name, for example, "Bus-0"
pvariable name of the variable
ppvalue pointer to the name of the value to be returned

Cautions

The variable must be a valid parameter under the TDM Bus Configuration, otherwise the function returns NCME_INVALID_INPUTS.

Memory to hold the returned data is allocated in this function. To avoid memory leaks, the application must deallocate the memory by calling NCM_Dealloc( ).

Currently, only a single bus is supported. Therefore, the bus name for the parameter pncmBus should be "Bus-0".

Example

#include "NCMApi.h" 
...
//
// Prepare inputs
// 
NCMDevice bus;
device.name = "Bus-0";
device.next = NULL; 
NCMVariable variable1;
variable.name = "Primary Master FRU (Resolved)";
variable.next = NULL; 
NCMVariable variable2;
variable.name = "NETREF One FRU (Resolved)";
variable.next = NULL; 
NCMValue *     pValue1 = NULL;
NCMValue *     pValue2 = NULL; 
//
// Execute
// 
//Get current Primary Master FRU
NCMRetCode     ncmRc = NCM_GetValue( &bus, &variable1, &pValue1 ); 
if ( ncmRc != NCM_SUCCESS )
{     // Process error
     ...
} 
//Get current Net Ref FRU
NCMRetCode     ncmRc = NCM_GetValue( &bus, &variable2, &pValue2 ); 
if ( ncmRc != NCM_SUCCESS )
{     // Process error
     ...
} 
// Deallocate memory
NCM_Dealloc( pValue1 );
NCM_Dealloc( pValue2 ); 

Error Codes

Equate

Returned When

NCME_CTBB_LIB a failure to load the CTBB library occurred
NCME_MEM_ALLOC memory could not be allocated to perform the function
NCME_GENERAL a problem occurred retrieving the data
NCME_INVALID_INPUTS the values of the parameters supplied are invalid

See Also


PREV TOC HOME INDEX NEXT

Click here to contact Telecom Support Resources

Copyright 2003, Intel Corporation
All rights reserved
This page generated January, 2003