ThingWorx C SDK
twDefinitions.h File Reference

Common definitions for C SDK. More...

#include "twErrors.h"

Go to the source code of this file.

Macros

General
#define TRUE   1
 
#define FALSE   0
 
Messaging
#define TW_MSG_VERSION   0x01
 
File Transfer Service
#define TW_VIRTUAL_STAGING_DIR   "__staging__"
 
#define LIST_ALL   0
 
#define LIST_FILES   1
 
#define LIST_DIRS   2
 

Enumerations

Basic Message Structure Components
enum  msgType {
  TW_UNKNOWN = 0, TW_REQUEST, TW_RESPONSE, TW_AUTH,
  TW_BIND, TW_MULTIPART_REQ, TW_MULTIPART_RESP
}
 Enumeration of HTTP message types. More...
 
enum  msgCodeEnum {
  TWX_UNKNOWN = 0, TWX_GET, TWX_PUT, TWX_POST,
  TWX_DEL, TWX_BIND = 0x0A, TWX_UNBIND, TWX_AUTH = 0x14,
  TWX_KEEP_ALIVE = 0x1F, TWX_SUCCESS = 0x40, TWX_BAD_REQUEST = 0x80, TWX_UNAUTHORIZED,
  TWX_BAD_OPTION, TWX_FORBIDDEN, TWX_NOT_FOUND, TWX_METHOD_NOT_ALLOWED,
  TWX_NOT_ACCEPTABLE, TWX_PRECONDITION_FAILED = 0x8C, TWX_ENTITY_TOO_LARGE, TWX_UNSUPPORTED_CONTENT_FORMAT = 0x8F,
  TWX_INTERNAL_SERVER_ERROR = 0xA0, TWX_NOT_IMPLEMENTED, TWX_BAD_GATEWAY, TWX_SERVICE_UNAVAILABLE,
  TWX_GATEWAY_TIMEOUT, TWX_WROTE_TO_OFFLINE_MSG_STORE
}
 Enumeration of HTTP message codes. More...
 
Types and Characteristics
enum  entityTypeEnum {
  TW_UNDEFINED = 0, TW_THING = 0x0A, TW_THINGSHAPES = 0x0B, TW_THINGTEMPLATES = 0x0C,
  TW_THINGPACKAGES = 0x0D, TW_NETWORKS = 0x0E, TW_DATASHAPES = 0x0F, TW_MODELTAGS = 0x14,
  TW_DATATAGS = 0x15, TW_MASHUPS = 0x1E, TW_WIDGETS = 0x1F, TW_STYLEDEFINITIONS = 0x20,
  TW_STATEDEFINITIONS = 0x21, TW_MENUS = 0x22, TW_MEDIAENTITIES = 0x23, TW_LOCALIZATIONTABLES = 0x24,
  TW_DASHBOARDS = 0x27, TW_LOGS = 0x28, TW_USERS = 0x32, TW_GROUPS = 0x33,
  TW_ORGANIZATIONS = 0x34, TW_APPLICATIONKEYS = 0x35, TW_DIRECTORYSERVICES = 0x36, TW_RESOURCE = 0x3C,
  TW_SCRIPTFUNCTIONLIBRARIES = 0x3D, TW_EXTENSIONPACKAGES = 0x46, TW_SUBSYSTEM = 0x50
}
 
enum  characteristicEnum { TW_PROPERTIES = 1, TW_SERVICES, TW_EVENTS }
 
enum  BaseType {
  TW_NOTHING = -1, TW_STRING = 0, TW_NUMBER, TW_BOOLEAN,
  TW_DATETIME, TW_TIMESPAN, TW_INFOTABLE, TW_LOCATION,
  TW_XML, TW_JSON, TW_QUERY, TW_IMAGE,
  TW_HYPERLINK, TW_IMAGELINK, TW_PASSWORD, TW_HTML,
  TW_TEXT, TW_TAGS, TW_SCHEDULE, TW_VARIANT,
  TW_GUID = 20, TW_BLOB, TW_INTEGER, TW_PROPERTYNAME = 50,
  TW_SERVICENAME, TW_EVENTNAME, TW_THINGNAME = 100, TW_THINGSHAPENAME,
  TW_THINGTEMPLATENAME, TW_DATASHAPENAME = 104, TW_MASHUPNAME, TW_MENUNAME,
  TW_BASETYPENAME, TW_USERNAME, TW_GROUPNAME, TW_CATEGORYNAME,
  TW_STATEDEFINITIONNAME, TW_STYLEDEFINITIONNAME, TW_MODELTAGVOCABULARYNAME, TW_DATATAGVOCABULARYNAME,
  TW_NETWORKNAME, TW_MEDIAENTITYNAME, TW_APPLICATIONKEYNAME, TW_LOCALIZATIONTABLENAME,
  TW_ORGANIZATIONNAME, TW_DASHBOARDNAME, TW_UNKNOWN_TYPE
}
 

Variables

Service arrays
char * fileXferServices []
 
char * tunnelServices []
 

Detailed Description

Common definitions for C SDK.

Contains definitions for macros and enumerations relating to various message, return value, type, characteristic, and service encodings.

Enumeration Type Documentation

enum BaseType

Enumeration of base types.

Enumerator
TW_NOTHING 

-001 - Nothing type

TW_STRING 

000 - String type

TW_NUMBER 

001 - Number type

TW_BOOLEAN 

002 - Boolean type

TW_DATETIME 

003 - Date time type

TW_TIMESPAN 

004 - Time span type

TW_INFOTABLE 

005 - Info table type

TW_LOCATION 

006 - Location type

TW_XML 

007 - XML type

TW_JSON 

008 - JSON type

TW_QUERY 

009 - Query type

TW_IMAGE 

010 - Image type

TW_HYPERLINK 

011 - Hyperlink type

TW_IMAGELINK 

012 - Imagelink type

TW_PASSWORD 

013 - Password type

TW_HTML 

014 - HTML type

TW_TEXT 

015 - Text type

TW_TAGS 

016 - Tags type

TW_SCHEDULE 

017 - Schedule type

TW_VARIANT 

018 - Variant type

TW_GUID 

020 - GUID type

TW_BLOB 

021 - Blob type

TW_INTEGER 

022 - Integer type

TW_PROPERTYNAME 

050 - Property name type

TW_SERVICENAME 

051 - Service name type

TW_EVENTNAME 

052 - Event name type

TW_THINGNAME 

100 - Thing name type

TW_THINGSHAPENAME 

101 - Thing shape name type

TW_THINGTEMPLATENAME 

102 - Thing template name type

TW_DATASHAPENAME 

104 - Data shape name type

TW_MASHUPNAME 

105 - Mashup name type

TW_MENUNAME 

106 - Menu name type

TW_BASETYPENAME 

107 - Base type name type

TW_USERNAME 

108 - User name type

TW_GROUPNAME 

109 - Group name type

TW_CATEGORYNAME 

110 - Category name type

TW_STATEDEFINITIONNAME 

111 - State definition name type

TW_STYLEDEFINITIONNAME 

112 - Style definition name type

TW_MODELTAGVOCABULARYNAME 

113 - Model tag vocabulary name type

TW_DATATAGVOCABULARYNAME 

114 - Data tag vocabulary name type

TW_NETWORKNAME 

115 - Network name type

TW_MEDIAENTITYNAME 

116 - Media entity name type

TW_APPLICATIONKEYNAME 

117 - Application key name type

TW_LOCALIZATIONTABLENAME 

118 - Localization table name type

TW_ORGANIZATIONNAME 

119 - Organization name type

TW_DASHBOARDNAME 

120 - Dashboard name type

Enumeration of characteristics.

Enumerator
TW_PROPERTIES 

1 - Property characteristic

TW_SERVICES 

2 - Service characteristic

TW_EVENTS 

3 - Event characteristic

Enumeration of entity types.

Enumerator
TW_UNDEFINED 

0x00 - Undefined entity

TW_THING 

0x0A - Thing type

TW_THINGSHAPES 

0x0B - Thing shape type.

TW_THINGTEMPLATES 

0x0C - Thing template type

TW_THINGPACKAGES 

0x0D - Thing package type

TW_NETWORKS 

0x0E - Network type

TW_DATASHAPES 

0x0F - Data shape type

TW_MODELTAGS 

0x14 - Model tag type

TW_DATATAGS 

0x15 - Data tag type

TW_MASHUPS 

0x1E - Mashup type

TW_WIDGETS 

0x1F - Widget type

TW_STYLEDEFINITIONS 

0x20 - Style definition type

TW_STATEDEFINITIONS 

0x21 - State definition type

TW_MENUS 

0x22 - Menu type

TW_MEDIAENTITIES 

0x23 - Media entity type

TW_LOCALIZATIONTABLES 

0x24 - Localization table type

TW_DASHBOARDS 

0x27 - Dashboard type

TW_LOGS 

0x28 - Log type

TW_USERS 

0x32 - User type

TW_GROUPS 

0x33 - Group type

TW_ORGANIZATIONS 

0x34 - Organization type

TW_APPLICATIONKEYS 

0x35 - Application key type

TW_DIRECTORYSERVICES 

0x36 - Directory service type

TW_RESOURCE 

0x3C - Resource type

TW_SCRIPTFUNCTIONLIBRARIES 

0x3D - Script function library type

TW_EXTENSIONPACKAGES 

0x46 - Extension package type

TW_SUBSYSTEM 

0x50 - Subsystem type

Enumeration of HTTP message codes.

Note
0x00 - 0x1F = HTTP request methods.
0x40 - 0x8F = HTTP client error status codes.
0xA0 - 0xA4 = HTTP server error status codes.
Enumerator
TWX_UNKNOWN 

000 00000 - 0x00 Unknown method

TWX_GET 

000 00001 - 0x01 GET method

TWX_PUT 

000 00010 - 0x02 PUT method

TWX_POST 

000 00011 - 0x03 POST method

TWX_DEL 

000 00100 - 0x04 DELETE method

TWX_BIND 

000 01010 - 0x0A BIND method

TWX_UNBIND 

000 01011 - 0x0B UNBIND method

TWX_AUTH 

000 01100 - 0x0D AUTH method

TWX_KEEP_ALIVE 

000 11111 - 0x1F KEEP_ALIVE method

TWX_SUCCESS 

010 00000 - 0x40 (2.00) Success

TWX_BAD_REQUEST 

100 00000 - 0x80 (4.00) Bad request

TWX_UNAUTHORIZED 

100 00001 - 0x81 (4.01) Unauthorized

TWX_BAD_OPTION 

100 00010 - 0x82 (4.02) Bad option

TWX_FORBIDDEN 

100 00011 - 0x83 (4.03) Forbidden

TWX_NOT_FOUND 

100 00100 - 0x84 (4.04) Not found

TWX_METHOD_NOT_ALLOWED 

100 00101 - 0x85 (4.05) Method not allowed

TWX_NOT_ACCEPTABLE 

100 00110 - 0x86 (4.06) Not acceptable

TWX_PRECONDITION_FAILED 

100 01100 - 0x8C (4.12) Precondition failed

TWX_ENTITY_TOO_LARGE 

100 01101 - 0x8D (4.13) Entity too large

TWX_UNSUPPORTED_CONTENT_FORMAT 

100 01111 - 0x8F (4.15) Unsupported content format

TWX_INTERNAL_SERVER_ERROR 

101 00000 - 0xA0 (5.00) Internal server error

TWX_NOT_IMPLEMENTED 

101 00001 - 0xA1 (5.01) Not implemented

TWX_BAD_GATEWAY 

101 00010 - 0xA2 (5.02) Bad gateway

TWX_SERVICE_UNAVAILABLE 

101 00011 - 0xA3 (5.03) Service unavailable

TWX_GATEWAY_TIMEOUT 

101 00100 - 0xA4 (5.04) Gateway timeout

TWX_WROTE_TO_OFFLINE_MSG_STORE 

Wrote to offline message store

enum msgType

Enumeration of HTTP message types.

Enumerator
TW_UNKNOWN 

0x00 - Unknown message type

TW_REQUEST 

0x01 - Request message type

TW_RESPONSE 

0x02 - Response message type

TW_AUTH 

0x03 - Authorization message type

TW_BIND 

0x04 - Bind message type

TW_MULTIPART_REQ 

0x05 - Multi-part request message type

TW_MULTIPART_RESP 

0x06 - Multi-part response message type