A function pointer that is a callback function to be called if a command is processed during a calibration.

The input parameters passed to the callback function are:

  • eventId

An integer value that is unique to a specific event. This value is used when an event's detail or description is updated.

  • senderName

The name of the device or component that is initiating the event.

  • eventDescription

The description of the event, e.g. the command sent to a device or the start of a calibration.

  • detailString

The details of the event, typically this is the response to a command that was sent.

  • updateFlag

When this flag is set to true then a previous event is being updated, e.g  a response was received.

The char* pointers are only valid within the execution of the callback function, a copy of the string should be made and the pointer should not be used outside the scope of the callback. The char* pointers will point to undefined memory on the stack after completion of the callback function.

The 'C' code definition is:

// Callback function pointer for SCPI command messages.
// The event id is the serial id of the event.
// The name is the device name that was being sent to when the event was generated.
// The command is the command that was sent to the device.
// The response may be null and usually comes in on a secondary event,
// with the update flag set to true and the eventId set to the primary event being responded to.
typedef void(*commandCallbackFn)(int eventId, char* name, char* command, char* response, bool update);