PreviousNext
FrcResponseTime
Help > Custom DPA Handler > Events > FrcResponseTime

This event is raised by predefined FRC response time command. 1st FRC user data byte (i.e. variable DataOutBeforeResponseFRC[0]) specifies the value of the user FRC command the FRC response time is requested. The byte return value corresponds to one of the corresponding _FRC_RESPONSE_TIME_??_MS constant (see IQRF-macros.h). It is highly recommended to implement this event for every user‑defined FRC command. This allows the control system connected to the [C] to find out the longest FRC response time in the network consisting of “unknown” heterogeneous [N] devices. DPA internally sets the lowest bit of the return value to prevent returning zero (equals _FRC_RESPONSE_TIME_40_MS) value. If the handler does not handle this event a value 0xFF is returned. The event is raised even at the Nodes that are not addressed by the current FRC response time command. IQRF OS function amIRecipientOfFRC can be used to find out if the result value is returned.

 

Example

 

case DpaEvent_FrcResponseTime:

  switch ( DataOutBeforeResponseFRC[0] )

  {

       case FRC_USER_BIT_FROM + 0:

       case FRC_USER_BIT_FROM + 1:

         responseFRCvalue = _FRC_RESPONSE_TIME_40_MS;

         break;

 

       case FRC_USER_BYTE_FROM + 0:

         responseFRCvalue = _FRC_RESPONSE_TIME_640_MS;

         break;

  }

  return Carry;

 

☼ See example code CustomDpaHandler-FRC.c for more details.