dcrp_stat_process
Updates device communication statistics kept inside the enabler based on communication status and completion status and returns the normalized communication status.
The common code calls dcrp_stat_process() after each call to user_read_data() and user_write_data() . If those routines make multiple requests of the device, or if other routines, such as user_valid_point() or user_device_info() access the device, they should call dcrp_stat_process() to process the status values and update the device communication status.
Syntax
TOOLKIT_STATUS dcrp_stat_process (DEVICE_DATA *device,
TOOLKIT_STATUS comm_status,
TOOLKIT_STATUS status)
Input Parameters
device
Is a pointer to the structure defining device data. DEVICE_DATA is a typedef to a structure defined in < inc_path/toolkit.h > .
comm_status
Is the communication status where TOOLKIT_STATUS is a typedef to an ENUM defined in <inc_path/toolkit.h > .
Valid values are:
- TOOLKIT_WRITE_FAILED
- TOOLKIT_TIMEOUT
- TOOLKIT_BAD_DATA
- TOOLKIT_SUCCESS
- TOOLKIT_FAILURE
status
Is the function completion status. Valid values are:
- TOOLKIT_SUCCESS
- TOOLKIT_FAILURE
- TOOLKIT_REPLY_LATER
Output Parameters
None
Return Value
This subroutine returns one of the following:
TOOLKIT_SUCCESS | Communication completed successfully. |
TOOLKIT_FAILURE | Communication not completed successfully. |