2.4.5 CAN_TP_EventCallbackSet()

void CAN_TP_EventCallbackSet (CAN_TP_EventCallback callback)

Sets and event callback handler for the CAN-TP events to go to.

The specified function will be called whenever there are events that the ISO 15765-2 specification says the upper layer should be notified.

This is typically called in the system configuration and will not be used during the normal operation.

The callback will have 3 parameters:
  • The event of CAN_TP_EVENT type

  • The addressing information in the CAN_TP_SERVICE_HEADER struct

  • The event data payload in the *void pointer

The event data payload will be a pointer to a structure that has the data for that specific type of event. For example, the CAN_TP_EVENT_INDICATION event will use the CAN_TP_EVENT_INDICATION_DATA structure for the data field.  

Precondition:

CAN_TP_Initialize function should have been called before calling this function.

Parameters:
in callback

Function to call on an event.

Returns:

None