DCRP_STAT_PROCESS Algorithm

The algorithm used to update the device statistics is:

SWITCH (comm_status) {

   CASE TOOLKIT_WRITE_FAILED:

   CASE TOOLKIT_READ_TIMEOUT:

      Increment device transmissions

      break;

   CASE TOOLKIT_BAD_DATA:

      Increment device transmissions

      Increment device responses

      break;

   CASE_TOOLKIT_SUCCESS:

      Increment device transmissions

      IF status != TOOLKIT_REPLY_LATER

         Increment device responses

      ENDIF

      break;

   CASE TOOLKIT_UNSOLICITIED:

      // Don't increment transmissions

      Increment device responses

      comm_status = TOOLKIT_SUCCESS;

      break;

   CASE TOOLKIT_FAILURE:

      Increment device transmissions

      break:

ENDSWITCH

IF comm_status != TOOLKIT_SUCCESS

   IF last device status == TOOLKIT_SUCCESS

      Increment device failures

   ELSE IF comm_status != TOOLKIT_UNSOLICITED

      Increment device retries

   ENDIF

ELSE

   IF last device status != TOOLKIT_SUCCESS

   AND comm_status != TOOLKIT_UNSOLICITED

      Increment device retries

   ENDIF

ENDIR

last device status = comm_status

SWITCH (comm_status) {

   CASE TOOLKIT_WRITE_FAILED:

   CASE TOOLKIT_READ_TIMEOUT:

   CASE TOOLKIT_BAD_DATA:

      comm_status = TOOKIT_FAILURE;

      break;

   CASE TOOLKIT_UNSOLICITED:

      comm_status = TOOLKIT_SUCCESS;

      break;

ENDSWITCH

return comm_status;

More information

DCRP_STAT_PROCESS