ThingWorx Edge C SDK > How to Set Up an Application > Initiating Interactions with a ThingWorx Platform > Push Properties
  
Push Properties
Use this function to update one or more properties with a single message to ThingWorx Platform. You can also use it to send multiple values of the same property to ThingWorx Platform in a single message.
enum msgCodeEnum twApi_PushProperties(enum entityTypeEnum entityType, char * entityName, propertyList * properties, int32_t timeout, char forceConnect)
* 
If many devices are pushing multiple properties very frequently and the error message code 1114 appears in the logs, you may need to change the default timeout for the ThingWorx Platform to respond to a service call. For details, refer to Troubleshooting an Error Pushing/Persisting Properties and Property Lists.
The following table describes the parameters for this helper function:
Parameter
Type
Description
entityType
Input
The type of entity that the properties belong to. Enumeration values can be found in the file, twDefinitions.h
entityName
Input
The name of the entity that the properties belong to.
properties
Input
A pointer to a list of twPrimitives. The calling function retains ownership of this pointer and is responsible for releasing the memory after the call is complete.
timeout
Input
The time (in milliseconds) to wait for a response from the platform. 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 forces a reconnect to send the request.
Return:
msgCodeEnum — the result of the call. Refer to twDefinitions.h for the enumeration definition.
An example usage of the twApi_PushProperties function is as follows:
void sendPropertyUpdate() {propertyList * proplist = twApi_CreatePropertyList("FaultStatus", twPrimitive_CreateFromBoolean(properties.FaultStatus), 0);
if (!proplist) {
TW_LOG(TW_ERROR,"sendPropertyUpdate: Error allocating property list");
return;
}
twApi_AddPropertyToList(proplist,"InletValve", twPrimitive_CreateFromBoolean(properties.InletValve), 0);
twApi_AddPropertyToList(proplist,"Temperature", twPrimitive_CreateFromNumber(properties.Temperature), 0);
twApi_AddPropertyToList(proplist,"TotalFlow", twPrimitive_CreateFromNumber(properties.TotalFlow), 0);
twApi_AddPropertyToList(proplist,"Pressure", twPrimitive_CreateFromNumber(properties.Pressure), 0);
twApi_AddPropertyToList(proplist,"Location", twPrimitive_CreateFromLocation(&properties.Location), 0);
twApi_PushProperties(TW_THING, thingName, proplist, -1, FALSE);
twApi_DeletePropertyList(proplist);
}