DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

udi_instance_attr_get(3udi)


Read an attribute value for a driver instance

SYNOPSIS

#include <udi.h>

void udi_instance_attr_get (

	udi_instance_attr_get_call_t *callback,

	udi_cb_t *gcb,

	const char *attr_name,

	udi_ubit32_t child_ID,

	void *attr_value,

	udi_size_t attr_length );
 
typedef void udi_instance_attr_get_call_t (

	udi_cb_t *gcb,

	udi_instance_attr_type_t attr_type,

	udi_size_t actual_length );
 

ARGUMENTS callback, gcb are standard arguments described in the "Asynchronous Service Calls" section of "Calling Sequence and Naming Conventions".

attr_name is a null-terminated string specifying the attribute name. See Section 15.2, "Instance Attribute Names", and the UDI_ATTR_FILE attribute type for rules on attribute names.

child_ID is the child ID associated with the specific child instance for which this attribute has been set if it is a parent-visible attribute (prefix character `@').

For parent-visible attributes, this argument must match a child_ID from a previous udi_enumerate_ack that has not been unenumerated; it is ignored for other types of attributes.

attr_value is a pointer to a memory area to receive the attribute value.

attr_length is the length in bytes of the memory area pointed to by attr_value.

attr_type is the type specifier for the attribute value. See udi_instance_attr_type_t for details.

actual_length is the actual length of the attribute value, even if it could not fit in the attr_value memory area.

DESCRIPTION The udi_instance_attr_get function is used to obtain the value of a driver instance attribute. The returned attribute value will be written to the memory area specified by attr_value.

If attr_name contains a colon (`:'), the rest of the name must be an ASCII-encoded decimal number and attr_type must be UDI_ATTR_FILE. In this case, the number indicates the beginning file offset to read from, in bytes, starting from zero.

If the requested attribute does not exist, the callback routine will be called with an actual_length of 0 and an attr_type of UDI_ATTR_NONE.

Otherwise, actual_length will be set to the actual length of the attribute value, regardless of attr_length; in the case of UDI_ATTR_FILE with an offset specified, this will be the remaining length relative to the specified file. For attribute types other than UDI_ATTR_FILE, if actual_length exceeds attr_length, the contents of the attr_value memory area are unspecified; for UDI_ATTR_FILE, all valid bytes that fit will be filled in.

WARNINGS Control block usage must follow the rules described in the "Asynchronous Service Calls" section of "Standard Calling Sequences".

Use of the attr_name and attr_value parameters must conform to the rules described in Section 5.2.1.1, "Using Memory Pointers with Asynchronous Service Calls".

REFERENCES udi_instance_attr_type_t, udi_instance_attr_set


UDI Core Specification Contents