Read a Property
This helper function retrieves the current value of a property of a specific entity on the ThingWorx Platform.
enum msgCodeEnum twApi_ReadProperty(enum entityTypeEnum entityType, char * entityName, char * propertyName, twPrimitive ** result, int32_t timeout,
char forceConnect)
The following table describes the parameters for this helper function:
Parameter
Type
Description
entityType
Input
The type of entity that the property belongs to. Enumeration values can be found in twDefinitions.h
entityName
Input
The name of the entity that the property belongs to.
propertyName
Input
The name of the property to retrieve.
result
Input/Ouput
A pointer to a twPrimitive pointer. In a successful request, this parameter receives a valid pointer to a twPrimitive value. The caller is responsible for deleting the returned primitive using twPrimitive_Delete. If an error occurs, the returned pointer can be NULL.
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. Refer to twDefinitions.h for the enumeration definition.
Was this helpful?