NCM_GetValue( )
Description | Cautions | Example | Error Codes | See Also
Description
The NCM_GetValue( ) function gets an instantiated or default parameter value. This function enables you to determine either the instantiated value of a configuration parameter in the system configuration or the default value of a configuration parameter in the DCM Catalog.
The function parameters are defined as follows:
pncmFamily pointer to the structure containing the family name pncmDevice pointer to the structure containing a device name; the device name can be either a device model name or a unique device name (the unique device name must be the same name you used to add the device to the system configuration with the NCM_AddDevice( ) function) pncmProperty pointer to the structure containing the property name pncmVariable pointer to the structure containing the configuration parameter name ppncmValue an address of the pointer to be filled with the configuration parameter value Whether this function gets an instantiated value from the system configuration or a default value from the DCM Catalog depends on whether pncmDevice points to a unique device name or a device model name:
- To get an instantiated configuration parameter value: pncmDevice must point to a unique device name; the unique device name must be the same name you used to add the device to the system configuration with the NCM_AddDevice( ) function.
- To get the default configuration parameter value: pncmDevice must point to an installable device model name; the device model name must be for a model that is defined in the DCM Catalog.
For more information about the distinction between device model names and unique device names, see Section 2.3.4, Device Model Names and Unique Device Names.
Cautions
The DCM API allocates memory for the data returned by this function. To avoid memory leaks, the client application must deallocate this memory by calling the NCM_Dealloc( ) or NCM_DeallocValue( ) function.
Example
#include "NCMApi.h" ... // // Prepare inputs // NCMFamily family; family.name = "D/x1D"; family.next = NULL; NCMDevice device; device.name = "D/41D-1"; device.next = NULL; NCMProperty property; property.name = "System"; property.next = NULL; NCMVariable variable; variable.name = "D41DAddress"; variable.next = NULL; NCMValue * pValue = NULL; // // Execute // NCMRetCode ncmRc = NCM_GetValue( &family, &device, &property, &variable, &pValue ); if ( ncmRc == NCM_SUCCESS ) { if (pValue != Null && pValue ->name ! = Null) //use the value } else { // Process error ... } // Deallocate memory NCM_Dealloc( pValue ); ...Error Codes
See Also
Click here to contact Telecom Support Resources
Copyright 2003, Intel Corporation