ThingWorx Edge C SDK > Interacting with ThingWorx > SDK Application-Initiated Interaction > Trigger an Event
  
Trigger an Event
This helper function triggers a specific event on a named entity on ThingWorx platform.
enum msgCodeEnum twApi_FireEvent(enum entityTypeEnum entityType, char * entityName, char * eventName,
twInfoTable * params, int32_t timeout, char forceConnect)
The following table lists and describes the parameters for this helper function:
Parameter
Type
Description
entityType
Input
The type of entity that the service belongs to. Enumeration values can be found in twDefinitions.h.
entityName
Input
The name of the entity that the service belongs to.
eventName
Input
The name of the event to trigger.
params
Input
A pointer to an infotable containing the parameters to be passed to the event. The calling function will retain ownership of this pointer and is responsible for cleaning up the memory after the call is complete.
timeout
Input
The time (in milliseconds) to wait for a response from the server. A value of -1 uses the DEFAULT_MESSAGE_TIMEOUT as defined in twDefaultSettings.h.
forceConnect
Input
A Boolean value. If TRUE and the API is in the disconnected state of the duty cycle, the API will force a reconnect to send the request.
Return:
msgCodeEnum — the result of the call. See src/api/twDefinitions.h for the enumeration definition.