ThingWorx C SDK
|
Macros | |
#define | TW_PROPERTY(propertyName, description, type) twExt_RegisterStandardProperty(_tw_thing_name, propertyName, _tw_thing_namespace ,type, description, TW_PUSH_TYPE_ALWAYS,REPORT_ALL_CHANGES) |
Defines a Property of A Thing. This macro must be proceeded by either TW_DECLARE_SHAPE,TW_DECLARE_TEMPLATE or TW_MAKE_THING because these macros declare variables used by the TW_PROPERTY that follow them. Note that when using TW_PROPERTY to declare a property you are accepting the use of the default property handler. This property handler will allocate and manage the storage used for this property automatically. More... | |
#define | TW_PROPERTY_LONG(propertyName, description, type, pushType, threshold) twExt_RegisterStandardProperty(_tw_thing_name, propertyName, _tw_thing_namespace ,type, description, pushType,threshold) |
Defines a Property of A Thing. This version of TW_PROPERTY provides more options. This macro must be proceeded by either TW_DECLARE_SHAPE,TW_DECLARE_TEMPLATE or TW_MAKE_THING because these macros declare variables used by the TW_PROPERTY that follow them. More... | |
#define | TW_ADD_NUMBER_ASPECT(propertyName, aspectName, valuedouble) twApi_AddAspectToProperty(_tw_thing_name, propertyName, aspectName, twPrimitive_CreateFromNumber(valuedouble)) |
Aspects modify the behavior of a Property. See the ThingWorx composer for examples of available aspects of a Property. This macro is used to assign numeric values to aspects. More... | |
#define | TW_ADD_BOOLEAN_ASPECT(propertyName, aspectName, valuebool) twApi_AddAspectToProperty(_tw_thing_name, propertyName, aspectName, twPrimitive_CreateFromBoolean(valuebool)) |
Aspects modify the behavior of a Property. See the ThingWorx composer for examples of available aspects of a Property. This macro is used to assign boolean values to aspects. More... | |
#define | TW_ADD_STRING_ASPECT(propertyName, aspectName, valuestring) twApi_AddAspectToProperty(_tw_thing_name, propertyName, aspectName, twPrimitive_CreateFromString(valuestring, TRUE)) |
Aspects modify the behavior of a Property. See the ThingWorx composer for examples of available aspects of a Property. This macro is used to assign string values to aspects. More... | |
#define TW_ADD_BOOLEAN_ASPECT | ( | propertyName, | |
aspectName, | |||
valuebool | |||
) | twApi_AddAspectToProperty(_tw_thing_name, propertyName, aspectName, twPrimitive_CreateFromBoolean(valuebool)) |
Aspects modify the behavior of a Property. See the ThingWorx composer for examples of available aspects of a Property. This macro is used to assign boolean values to aspects.
propertyName | const char * [in] The name of the property to apply this Aspect to. |
aspectName | const char * [in] The name of the Aspect to add to a property. Some aspects are {TW_ASPECT_ISPERSISTENT, TW_ASPECT_ISREADONLY,TW_ASPECT_DATASHAPE,TW_ASPECT_ISLOGGED,TW_ASPECT_PUSHTYPE,TW_ASPECT_DATACHANGETYPE,TW_ASPECT_DATACHANGETHRESHOLD,TW_ASPECT_ISFOLDED,TW_ASPECT_DEFAULT_VALUE} |
valuebool | char [in] A boolean value to apply for this aspect. Acceptable values are {TRUE,FALSE} |
#define TW_ADD_NUMBER_ASPECT | ( | propertyName, | |
aspectName, | |||
valuedouble | |||
) | twApi_AddAspectToProperty(_tw_thing_name, propertyName, aspectName, twPrimitive_CreateFromNumber(valuedouble)) |
Aspects modify the behavior of a Property. See the ThingWorx composer for examples of available aspects of a Property. This macro is used to assign numeric values to aspects.
propertyName | const char * [in] The name of the property to apply this Aspect to. |
aspectName | const char * [in] The name of the Aspect to add to a property. Some aspects are {TW_ASPECT_ISPERSISTENT, TW_ASPECT_ISREADONLY,TW_ASPECT_DATASHAPE,TW_ASPECT_ISLOGGED,TW_ASPECT_PUSHTYPE,TW_ASPECT_DATACHANGETYPE,TW_ASPECT_DATACHANGETHRESHOLD,TW_ASPECT_ISFOLDED,TW_ASPECT_DEFAULT_VALUE} |
valuedouble | double [in] A value to apply for this aspect. Not all aspects accept all types (NUMBER,STRING,BOOLEAN) |
#define TW_ADD_STRING_ASPECT | ( | propertyName, | |
aspectName, | |||
valuestring | |||
) | twApi_AddAspectToProperty(_tw_thing_name, propertyName, aspectName, twPrimitive_CreateFromString(valuestring, TRUE)) |
Aspects modify the behavior of a Property. See the ThingWorx composer for examples of available aspects of a Property. This macro is used to assign string values to aspects.
propertyName | const char * [in] The name of the property to apply this Aspect to. |
aspectName | const char * [in] The name of the Aspect to add to a property. Some aspects are {TW_ASPECT_ISPERSISTENT, TW_ASPECT_ISREADONLY,TW_ASPECT_DATASHAPE,TW_ASPECT_ISLOGGED,TW_ASPECT_PUSHTYPE,TW_ASPECT_DATACHANGETYPE,TW_ASPECT_DATACHANGETHRESHOLD,TW_ASPECT_ISFOLDED,TW_ASPECT_DEFAULT_VALUE} |
valuebool | const char * [in] A string value to apply for this aspect. |
#define TW_PROPERTY | ( | propertyName, | |
description, | |||
type | |||
) | twExt_RegisterStandardProperty(_tw_thing_name, propertyName, _tw_thing_namespace ,type, description, TW_PUSH_TYPE_ALWAYS,REPORT_ALL_CHANGES) |
Defines a Property of A Thing. This macro must be proceeded by either TW_DECLARE_SHAPE,TW_DECLARE_TEMPLATE or TW_MAKE_THING because these macros declare variables used by the TW_PROPERTY that follow them. Note that when using TW_PROPERTY to declare a property you are accepting the use of the default property handler. This property handler will allocate and manage the storage used for this property automatically.
propertyName | const char * [in] The identifying name for this Property. |
description | const char * [in] An optional text description of the meaning of this event. If not provided use TW_NO_DESCRIPTION. |
type | twPrimitive * [in] A ThingWorx primitive type. Use of of the enum BaseType values. Examples are {TW_STRING,TW_NUMBER,TW_BOOLEAN} |
#define TW_PROPERTY_LONG | ( | propertyName, | |
description, | |||
type, | |||
pushType, | |||
threshold | |||
) | twExt_RegisterStandardProperty(_tw_thing_name, propertyName, _tw_thing_namespace ,type, description, pushType,threshold) |
Defines a Property of A Thing. This version of TW_PROPERTY provides more options. This macro must be proceeded by either TW_DECLARE_SHAPE,TW_DECLARE_TEMPLATE or TW_MAKE_THING because these macros declare variables used by the TW_PROPERTY that follow them.
propertyName | const char * [in] The identifying name for this Property. |
description | const char * [in] An optional text description of the meaning of this event. If not provided use TW_NO_DESCRIPTION. |
type | twPrimitive * [in] A ThingWorx primitive type. Use of of the enum BaseType values. Examples are {TW_STRING,TW_NUMBER,TW_BOOLEAN} |
pushType | const char * [in] Defines a strategy for determining if your property value has changed significantly enough to warrant pushing it up to the server. Valid values are TW_PUSH_TYPE_ALWAYS,TW_PUSH_TYPE_VALUE or TW_PUSH_TYPE_NEVER. |
threshold | double [in] If your strategy set in pushType is TW_PUSH_TYPE_VALUE this is the numerical difference that must occur between the last and the current property value to consider the change significant enough to push to the server. |