user_device_info

Defines the device-specific characteristics for the accessible memory on the device.

Accessible memory sharing the same characteristics, and which can be read contiguously, is typically grouped together to form a domain. Elements within a domain must be readable/writable by a single request to read or write via user_read_data() and user_write_data().

You can find the template for this subroutine in:

usrtm_dvin.c

Syntax

void user_device_info(DEVICE_DATA *device_struct,
                      int *num_domains,
                      DOMAIN_ARRAY *domain,
                      SUPPORT *supported,
                      int *comm_status,
                      int *status)

Input Parameters

device_struct

Is a pointer to the structure defining device data. DEVICE_DATA is a typedef to a structure defined in < inc_path/toolkit.h > .

Output Parameters

num_domains

Is the number of domains defined for the device.

domains

Is a pointer to an array of domain structures which define the characteristics of each group of memory locations.

The number of elements in the structure is either TOOLKIT_MAX_DEVICE_DOMAINS or the value returned by user_device_set_max_device_domain_count() if use_default_domain_count is set in the supported structure for the protocol.

The first domain element is domain[0] , and all elements through domain[*num_domains - 1] should contain valid data.

DOMAIN_ARRAY is a typedef to a structure defined in < inc_path/toolkit.h > .

supported

Is a pointer to a structure defining the supported options for the device. SUPPORT is a typedef to a structure defined in < inc_path/toolkit.h > .

comm_status

Indicates whether a status of TOOLKIT_FAILURE occurred as a result of a communication failure. Valid values are:

TOOLKIT_SUCCESS Failure is not due to communications failure.
TOOLKIT_FAILURE Failure is due to communications failure.

status

Indicates whether the function successfully obtained all of the requested information. Valid values are:

TOOLKIT_SUCCESS Function completed successfully.
TOOLKIT_FAILURE Function did not complete successfully. Check comm_status to see if the failure was the result of a communication failure.

Return Value

None.

Programming Note

The default value for each option is the value set in user_protocol_info() . A field whose value is TOOLKIT_NO cannot be reset to TOOLKIT_YES in this function. If the value for a return by user_protocol_info() is TOOLKIT_NO and it is reset to TOOLKIT_YES in this function, the new value is ignored.