CDI_Register_Object_Attribute
Registers device attributes with NWPA, which then makes these attributes visible to the application layer.
LONG CDI_Register_Object_Attribute ( LONG npaHandle, LONG cdmBindHandle, struct AttributeInfoStruct *info, LONG (*getRoutine)(), LONG (*setRoutine)() );
For a given attribute, the CDM indicates the expected data type of the infoBuffer input parameter by the value it places in the attributeType field of the attribute's AttributeInfoStruct at registration. A pointer to this structure is passed to the attribute registration function, CDM_Get_Attribute places the return attribute information in the location pointed to by the infoBuffer input parameter and the byte-length of the return information in the location pointed to by the infoBufferLength input parameter.
CDM_Set_Attribute sets the attribute to the information contained in the infoBuffer input parameter. The length of this buffer is specified in the infoBufferLength input parameter. If the attribute change affects any of the information that the CDM originally reported to NWPA during its bind to the device, it must update these changes to NWPA by filling out the appropriate fields of an UpdateInfoStruct and calling CDI_Object_Update. The context of the set function is blocking; therefore, the CDM can issue any necessary commands to set the mode of the device.
The following table lists return values and descriptions.
CDI_Register_Object_Attribute allows a CDM to present attribute information about a device it manages to the application layer. To present the information, a CDM must register a get-function, such as CDM_Get_Attribute, that returns attribute information into a buffer provided by the calling process. If a device attribute can be changed by an application, then the CDM must register a set-function, such as CDM_Set_Attribute.