user_read_diag_data

Returns diagnostic data from specific locations within the enabler.

You can find the template for this subroutine in:

usrtm_readdiag.c

Syntax

void user_read_diag_data(DEVICE_DATA *device_struct,
                         ADDR_DATA *address_struct,
                         int length,
                         char *data,
                         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 > .

address_struct

Is a pointer to the address from which the data was read. ADDR_DATA is a typedef to a structure defined in < inc_path/toolkit.h > .

length

Is the number of bytes of data requested.

Output Parameters

data

Is a pointer to an array that contains the data that was read from the enabler.

  • For diagnostic bits, data should be packed into bytes so that the leftmost bit is the most significant.
  • For domains whose element size is greater than one byte, the bytes should be ordered in the same way as they are ordered by the underlying operating system on which the enabler is to run.

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 read all the data. 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.