IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
octypes.h File Reference

This file contains the definition, types and APIs for resource(s) be implemented. More...

Go to the source code of this file.

Classes

struct  OCStringLL
 
struct  OCIdentity
 End point identity. More...
 
struct  OCUUIdentity
 Universally unique identifier. More...
 
struct  OCDevAddr
 Data structure to encapsulate IPv4/IPv6/Contiki/lwIP device addresses. More...
 
struct  OCPersistentStorage
 Persistent storage handlers. More...
 
struct  OCObservationInfo
 Possible returned values from entity handler. More...
 
struct  OCHeaderOption
 This structure will be used to define the vendor specific header options to be included in communication packets. More...
 
struct  OCPlatformInfo
 This structure describes the platform properties. More...
 
struct  OCDeviceInfo
 This structure is expected as input for device properties. More...
 
struct  OCPayload
 A generic struct representing a payload returned from a resource operation. More...
 
struct  OCByteString
 This structure will be used to represent a binary string for CBOR payloads. More...
 
struct  OCRepPayloadValueArray
 
struct  OCRepPayloadValue
 
struct  OCRepPayload
 
struct  OCEndpointPayload
 
struct  OCResourcePayload
 
struct  OCDiscoveryPayload
 
struct  OCSecurityPayload
 
struct  OCPresencePayload
 
struct  OCDiagnosticPayload
 
struct  OCIntrospectionPayload
 
struct  OCEntityHandlerRequest
 Incoming requests handled by the server. More...
 
struct  OCClientResponse
 Response from queries to remote servers. More...
 
struct  OCEntityHandlerResponse
 Request handle is passed to server via the entity handler for each incoming request. More...
 
struct  OCDPDev
 Device Information of discoverd direct pairing device(s). More...
 
struct  OCCallbackData
 This info is passed from application to OC Stack when initiating a request to Server. More...
 

Macros

#define WITH_PRESENCE
 For the feature presence. More...
 
#define IOTIVITY_VERSION   "1.3.1"
 Version of IoTivity. More...
 
#define OC_RSRVD_WELL_KNOWN_URI   "/oic/res"
 OIC Virtual resources supported by every OIC device. More...
 
#define OC_RSRVD_DEVICE_URI   "/oic/d"
 Device URI. More...
 
#define OC_RSRVD_PLATFORM_URI   "/oic/p"
 Platform URI. More...
 
#define OC_RSRVD_RESOURCE_TYPES_URI   "/oic/res/types/d"
 Resource Type. More...
 
#define OC_RSRVD_GATEWAY_URI   "/oic/gateway"
 Gateway URI. More...
 
#define OC_RSRVD_WELL_KNOWN_MQ_URI   "/oic/ps"
 MQ Broker URI. More...
 
#define OC_RSRVD_KEEPALIVE_URI   "/oic/ping"
 KeepAlive URI. More...
 
#define OC_RSRVD_PRESENCE_URI   "/oic/ad"
 Presence. More...
 
#define OC_RSRVD_DEVICE_PRESENCE_URI   "/oic/prs"
 Presence URI through which the OIC devices advertise their device presence. More...
 
#define OC_DEFAULT_PRESENCE_TTL_SECONDS   (60)
 Sets the default time to live (TTL) for presence. More...
 
#define OC_MULTICAST_DISCOVERY_URI   "/oic/res"
 For multicast Discovery mechanism. More...
 
#define OC_QUERY_SEPARATOR   "&;"
 Separator for multiple query string. More...
 
#define OC_KEY_VALUE_DELIMITER   "="
 Delimeter for keys and values in query string. More...
 
#define OC_DEFAULT_PRESENCE_TTL_SECONDS   (60)
 Sets the default time to live (TTL) for presence. More...
 
#define OC_MAX_PRESENCE_TTL_SECONDS   (60 * 60 * 24)
 OC_MAX_PRESENCE_TTL_SECONDS sets the maximum time to live (TTL) for presence. More...
 
#define OC_RSRVD_TRIGGER_CREATE   "create"
 Presence "Announcement Triggers". More...
 
#define OC_RSRVD_TRIGGER_CHANGE   "change"
 To change. More...
 
#define OC_RSRVD_TRIGGER_DELETE   "delete"
 To delete. More...
 
#define OC_RSRVD_OC   "oic"
 Attributes used to form a proper OIC conforming JSON message. More...
 
#define OC_RSRVD_PAYLOAD   "payload"
 For payload. More...
 
#define OC_RSRVD_HREF   "href"
 To represent href. More...
 
#define OC_RSRVD_PROPERTY   "prop"
 To represent property. More...
 
#define OC_RSRVD_REPRESENTATION   "rep"
 For representation. More...
 
#define OC_RSRVD_CONTENT_TYPE   "ct"
 To represent content type. More...
 
#define OC_RSRVD_RESOURCE_TYPE   "rt"
 To represent resource type. More...
 
#define OC_RSRVD_RESOURCE_TYPE_PRESENCE   "oic.wk.ad"
 To represent resource type with presence. More...
 
#define OC_RSRVD_RESOURCE_TYPE_DEVICE   "oic.wk.d"
 To represent resource type with device. More...
 
#define OC_RSRVD_RESOURCE_TYPE_PLATFORM   "oic.wk.p"
 To represent resource type with platform. More...
 
#define OC_RSRVD_RESOURCE_TYPE_MAINTENANCE   "oic.wk.mnt"
 To represent resource type with maintenance. More...
 
#define OC_RSRVD_RESOURCE_TYPE_COLLECTION   "oic.wk.col"
 To represent resource type with collection. More...
 
#define OC_RSRVD_RESOURCE_TYPE_RES   "oic.wk.res"
 To represent resource type with RES. More...
 
#define OC_RSRVD_RESOURCE_TYPE_MQ_BROKER   "oic.wk.ps"
 To represent content type with MQ Broker. More...
 
#define OC_RSRVD_RESOURCE_TYPE_MQ_TOPIC   "oic.wk.ps.topic"
 To represent content type with MQ Topic. More...
 
#define OC_RSRVD_RESOURCE_TYPE_INTROSPECTION   "oic.wk.introspection"
 To represent resource type with introspection. More...
 
#define OC_RSRVD_RESOURCE_TYPE_INTROSPECTION_PAYLOAD   "oic.wk.introspection.payload"
 To represent resource type with introspection payload. More...
 
#define OC_RSRVD_INTERFACE   "if"
 To represent interface. More...
 
#define OC_RSRVD_TTL   "ttl"
 To represent time to live. More...
 
#define OC_RSRVD_DEVICE_TTL   OC_RSRVD_TTL
 To indicate how long RD should publish this item. More...
 
#define OC_RSRVD_NONCE   "non"
 To represent non. More...
 
#define OC_RSRVD_TRIGGER   "trg"
 To represent trigger type. More...
 
#define OC_RSRVD_LINKS   "links"
 To represent links. More...
 
#define OC_RSRVD_INTERFACE_DEFAULT   "oic.if.baseline"
 To represent default interface. More...
 
#define OC_RSRVD_INTERFACE_READ   "oic.if.r"
 To represent read-only interface. More...
 
#define OC_RSRVD_INTERFACE_READ_WRITE   "oic.if.rw"
 To represent read-write interface. More...
 
#define OC_RSRVD_INTERFACE_LL   "oic.if.ll"
 To represent ll interface. More...
 
#define OC_RSRVD_INTERFACE_BATCH   "oic.if.b"
 To represent batch interface. More...
 
#define OC_RSRVD_INTERFACE_ACTUATOR   "oic.if.a"
 To represent actuator interface. More...
 
#define OC_RSRVD_INTERFACE_SENSOR   "oic.if.s"
 To represent sensor interface. More...
 
#define OC_RSRVD_INTERFACE_GROUP   "oic.mi.grp"
 To represent interface group. More...
 
#define OC_RSRVD_FW_VERSION   "mnfv"
 To represent FW version. More...
 
#define OC_RSRVD_HOST_NAME   "hn"
 To represent host name. More...
 
#define OC_RSRVD_POLICY   "p"
 To represent policy. More...
 
#define OC_RSRVD_BITMAP   "bm"
 To represent bitmap. More...
 
#define OC_RSRVD_SECURE   "sec"
 For security. More...
 
#define OC_SECURITY_DB_FILE_NAME   "oic_svr_db.json"
 Security Database persistent store name(json). More...
 
#define OC_SECURITY_DB_DAT_FILE_NAME   "oic_svr_db.dat"
 Security Database persistent store name(dat). More...
 
#define OC_RSRVD_HOSTING_PORT   "port"
 Port. More...
 
#define OC_RSRVD_TCP_PORT   "x.org.iotivity.tcp"
 TCP Port. More...
 
#define OC_RSRVD_TLS_PORT   "x.org.iotivity.tls"
 TLS Port. More...
 
#define OC_RSRVD_SERVER_INSTANCE_ID   "sid"
 For Server instance ID. More...
 
#define OC_RSRVD_ENDPOINTS   "eps"
 To represent endpoints. More...
 
#define OC_RSRVD_ENDPOINT   "ep"
 To represent endpoint. More...
 
#define OC_RSRVD_PRIORITY   "pri"
 To represent priority. More...
 
#define OC_RSRVD_INSTANCE_ID   "id"
 For resource instance ID. More...
 
#define OC_RSRVD_PLATFORM_ID   "pi"
 Platform. More...
 
#define OC_RSRVD_MFG_NAME   "mnmn"
 Platform MFG NAME. More...
 
#define OC_RSRVD_MFG_URL   "mnml"
 Platform URL. More...
 
#define OC_RSRVD_MODEL_NUM   "mnmo"
 Model Number. More...
 
#define OC_RSRVD_MFG_DATE   "mndt"
 Platform MFG Date. More...
 
#define OC_RSRVD_PLATFORM_VERSION   "mnpv"
 Platform versio.n. More...
 
#define OC_RSRVD_OS_VERSION   "mnos"
 Platform Operating system version. More...
 
#define OC_RSRVD_HARDWARE_VERSION   "mnhw"
 Platform Hardware version. More...
 
#define OC_RSRVD_FIRMWARE_VERSION   "mnfv"
 Platform Firmware version. More...
 
#define OC_RSRVD_SUPPORT_URL   "mnsl"
 Support URL for the platform. More...
 
#define OC_RSRVD_SYSTEM_TIME   "st"
 System time for the platform. More...
 
#define OC_RSRVD_VID   "vid"
 VID for the platform. More...
 
#define OC_RSRVD_DEVICE_ID   "di"
 Device. More...
 
#define OC_RSRVD_DEVICE_NAME   "n"
 Device Name. More...
 
#define OC_RSRVD_SPEC_VERSION   "icv"
 Device specification version. More...
 
#define OC_RSRVD_DATA_MODEL_VERSION   "dmv"
 Device data model. More...
 
#define OC_RSRVD_DEVICE_DESCRIPTION   "ld"
 Device description, localized. More...
 
#define OC_RSRVD_SOFTWARE_VERSION   "sv"
 Device software version. More...
 
#define OC_RSRVD_DEVICE_MFG_NAME   "dmn"
 Device manufacturer name, localized. More...
 
#define OC_RSRVD_DEVICE_MODEL_NUM   "dmno"
 Device model number. More...
 
#define OC_RSRVD_PROTOCOL_INDEPENDENT_ID   "piid"
 Protocol-Independent ID. More...
 
#define OC_SPEC_VERSION   "ocf.1.1.0"
 Device specification version. More...
 
#define OC_SPEC_VERSION_VALUE   2048
 Integer value of spec version (OCF1.0 0b0000:1000:0000:0000). More...
 
#define OC_DATA_MODEL_VERSION   "ocf.res.1.1.0,ocf.sh.1.1.0"
 Device Data Model version. More...
 
#define OC_RSRVD_INTROSPECTION_NAME   "n"
 Introspection. More...
 
#define OC_RSRVD_INTROSPECTION_NAME_VALUE   "Introspection"
 Value of name. More...
 
#define OC_RSRVD_INTROSPECTION_URL_INFO   "urlInfo"
 Url info Object. More...
 
#define OC_RSRVD_INTROSPECTION_URL   "url"
 Url property. More...
 
#define OC_RSRVD_INTROSPECTION_PROTOCOL   "protocol"
 Protocol property. More...
 
#define OC_RSRVD_INTROSPECTION_CONTENT_TYPE   "content-type"
 Content-Type property. More...
 
#define OC_RSRVD_INTROSPECTION_CONTENT_TYPE_VALUE   "application/cbor"
 Content-Type property value. More...
 
#define OC_RSRVD_INTROSPECTION_VERSION   "version"
 Version property. More...
 
#define OC_RSRVD_INTROSPECTION_VERSION_VALUE   1
 Version property value. More...
 
#define OC_INTROSPECTION_FILE_NAME   "introspection.dat"
 Introspection persistent store name. More...
 
#define OC_MULTICAST_PREFIX   "224.0.1.187:5683"
 These provide backward compatibility - their use is deprecated. More...
 
#define OC_MULTICAST_IP   "224.0.1.187"
 Multicast IP address. More...
 
#define OC_MULTICAST_PORT   (5683)
 Multicast Port. More...
 
#define MAX_ADDR_STR_SIZE   (66)
 Max Device address size. More...
 
#define MAC_ADDR_STR_SIZE   (17)
 Length of MAC address. More...
 
#define MAC_ADDR_BLOCKS   (6)
 Blocks of MAC address. More...
 
#define MAX_IDENTITY_SIZE   (37)
 Max identity size. More...
 
#define UUID_IDENTITY_SIZE   (128/8)
 Universal unique identity size. More...
 
#define OC_RSRVD_RD_URI   "/oic/rd"
 Resource Directory. More...
 
#define OC_RSRVD_RESOURCE_TYPE_RD   "oic.wk.rd"
 To represent resource type with rd. More...
 
#define OC_RSRVD_RD_DISCOVERY_SEL   "sel"
 RD Discovery bias factor type. More...
 
#define OC_RSRVD_PROXY_URI   "/oic/chp"
 Resource URI used to discover Proxy. More...
 
#define OC_RSRVD_PROXY_OPTION_ID   35
 Resource URI used to discover Proxy. More...
 
#define OC_RSRVD_INS   "ins"
 Unique value per collection/link. More...
 
#define OC_RSRVD_RTS   "rts"
 Allowable resource types in the links. More...
 
#define OC_RSRVD_DREL   "drel"
 Default relationship. More...
 
#define OC_RSRVD_REL   "rel"
 Defines relationship between links. More...
 
#define OC_RSRVD_TITLE   "title"
 Defines title. More...
 
#define OC_RSRVD_URI   "anchor"
 Defines URI. More...
 
#define OC_RSRVD_MEDIA_TYPE   "type"
 Defines media type. More...
 
#define OC_RSRVD_RESOURCE_TYPE_RDPUBLISH   "oic.wk.rdpub"
 To represent resource type with Publish RD. More...
 
#define OC_RSRVD_ACCOUNT_URI   "/oic/account"
 Cloud Account. More...
 
#define OC_RSRVD_ACCOUNT_SEARCH_URI   "/oic/account/search"
 Account user URI. More...
 
#define OC_RSRVD_ACCOUNT_SESSION_URI   "/oic/account/session"
 Account session URI. More...
 
#define OC_RSRVD_ACCOUNT_TOKEN_REFRESH_URI   "/oic/account/tokenrefresh"
 Account token refresh URI. More...
 
#define OC_RSRVD_ACL_GROUP_URI   "/oic/acl/group"
 ACL group URI. More...
 
#define OC_RSRVD_ACL_INVITE_URI   "/oic/acl/invite"
 ACL invite URI. More...
 
#define OC_RSRVD_AUTHPROVIDER   "authprovider"
 Defines auth provider. More...
 
#define OC_RSRVD_AUTHCODE   "authcode"
 Defines auth code. More...
 
#define OC_RSRVD_ACCESS_TOKEN   "accesstoken"
 Defines access token. More...
 
#define OC_RSRVD_LOGIN   "login"
 Defines login. More...
 
#define OC_RSRVD_SEARCH   "search"
 Defines search. More...
 
#define OC_RSRVD_GRANT_TYPE   "granttype"
 Defines grant type. More...
 
#define OC_RSRVD_REFRESH_TOKEN   "refreshtoken"
 Defines refresh token. More...
 
#define OC_RSRVD_USER_UUID   "uid"
 Defines user UUID. More...
 
#define OC_RSRVD_GROUP_ID   "gid"
 Defines group ID. More...
 
#define OC_RSRVD_MEMBER_ID   "mid"
 Defines member of group ID. More...
 
#define OC_RSRVD_INVITE   "invite"
 Defines invite. More...
 
#define OC_RSRVD_ACCEPT   "accept"
 Defines accept. More...
 
#define OC_RSRVD_OPERATION   "op"
 Defines operation. More...
 
#define OC_RSRVD_ADD   "add"
 Defines add. More...
 
#define OC_RSRVD_DELETE   "delete"
 Defines delete. More...
 
#define OC_RSRVD_OWNER   "owner"
 Defines owner. More...
 
#define OC_RSRVD_MEMBERS   "members"
 Defines members. More...
 
#define OC_RSRVD_GRANT_TYPE_REFRESH_TOKEN   "refresh_token"
 To represent grant type with refresh token. More...
 
#define OC_RSRVD_PROV_CRL_URL   "/oic/credprov/crl"
 Cloud CRL. More...
 
#define OC_RSRVD_LAST_UPDATE   "lu"
 
#define OC_RSRVD_THIS_UPDATE   "thisupdate"
 
#define OC_RSRVD_NEXT_UPDATE   "nu"
 
#define OC_RSRVD_SERIAL_NUMBERS   "rcsn"
 
#define OC_RSRVD_CRL   "crldata"
 
#define OC_RSRVD_CRL_ID   "crlid"
 
#define OC_RSRVD_GROUP_URL   "/oic/group"
 Cloud ACL. More...
 
#define OC_RSRVD_ACL_GROUP_URL   "/oic/acl/group"
 
#define OC_RSRVD_ACL_INVITE_URL   "/oic/acl/invite"
 
#define OC_RSRVD_ACL_VERIFY_URL   "/oic/acl/verify"
 
#define OC_RSRVD_ACL_ID_URL   "/oic/acl/id"
 
#define OC_RSRVD_MEMBER_ID   "mid"
 Defines member of group ID. More...
 
#define OC_RSRVD_GROUP_ID   "gid"
 Defines group ID. More...
 
#define OC_RSRVD_OWNER_ID   "oid"
 
#define OC_RSRVD_ACL_ID   "aclid"
 
#define OC_RSRVD_ACE_ID   "aceid"
 
#define OC_RSRVD_DEVICE_ID   "di"
 Device. More...
 
#define OC_RSRVD_SUBJECT_ID   "sid"
 
#define OC_RSRVD_REQUEST_METHOD   "rm"
 
#define OC_RSRVD_REQUEST_URI   "uri"
 
#define OC_RSRVD_GROUP_MASTER_ID   "gmid"
 
#define OC_RSRVD_GROUP_TYPE   "gtype"
 
#define OC_RSRVD_SUBJECT_TYPE   "stype"
 
#define OC_RSRVD_GROUP_ID_LIST   "gidlist"
 
#define OC_RSRVD_MEMBER_ID_LIST   "midlist"
 
#define OC_RSRVD_DEVICE_ID_LIST   "dilist"
 
#define OC_RSRVD_ACCESS_CONTROL_LIST   "aclist"
 
#define OC_RSRVD_RESOURCES   "resources"
 
#define OC_RSRVD_VALIDITY   "validity"
 
#define OC_RSRVD_PERIOD   "period"
 
#define OC_RSRVD_RECURRENCE   "recurrence"
 
#define OC_RSRVD_INVITE   "invite"
 Defines invite. More...
 
#define OC_RSRVD_INVITED   "invited"
 
#define OC_RSRVD_ENCODING   "encoding"
 
#define OC_OIC_SEC   "oic.sec"
 
#define OC_RSRVD_BASE64   "base64"
 
#define OC_RSRVD_DER   "der"
 
#define OC_RSRVD_PEM   "pem"
 
#define OC_RSRVD_RAW   "raw"
 
#define OC_RSRVD_UNKNOWN   "unknown"
 
#define OC_RSRVD_DATA   "data"
 
#define OC_RSRVD_RESOURCE_OWNER_UUID   "rowneruuid"
 
#define OC_RSRVD_SUBJECT_UUID   "subjectuuid"
 
#define OC_RSRVD_PERMISSION_MASK   "permission"
 
#define OC_RSRVD_GROUP_PERMISSION   "gp"
 
#define OC_RSRVD_GROUP_ACL   "gacl"
 
#define OC_RSRVD_PROV_CERT_URI   "/oic/credprov/cert"
 Certificete Sign Request. More...
 
#define OC_RSRVD_CSR   "csr"
 
#define OC_RSRVD_CERT   "cert"
 
#define OC_RSRVD_CACERT   "certchain"
 
#define OC_RSRVD_TOKEN_TYPE   "tokentype"
 
#define OC_RSRVD_EXPIRES_IN   "expiresin"
 
#define OC_RSRVD_REDIRECT_URI   "redirecturi"
 
#define OC_RSRVD_CERTIFICATE   "certificate"
 
#define COAP_OPTION_ACCEPT_VERSION   2049
 TODO: Move these COAP defines to CoAP lib once approved. More...
 
#define COAP_OPTION_CONTENT_VERSION   2053
 
#define OC_MASK_SCOPE   (0x000F)
 Bit mask for scope. More...
 
#define OC_MASK_MODS   (0x0FF0)
 Bit mask for Mods. More...
 
#define OC_MASK_FAMS   (OC_IP_USE_V6|OC_IP_USE_V4)
 
#define CT_ADAPTER_SHIFT   16
 bit shift required for connectivity adapter. More...
 
#define CT_MASK_FLAGS   0xFFFF
 Mask Flag. More...
 
#define CT_MASK_ADAPTER   0xFFFF0000
 Mask Adapter. More...
 
#define OC_MASK_RESOURCE_SECURE   (OC_NONSECURE | OC_SECURE)
 
#define MAX_SEQUENCE_NUMBER   (0xFFFFFF)
 Sequence number is a 24 bit field, per https://tools.ietf.org/html/rfc7641. More...
 
#define MAX_REP_ARRAY_DEPTH   3
 

Typedefs

typedef struct OCStringLL OCStringLL
 
typedef void * OCDoHandle
 Handle to an OCDoResource invocation. More...
 
typedef void * OCResourceHandle
 Handle to an OCResource object owned by the OCStack. More...
 
typedef void * OCRequestHandle
 Handle to an OCRequest object owned by the OCStack. More...
 
typedef uint8_t OCObservationId
 Unique identifier for each observation request. More...
 
typedef struct OCHeaderOption OCHeaderOption
 This structure will be used to define the vendor specific header options to be included in communication packets. More...
 
typedef struct OCRepPayloadValue OCRepPayloadValue
 
typedef struct OCRepPayload OCRepPayload
 
typedef struct OCEndpointPayload OCEndpointPayload
 
typedef struct OCResourcePayload OCResourcePayload
 
typedef struct OCDiscoveryPayload OCDiscoveryPayload
 
typedef enum OCPrm OCPrm_t
 direct pairing Method Type. More...
 
typedef struct OCDPDev OCDPDev_t
 Device Information of discoverd direct pairing device(s). More...
 
typedef OCStackApplicationResult(* OCClientResponseHandler )(void *context, OCDoHandle handle, OCClientResponse *clientResponse)
 Client applications implement this callback to consume responses received from Servers. More...
 
typedef void(* OCClientContextDeleter )(void *context)
 Client applications using a context pointer implement this callback to delete the context upon removal of the callback/context pointer from the internal callback-list. More...
 
typedef struct OCCallbackData OCCallbackData
 This info is passed from application to OC Stack when initiating a request to Server. More...
 
typedef OCEntityHandlerResult(* OCEntityHandler )(OCEntityHandlerFlag flag, OCEntityHandlerRequest *entityHandlerRequest, void *callbackParam)
 Application server implementations must implement this callback to consume requests OTA. More...
 
typedef OCEntityHandlerResult(* OCDeviceEntityHandler )(OCEntityHandlerFlag flag, OCEntityHandlerRequest *entityHandlerRequest, char *uri, void *callbackParam)
 Device Entity handler need to use this call back instead of OCEntityHandler. More...
 

Enumerations

enum  OCTransportAdapter {
  OC_DEFAULT_ADAPTER = 0, OC_ADAPTER_IP = (1 << 0), OC_ADAPTER_GATT_BTLE = (1 << 1), OC_ADAPTER_RFCOMM_BTEDR = (1 << 2),
  OC_ADAPTER_TCP = (1 << 4), OC_ADAPTER_NFC = (1 << 5)
}
 These enums (OCTransportAdapter and OCTransportFlags) must be kept synchronized with OCConnectivityType (below) as well as CATransportAdapter and CATransportFlags (in CACommon.h). More...
 
enum  OCTransportBTFlags_t {
  OC_DEFAULT_BT_FLAGS = 0, OC_LE_ADV_DISABLE = 0x1, OC_LE_ADV_ENABLE = 0x2, OC_LE_SERVER_DISABLE = (1 << 4),
  OC_EDR_SERVER_DISABLE = (1 << 7)
}
 
enum  OCLogLevel { OC_LOG_LEVEL_ALL = 1, OC_LOG_LEVEL_INFO }
 Log level to print can be controlled through this enum. More...
 
enum  OCTransportFlags {
  OC_DEFAULT_FLAGS = 0, OC_FLAG_SECURE = (1 << 4), OC_IP_USE_V6 = (1 << 5), OC_IP_USE_V4 = (1 << 6),
  OC_MULTICAST = (1 << 7), OC_SCOPE_INTERFACE = 0x1, OC_SCOPE_LINK = 0x2, OC_SCOPE_REALM = 0x3,
  OC_SCOPE_ADMIN = 0x4, OC_SCOPE_SITE = 0x5, OC_SCOPE_ORG = 0x8, OC_SCOPE_GLOBAL = 0xE
}
 Enum layout assumes some targets have 16-bit integer (e.g., Arduino). More...
 
enum  OCConnectivityType {
  CT_DEFAULT = 0, CT_ADAPTER_IP = (1 << 16), CT_ADAPTER_GATT_BTLE = (1 << 17), CT_ADAPTER_RFCOMM_BTEDR = (1 << 18),
  CT_ADAPTER_TCP = (1 << 20), CT_ADAPTER_NFC = (1 << 21), CT_FLAG_SECURE = (1 << 4), CT_IP_USE_V6 = (1 << 5),
  CT_IP_USE_V4 = (1 << 6), CT_SCOPE_INTERFACE = 0x1, CT_SCOPE_LINK = 0x2, CT_SCOPE_REALM = 0x3,
  CT_SCOPE_ADMIN = 0x4, CT_SCOPE_SITE = 0x5, CT_SCOPE_ORG = 0x8, CT_SCOPE_GLOBAL = 0xE
}
 This enum type includes elements of both OCTransportAdapter and OCTransportFlags. More...
 
enum  OCMethod {
  OC_REST_NOMETHOD = 0, OC_REST_GET = (1 << 0), OC_REST_PUT = (1 << 1), OC_REST_POST = (1 << 2),
  OC_REST_DELETE = (1 << 3), OC_REST_OBSERVE = (1 << 4), OC_REST_OBSERVE_ALL = (1 << 5), OC_REST_PRESENCE = (1 << 7),
  OC_REST_DISCOVER = (1 << 8)
}
 OCDoResource methods to dispatch the request. More...
 
enum  OCPayloadFormat {
  OC_FORMAT_CBOR, OC_FORMAT_VND_OCF_CBOR, OC_FORMAT_JSON, OC_FORMAT_UNDEFINED,
  OC_FORMAT_UNSUPPORTED
}
 Formats for payload encoding. More...
 
enum  OCMode { OC_CLIENT = 0, OC_SERVER, OC_CLIENT_SERVER, OC_GATEWAY }
 Host Mode of Operation. More...
 
enum  OCQualityOfService { OC_LOW_QOS = 0, OC_MEDIUM_QOS, OC_HIGH_QOS, OC_NA_QOS }
 Quality of Service attempts to abstract the guarantees provided by the underlying transport protocol. More...
 
enum  OCResourceProperty {
  OC_RES_PROP_NONE = (0), OC_DISCOVERABLE = (1 << 0), OC_OBSERVABLE = (1 << 1), OC_ACTIVE = (1 << 2),
  OC_SLOW = (1 << 3), OC_NONSECURE = (1 << 6), OC_SECURE = (0), OC_EXPLICIT_DISCOVERABLE = (1 << 5)
}
 Resource Properties. More...
 
enum  OCTransportProtocolID { OC_INVALID_ID = (1 << 0), OC_COAP_ID = (1 << 1) }
 Transport Protocol IDs. More...
 
enum  OCStackResult {
  OC_STACK_OK = 0, OC_STACK_RESOURCE_CREATED, OC_STACK_RESOURCE_DELETED, OC_STACK_CONTINUE,
  OC_STACK_RESOURCE_CHANGED, OC_STACK_INVALID_URI = 20, OC_STACK_INVALID_QUERY, OC_STACK_INVALID_IP,
  OC_STACK_INVALID_PORT, OC_STACK_INVALID_CALLBACK, OC_STACK_INVALID_METHOD, OC_STACK_INVALID_PARAM,
  OC_STACK_INVALID_OBSERVE_PARAM, OC_STACK_NO_MEMORY, OC_STACK_COMM_ERROR, OC_STACK_TIMEOUT,
  OC_STACK_ADAPTER_NOT_ENABLED, OC_STACK_NOTIMPL, OC_STACK_NO_RESOURCE, OC_STACK_RESOURCE_ERROR,
  OC_STACK_SLOW_RESOURCE, OC_STACK_DUPLICATE_REQUEST, OC_STACK_NO_OBSERVERS, OC_STACK_OBSERVER_NOT_FOUND,
  OC_STACK_VIRTUAL_DO_NOT_HANDLE, OC_STACK_INVALID_OPTION, OC_STACK_MALFORMED_RESPONSE, OC_STACK_PERSISTENT_BUFFER_REQUIRED,
  OC_STACK_INVALID_REQUEST_HANDLE, OC_STACK_INVALID_DEVICE_INFO, OC_STACK_INVALID_JSON, OC_STACK_UNAUTHORIZED_REQ,
  OC_STACK_TOO_LARGE_REQ, OC_STACK_PDM_IS_NOT_INITIALIZED, OC_STACK_DUPLICATE_UUID, OC_STACK_INCONSISTENT_DB,
  OC_STACK_AUTHENTICATION_FAILURE, OC_STACK_NOT_ALLOWED_OXM, OC_STACK_CONTINUE_OPERATION, OC_STACK_BAD_ENDPOINT,
  OC_STACK_PRESENCE_STOPPED = 128, OC_STACK_PRESENCE_TIMEOUT, OC_STACK_PRESENCE_DO_NOT_HANDLE, OC_STACK_USER_DENIED_REQ,
  OC_STACK_NOT_ACCEPTABLE, OC_STACK_FORBIDDEN_REQ, OC_STACK_INTERNAL_SERVER_ERROR, OC_STACK_GATEWAY_TIMEOUT,
  OC_STACK_SERVICE_UNAVAILABLE, OC_STACK_ERROR = 255
}
 Declares Stack Results & Errors. More...
 
enum  OCObserveAction { OC_OBSERVE_REGISTER = 0, OC_OBSERVE_DEREGISTER = 1, OC_OBSERVE_NO_OPTION = 2 }
 Action associated with observation. More...
 
enum  OCEntityHandlerResult {
  OC_EH_OK = 0, OC_EH_ERROR, OC_EH_SLOW, OC_EH_RESOURCE_CREATED = 201,
  OC_EH_RESOURCE_DELETED = 202, OC_EH_VALID = 203, OC_EH_CHANGED = 204, OC_EH_CONTENT = 205,
  OC_EH_BAD_REQ = 400, OC_EH_UNAUTHORIZED_REQ = 401, OC_EH_BAD_OPT = 402, OC_EH_FORBIDDEN = 403,
  OC_EH_RESOURCE_NOT_FOUND = 404, OC_EH_METHOD_NOT_ALLOWED = 405, OC_EH_NOT_ACCEPTABLE = 406, OC_EH_TOO_LARGE = 413,
  OC_EH_UNSUPPORTED_MEDIA_TYPE = 415, OC_EH_INTERNAL_SERVER_ERROR = 500, OC_EH_BAD_GATEWAY = 502, OC_EH_SERVICE_UNAVAILABLE = 503,
  OC_EH_RETRANSMIT_TIMEOUT = 504
}
 Possible returned values from entity handler. More...
 
enum  OCTpsSchemeFlags { OC_NO_TPS = 0, OC_COAP = 1, OC_COAPS = (1 << 1), OC_ALL = 0xffff }
 This enum type for indicate Transport Protocol Suites. More...
 
enum  OCPayloadType {
  PAYLOAD_TYPE_INVALID, PAYLOAD_TYPE_DISCOVERY, PAYLOAD_TYPE_DEVICE, PAYLOAD_TYPE_PLATFORM,
  PAYLOAD_TYPE_REPRESENTATION, PAYLOAD_TYPE_SECURITY, PAYLOAD_TYPE_PRESENCE, PAYLOAD_TYPE_DIAGNOSTIC,
  PAYLOAD_TYPE_INTROSPECTION
}
 Enum to describe the type of object held by the OCPayload object. More...
 
enum  OCRepPayloadPropType {
  OCREP_PROP_NULL, OCREP_PROP_INT, OCREP_PROP_DOUBLE, OCREP_PROP_BOOL,
  OCREP_PROP_STRING, OCREP_PROP_BYTE_STRING, OCREP_PROP_OBJECT, OCREP_PROP_ARRAY
}
 
enum  OCEntityHandlerFlag { OC_REQUEST_FLAG = (1 << 1), OC_OBSERVE_FLAG = (1 << 2) }
 Entity's state. More...
 
enum  OCStackApplicationResult { OC_STACK_DELETE_TRANSACTION = 0, OC_STACK_KEEP_TRANSACTION }
 Possible return values from client application callback. More...
 
enum  OCPrm { DP_NOT_ALLOWED = 0x0, DP_PRE_CONFIGURED = (0x1 << 0), DP_RANDOM_PIN = (0x1 << 1) }
 direct pairing Method Type. More...
 

Detailed Description

This file contains the definition, types and APIs for resource(s) be implemented.

Macro Definition Documentation

#define COAP_OPTION_ACCEPT_VERSION   2049

TODO: Move these COAP defines to CoAP lib once approved.

#define COAP_OPTION_CONTENT_VERSION   2053
#define CT_ADAPTER_SHIFT   16

bit shift required for connectivity adapter.

#define CT_MASK_ADAPTER   0xFFFF0000

Mask Adapter.

#define CT_MASK_FLAGS   0xFFFF

Mask Flag.

#define IOTIVITY_VERSION   "1.3.1"

Version of IoTivity.

#define MAC_ADDR_BLOCKS   (6)

Blocks of MAC address.

#define MAC_ADDR_STR_SIZE   (17)

Length of MAC address.

#define MAX_ADDR_STR_SIZE   (66)

Max Device address size.

Max Address could be "coaps+tcp://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyy.yyy.yyy.yyy]:xxxxx" +1 for null terminator.

#define MAX_IDENTITY_SIZE   (37)

Max identity size.

#define MAX_REP_ARRAY_DEPTH   3
#define MAX_SEQUENCE_NUMBER   (0xFFFFFF)

Sequence number is a 24 bit field, per https://tools.ietf.org/html/rfc7641.

#define OC_DATA_MODEL_VERSION   "ocf.res.1.1.0,ocf.sh.1.1.0"

Device Data Model version.

#define OC_DEFAULT_PRESENCE_TTL_SECONDS   (60)

Sets the default time to live (TTL) for presence.

OC_DEFAULT_PRESENCE_TTL_SECONDS sets the default time to live (TTL) for presence.

#define OC_DEFAULT_PRESENCE_TTL_SECONDS   (60)

Sets the default time to live (TTL) for presence.

OC_DEFAULT_PRESENCE_TTL_SECONDS sets the default time to live (TTL) for presence.

#define OC_INTROSPECTION_FILE_NAME   "introspection.dat"

Introspection persistent store name.

#define OC_KEY_VALUE_DELIMITER   "="

Delimeter for keys and values in query string.

#define OC_MASK_FAMS   (OC_IP_USE_V6|OC_IP_USE_V4)
#define OC_MASK_MODS   (0x0FF0)

Bit mask for Mods.

#define OC_MASK_RESOURCE_SECURE   (OC_NONSECURE | OC_SECURE)
#define OC_MASK_SCOPE   (0x000F)

Bit mask for scope.

#define OC_MAX_PRESENCE_TTL_SECONDS   (60 * 60 * 24)

OC_MAX_PRESENCE_TTL_SECONDS sets the maximum time to live (TTL) for presence.

NOTE: Changing the setting to a longer duration may lead to unsupported and untested operation. 60 sec/min * 60 min/hr * 24 hr/day

#define OC_MULTICAST_DISCOVERY_URI   "/oic/res"

For multicast Discovery mechanism.

#define OC_MULTICAST_IP   "224.0.1.187"

Multicast IP address.

#define OC_MULTICAST_PORT   (5683)

Multicast Port.

#define OC_MULTICAST_PREFIX   "224.0.1.187:5683"

These provide backward compatibility - their use is deprecated.

Multicast Prefix.

#define OC_OIC_SEC   "oic.sec"
#define OC_QUERY_SEPARATOR   "&;"

Separator for multiple query string.

#define OC_RSRVD_ACCEPT   "accept"

Defines accept.

#define OC_RSRVD_ACCESS_CONTROL_LIST   "aclist"
#define OC_RSRVD_ACCESS_TOKEN   "accesstoken"

Defines access token.

#define OC_RSRVD_ACCOUNT_SEARCH_URI   "/oic/account/search"

Account user URI.

#define OC_RSRVD_ACCOUNT_SESSION_URI   "/oic/account/session"

Account session URI.

#define OC_RSRVD_ACCOUNT_TOKEN_REFRESH_URI   "/oic/account/tokenrefresh"

Account token refresh URI.

#define OC_RSRVD_ACCOUNT_URI   "/oic/account"

Cloud Account.

Account URI.

#define OC_RSRVD_ACE_ID   "aceid"
#define OC_RSRVD_ACL_GROUP_URI   "/oic/acl/group"

ACL group URI.

#define OC_RSRVD_ACL_GROUP_URL   "/oic/acl/group"
#define OC_RSRVD_ACL_ID   "aclid"
#define OC_RSRVD_ACL_ID_URL   "/oic/acl/id"
#define OC_RSRVD_ACL_INVITE_URI   "/oic/acl/invite"

ACL invite URI.

#define OC_RSRVD_ACL_INVITE_URL   "/oic/acl/invite"
#define OC_RSRVD_ACL_VERIFY_URL   "/oic/acl/verify"
#define OC_RSRVD_ADD   "add"

Defines add.

#define OC_RSRVD_AUTHCODE   "authcode"

Defines auth code.

#define OC_RSRVD_AUTHPROVIDER   "authprovider"

Defines auth provider.

#define OC_RSRVD_BASE64   "base64"
#define OC_RSRVD_BITMAP   "bm"

To represent bitmap.

#define OC_RSRVD_CACERT   "certchain"
#define OC_RSRVD_CERT   "cert"
#define OC_RSRVD_CERTIFICATE   "certificate"
#define OC_RSRVD_CONTENT_TYPE   "ct"

To represent content type.

#define OC_RSRVD_CRL   "crldata"
#define OC_RSRVD_CRL_ID   "crlid"
#define OC_RSRVD_CSR   "csr"
#define OC_RSRVD_DATA   "data"
#define OC_RSRVD_DATA_MODEL_VERSION   "dmv"

Device data model.

#define OC_RSRVD_DELETE   "delete"

Defines delete.

#define OC_RSRVD_DER   "der"
#define OC_RSRVD_DEVICE_DESCRIPTION   "ld"

Device description, localized.

#define OC_RSRVD_DEVICE_ID   "di"

Device.

Device ID.

#define OC_RSRVD_DEVICE_ID   "di"

Device.

Device ID.

#define OC_RSRVD_DEVICE_ID_LIST   "dilist"
#define OC_RSRVD_DEVICE_MFG_NAME   "dmn"

Device manufacturer name, localized.

#define OC_RSRVD_DEVICE_MODEL_NUM   "dmno"

Device model number.

#define OC_RSRVD_DEVICE_NAME   "n"

Device Name.

#define OC_RSRVD_DEVICE_PRESENCE_URI   "/oic/prs"

Presence URI through which the OIC devices advertise their device presence.

#define OC_RSRVD_DEVICE_TTL   OC_RSRVD_TTL

To indicate how long RD should publish this item.

#define OC_RSRVD_DEVICE_URI   "/oic/d"

Device URI.

#define OC_RSRVD_DREL   "drel"

Default relationship.

#define OC_RSRVD_ENCODING   "encoding"
#define OC_RSRVD_ENDPOINT   "ep"

To represent endpoint.

#define OC_RSRVD_ENDPOINTS   "eps"

To represent endpoints.

#define OC_RSRVD_EXPIRES_IN   "expiresin"
#define OC_RSRVD_FIRMWARE_VERSION   "mnfv"

Platform Firmware version.

#define OC_RSRVD_FW_VERSION   "mnfv"

To represent FW version.

#define OC_RSRVD_GATEWAY_URI   "/oic/gateway"

Gateway URI.

#define OC_RSRVD_GRANT_TYPE   "granttype"

Defines grant type.

#define OC_RSRVD_GRANT_TYPE_REFRESH_TOKEN   "refresh_token"

To represent grant type with refresh token.

#define OC_RSRVD_GROUP_ACL   "gacl"
#define OC_RSRVD_GROUP_ID   "gid"

Defines group ID.

#define OC_RSRVD_GROUP_ID   "gid"

Defines group ID.

#define OC_RSRVD_GROUP_ID_LIST   "gidlist"
#define OC_RSRVD_GROUP_MASTER_ID   "gmid"
#define OC_RSRVD_GROUP_PERMISSION   "gp"
#define OC_RSRVD_GROUP_TYPE   "gtype"
#define OC_RSRVD_GROUP_URL   "/oic/group"

Cloud ACL.

#define OC_RSRVD_HARDWARE_VERSION   "mnhw"

Platform Hardware version.

#define OC_RSRVD_HOST_NAME   "hn"

To represent host name.

#define OC_RSRVD_HOSTING_PORT   "port"

Port.

#define OC_RSRVD_HREF   "href"

To represent href.

#define OC_RSRVD_INS   "ins"

Unique value per collection/link.

#define OC_RSRVD_INSTANCE_ID   "id"

For resource instance ID.

#define OC_RSRVD_INTERFACE   "if"

To represent interface.

#define OC_RSRVD_INTERFACE_ACTUATOR   "oic.if.a"

To represent actuator interface.

#define OC_RSRVD_INTERFACE_BATCH   "oic.if.b"

To represent batch interface.

#define OC_RSRVD_INTERFACE_DEFAULT   "oic.if.baseline"

To represent default interface.

#define OC_RSRVD_INTERFACE_GROUP   "oic.mi.grp"

To represent interface group.

#define OC_RSRVD_INTERFACE_LL   "oic.if.ll"

To represent ll interface.

#define OC_RSRVD_INTERFACE_READ   "oic.if.r"

To represent read-only interface.

#define OC_RSRVD_INTERFACE_READ_WRITE   "oic.if.rw"

To represent read-write interface.

#define OC_RSRVD_INTERFACE_SENSOR   "oic.if.s"

To represent sensor interface.

#define OC_RSRVD_INTROSPECTION_CONTENT_TYPE   "content-type"

Content-Type property.

#define OC_RSRVD_INTROSPECTION_CONTENT_TYPE_VALUE   "application/cbor"

Content-Type property value.

#define OC_RSRVD_INTROSPECTION_NAME   "n"

Introspection.

Name property name(n).

#define OC_RSRVD_INTROSPECTION_NAME_VALUE   "Introspection"

Value of name.

#define OC_RSRVD_INTROSPECTION_PROTOCOL   "protocol"

Protocol property.

#define OC_RSRVD_INTROSPECTION_URL   "url"

Url property.

#define OC_RSRVD_INTROSPECTION_URL_INFO   "urlInfo"

Url info Object.

#define OC_RSRVD_INTROSPECTION_VERSION   "version"

Version property.

#define OC_RSRVD_INTROSPECTION_VERSION_VALUE   1

Version property value.

#define OC_RSRVD_INVITE   "invite"

Defines invite.

#define OC_RSRVD_INVITE   "invite"

Defines invite.

#define OC_RSRVD_INVITED   "invited"
#define OC_RSRVD_KEEPALIVE_URI   "/oic/ping"

KeepAlive URI.

#define OC_RSRVD_LAST_UPDATE   "lu"
#define OC_RSRVD_LINKS   "links"

To represent links.

#define OC_RSRVD_LOGIN   "login"

Defines login.

#define OC_RSRVD_MEDIA_TYPE   "type"

Defines media type.

#define OC_RSRVD_MEMBER_ID   "mid"

Defines member of group ID.

#define OC_RSRVD_MEMBER_ID   "mid"

Defines member of group ID.

#define OC_RSRVD_MEMBER_ID_LIST   "midlist"
#define OC_RSRVD_MEMBERS   "members"

Defines members.

#define OC_RSRVD_MFG_DATE   "mndt"

Platform MFG Date.

#define OC_RSRVD_MFG_NAME   "mnmn"

Platform MFG NAME.

#define OC_RSRVD_MFG_URL   "mnml"

Platform URL.

#define OC_RSRVD_MODEL_NUM   "mnmo"

Model Number.

#define OC_RSRVD_NEXT_UPDATE   "nu"
#define OC_RSRVD_NONCE   "non"

To represent non.

#define OC_RSRVD_OC   "oic"

Attributes used to form a proper OIC conforming JSON message.

#define OC_RSRVD_OPERATION   "op"

Defines operation.

#define OC_RSRVD_OS_VERSION   "mnos"

Platform Operating system version.

#define OC_RSRVD_OWNER   "owner"

Defines owner.

#define OC_RSRVD_OWNER_ID   "oid"
#define OC_RSRVD_PAYLOAD   "payload"

For payload.

#define OC_RSRVD_PEM   "pem"
#define OC_RSRVD_PERIOD   "period"
#define OC_RSRVD_PERMISSION_MASK   "permission"
#define OC_RSRVD_PLATFORM_ID   "pi"

Platform.

Platform ID.

#define OC_RSRVD_PLATFORM_URI   "/oic/p"

Platform URI.

#define OC_RSRVD_PLATFORM_VERSION   "mnpv"

Platform versio.n.

#define OC_RSRVD_POLICY   "p"

To represent policy.

#define OC_RSRVD_PRESENCE_URI   "/oic/ad"

Presence.

Presence URI through which the OIC devices advertise their presence.

#define OC_RSRVD_PRIORITY   "pri"

To represent priority.

#define OC_RSRVD_PROPERTY   "prop"

To represent property.

#define OC_RSRVD_PROTOCOL_INDEPENDENT_ID   "piid"

Protocol-Independent ID.

#define OC_RSRVD_PROV_CERT_URI   "/oic/credprov/cert"

Certificete Sign Request.

#define OC_RSRVD_PROV_CRL_URL   "/oic/credprov/crl"

Cloud CRL.

#define OC_RSRVD_PROXY_OPTION_ID   35

Resource URI used to discover Proxy.

#define OC_RSRVD_PROXY_URI   "/oic/chp"

Resource URI used to discover Proxy.

#define OC_RSRVD_RAW   "raw"
#define OC_RSRVD_RD_DISCOVERY_SEL   "sel"

RD Discovery bias factor type.

#define OC_RSRVD_RD_URI   "/oic/rd"

Resource Directory.

Resource Directory URI used to Discover RD and Publish resources.

#define OC_RSRVD_RECURRENCE   "recurrence"
#define OC_RSRVD_REDIRECT_URI   "redirecturi"
#define OC_RSRVD_REFRESH_TOKEN   "refreshtoken"

Defines refresh token.

#define OC_RSRVD_REL   "rel"

Defines relationship between links.

#define OC_RSRVD_REPRESENTATION   "rep"

For representation.

#define OC_RSRVD_REQUEST_METHOD   "rm"
#define OC_RSRVD_REQUEST_URI   "uri"
#define OC_RSRVD_RESOURCE_OWNER_UUID   "rowneruuid"
#define OC_RSRVD_RESOURCE_TYPE   "rt"

To represent resource type.

#define OC_RSRVD_RESOURCE_TYPE_COLLECTION   "oic.wk.col"

To represent resource type with collection.

#define OC_RSRVD_RESOURCE_TYPE_DEVICE   "oic.wk.d"

To represent resource type with device.

#define OC_RSRVD_RESOURCE_TYPE_INTROSPECTION   "oic.wk.introspection"

To represent resource type with introspection.

#define OC_RSRVD_RESOURCE_TYPE_INTROSPECTION_PAYLOAD   "oic.wk.introspection.payload"

To represent resource type with introspection payload.

#define OC_RSRVD_RESOURCE_TYPE_MAINTENANCE   "oic.wk.mnt"

To represent resource type with maintenance.

#define OC_RSRVD_RESOURCE_TYPE_MQ_BROKER   "oic.wk.ps"

To represent content type with MQ Broker.

#define OC_RSRVD_RESOURCE_TYPE_MQ_TOPIC   "oic.wk.ps.topic"

To represent content type with MQ Topic.

#define OC_RSRVD_RESOURCE_TYPE_PLATFORM   "oic.wk.p"

To represent resource type with platform.

#define OC_RSRVD_RESOURCE_TYPE_PRESENCE   "oic.wk.ad"

To represent resource type with presence.

#define OC_RSRVD_RESOURCE_TYPE_RD   "oic.wk.rd"

To represent resource type with rd.

#define OC_RSRVD_RESOURCE_TYPE_RDPUBLISH   "oic.wk.rdpub"

To represent resource type with Publish RD.

#define OC_RSRVD_RESOURCE_TYPE_RES   "oic.wk.res"

To represent resource type with RES.

#define OC_RSRVD_RESOURCE_TYPES_URI   "/oic/res/types/d"

Resource Type.

#define OC_RSRVD_RESOURCES   "resources"
#define OC_RSRVD_RTS   "rts"

Allowable resource types in the links.

#define OC_RSRVD_SEARCH   "search"

Defines search.

#define OC_RSRVD_SECURE   "sec"

For security.

#define OC_RSRVD_SERIAL_NUMBERS   "rcsn"
#define OC_RSRVD_SERVER_INSTANCE_ID   "sid"

For Server instance ID.

#define OC_RSRVD_SOFTWARE_VERSION   "sv"

Device software version.

#define OC_RSRVD_SPEC_VERSION   "icv"

Device specification version.

#define OC_RSRVD_SUBJECT_ID   "sid"
#define OC_RSRVD_SUBJECT_TYPE   "stype"
#define OC_RSRVD_SUBJECT_UUID   "subjectuuid"
#define OC_RSRVD_SUPPORT_URL   "mnsl"

Support URL for the platform.

#define OC_RSRVD_SYSTEM_TIME   "st"

System time for the platform.

#define OC_RSRVD_TCP_PORT   "x.org.iotivity.tcp"

TCP Port.

#define OC_RSRVD_THIS_UPDATE   "thisupdate"
#define OC_RSRVD_TITLE   "title"

Defines title.

#define OC_RSRVD_TLS_PORT   "x.org.iotivity.tls"

TLS Port.

#define OC_RSRVD_TOKEN_TYPE   "tokentype"
#define OC_RSRVD_TRIGGER   "trg"

To represent trigger type.

#define OC_RSRVD_TRIGGER_CHANGE   "change"

To change.

#define OC_RSRVD_TRIGGER_CREATE   "create"

Presence "Announcement Triggers".

To create.

#define OC_RSRVD_TRIGGER_DELETE   "delete"

To delete.

#define OC_RSRVD_TTL   "ttl"

To represent time to live.

#define OC_RSRVD_UNKNOWN   "unknown"
#define OC_RSRVD_URI   "anchor"

Defines URI.

#define OC_RSRVD_USER_UUID   "uid"

Defines user UUID.

#define OC_RSRVD_VALIDITY   "validity"
#define OC_RSRVD_VID   "vid"

VID for the platform.

#define OC_RSRVD_WELL_KNOWN_MQ_URI   "/oic/ps"

MQ Broker URI.

#define OC_RSRVD_WELL_KNOWN_URI   "/oic/res"

OIC Virtual resources supported by every OIC device.

Default discovery mechanism using '/oic/res' is supported by all OIC devices That are Discoverable.

#define OC_SECURITY_DB_DAT_FILE_NAME   "oic_svr_db.dat"

Security Database persistent store name(dat).

#define OC_SECURITY_DB_FILE_NAME   "oic_svr_db.json"

Security Database persistent store name(json).

#define OC_SPEC_VERSION   "ocf.1.1.0"

Device specification version.

#define OC_SPEC_VERSION_VALUE   2048

Integer value of spec version (OCF1.0 0b0000:1000:0000:0000).

#define UUID_IDENTITY_SIZE   (128/8)

Universal unique identity size.

#define WITH_PRESENCE

For the feature presence.

Typedef Documentation

This info is passed from application to OC Stack when initiating a request to Server.

typedef void(* OCClientContextDeleter)(void *context)

Client applications using a context pointer implement this callback to delete the context upon removal of the callback/context pointer from the internal callback-list.

typedef OCStackApplicationResult(* OCClientResponseHandler)(void *context, OCDoHandle handle, OCClientResponse *clientResponse)

Client applications implement this callback to consume responses received from Servers.

typedef OCEntityHandlerResult(* OCDeviceEntityHandler)(OCEntityHandlerFlag flag, OCEntityHandlerRequest *entityHandlerRequest, char *uri, void *callbackParam)

Device Entity handler need to use this call back instead of OCEntityHandler.

When you set specific return value like OC_EH_CHANGED, OC_EH_CONTENT, OC_EH_SLOW and etc in entity handler callback, ocstack will be not send response automatically to client except for error return value like OC_EH_ERROR.

If you want to send response to client with specific result, OCDoResponse API should be called with the result value.

e.g)

OCEntityHandlerResponse response;

..

response.ehResult = OC_EH_CHANGED;

..

OCDoResponse(&response)

..

return OC_EH_OK;

typedef void* OCDoHandle

Handle to an OCDoResource invocation.

typedef struct OCDPDev OCDPDev_t

Device Information of discoverd direct pairing device(s).

typedef OCEntityHandlerResult(* OCEntityHandler)(OCEntityHandlerFlag flag, OCEntityHandlerRequest *entityHandlerRequest, void *callbackParam)

Application server implementations must implement this callback to consume requests OTA.

Entity handler callback needs to fill the resPayload of the entityHandlerRequest.

When you set specific return value like OC_EH_CHANGED, OC_EH_CONTENT, OC_EH_SLOW and etc in entity handler callback, ocstack will be not send response automatically to client except for error return value like OC_EH_ERROR.

If you want to send response to client with specific result, OCDoResponse API should be called with the result value.

e.g)

OCEntityHandlerResponse response;

..

response.ehResult = OC_EH_CHANGED;

..

OCDoResponse(&response)

..

return OC_EH_OK;

This structure will be used to define the vendor specific header options to be included in communication packets.

typedef uint8_t OCObservationId

Unique identifier for each observation request.

Used when observations are registered or de-registered. Used by entity handler to signal specific observers to be notified of resource changes. There can be maximum of 256 observations per server.

typedef enum OCPrm OCPrm_t

direct pairing Method Type.

0: not allowed 1: pre-configured pin 2: random pin

typedef struct OCRepPayload OCRepPayload
typedef void* OCRequestHandle

Handle to an OCRequest object owned by the OCStack.

typedef void* OCResourceHandle

Handle to an OCResource object owned by the OCStack.

typedef struct OCStringLL OCStringLL

Enumeration Type Documentation

This enum type includes elements of both OCTransportAdapter and OCTransportFlags.

It is defined conditionally because the smaller definition limits expandability on 32/64 bit integer machines, and the larger definition won't fit into an enum on 16-bit integer machines like Arduino.

This structure must directly correspond to OCTransportAdapter and OCTransportFlags.

Enumerator
CT_DEFAULT 

use when defaults are ok.

CT_ADAPTER_IP 

IPv4 and IPv6, including 6LoWPAN.

CT_ADAPTER_GATT_BTLE 

GATT over Bluetooth LE.

CT_ADAPTER_RFCOMM_BTEDR 

RFCOMM over Bluetooth EDR.

CT_ADAPTER_TCP 

CoAP over TCP.

CT_ADAPTER_NFC 

NFC Transport.

CT_FLAG_SECURE 

Insecure transport is the default (subject to change).

secure the transport path.

CT_IP_USE_V6 

IPv4 & IPv6 autoselection is the default.

IP adapter only.

CT_IP_USE_V4 

IP adapter only.

CT_SCOPE_INTERFACE 

Link-Local multicast is the default multicast scope for IPv6.

These are placed here to correspond to the IPv6 address bits. IPv6 Interface-Local scope(loopback).

CT_SCOPE_LINK 

IPv6 Link-Local scope (default).

CT_SCOPE_REALM 

IPv6 Realm-Local scope.

CT_SCOPE_ADMIN 

IPv6 Admin-Local scope.

CT_SCOPE_SITE 

IPv6 Site-Local scope.

CT_SCOPE_ORG 

IPv6 Organization-Local scope.

CT_SCOPE_GLOBAL 

IPv6 Global scope.

Entity's state.

Enumerator
OC_REQUEST_FLAG 

Request state.

OC_OBSERVE_FLAG 

Observe state.

Possible returned values from entity handler.

Enumerator
OC_EH_OK 
OC_EH_ERROR 
OC_EH_SLOW 
OC_EH_RESOURCE_CREATED 
OC_EH_RESOURCE_DELETED 
OC_EH_VALID 
OC_EH_CHANGED 
OC_EH_CONTENT 
OC_EH_BAD_REQ 
OC_EH_UNAUTHORIZED_REQ 
OC_EH_BAD_OPT 
OC_EH_FORBIDDEN 
OC_EH_RESOURCE_NOT_FOUND 
OC_EH_METHOD_NOT_ALLOWED 
OC_EH_NOT_ACCEPTABLE 
OC_EH_TOO_LARGE 
OC_EH_UNSUPPORTED_MEDIA_TYPE 
OC_EH_INTERNAL_SERVER_ERROR 
OC_EH_BAD_GATEWAY 
OC_EH_SERVICE_UNAVAILABLE 
OC_EH_RETRANSMIT_TIMEOUT 
enum OCLogLevel

Log level to print can be controlled through this enum.

And privacy logs contained uid, Token, Device id, etc can also disable. This enum (OCLogLevel) must be kept synchronized with CAUtilLogLevel_t (in CACommon.h).

Enumerator
OC_LOG_LEVEL_ALL 
OC_LOG_LEVEL_INFO 
enum OCMethod

OCDoResource methods to dispatch the request.

Enumerator
OC_REST_NOMETHOD 
OC_REST_GET 

Read.

OC_REST_PUT 

Write.

OC_REST_POST 

Update.

OC_REST_DELETE 

Delete.

OC_REST_OBSERVE 

Register observe request for most up date notifications ONLY.

OC_REST_OBSERVE_ALL 

Register observe request for all notifications, including stale notifications.

OC_REST_PRESENCE 

Subscribe for all presence notifications of a particular resource.

OC_REST_DISCOVER 

Allows OCDoResource caller to do discovery.

enum OCMode

Host Mode of Operation.

Enumerator
OC_CLIENT 
OC_SERVER 
OC_CLIENT_SERVER 
OC_GATEWAY 

Client server mode along with routing capabilities.

Action associated with observation.

Enumerator
OC_OBSERVE_REGISTER 

To Register.

OC_OBSERVE_DEREGISTER 

To Deregister.

OC_OBSERVE_NO_OPTION 

Others.

Formats for payload encoding.

Enumerator
OC_FORMAT_CBOR 
OC_FORMAT_VND_OCF_CBOR 
OC_FORMAT_JSON 
OC_FORMAT_UNDEFINED 
OC_FORMAT_UNSUPPORTED 

Enum to describe the type of object held by the OCPayload object.

Enumerator
PAYLOAD_TYPE_INVALID 

Contents of the payload are invalid.

PAYLOAD_TYPE_DISCOVERY 

The payload is an OCDiscoveryPayload.

PAYLOAD_TYPE_DEVICE 

The payload of the device.

PAYLOAD_TYPE_PLATFORM 

The payload type of the platform.

PAYLOAD_TYPE_REPRESENTATION 

The payload is an OCRepPayload.

PAYLOAD_TYPE_SECURITY 

The payload is an OCSecurityPayload.

PAYLOAD_TYPE_PRESENCE 

The payload is an OCPresencePayload.

PAYLOAD_TYPE_DIAGNOSTIC 

The payload is an OCDiagnosticPayload.

PAYLOAD_TYPE_INTROSPECTION 

The payload is an OCIntrospectionPayload.

enum OCPrm

direct pairing Method Type.

0: not allowed 1: pre-configured pin 2: random pin

Enumerator
DP_NOT_ALLOWED 
DP_PRE_CONFIGURED 
DP_RANDOM_PIN 

Quality of Service attempts to abstract the guarantees provided by the underlying transport protocol.

The precise definitions of each quality of service level depend on the implementation. In descriptions below are for the current implementation and may changed over time.

Enumerator
OC_LOW_QOS 

Packet delivery is best effort.

OC_MEDIUM_QOS 

Packet delivery is best effort.

OC_HIGH_QOS 

Acknowledgments are used to confirm delivery.

OC_NA_QOS 

No Quality is defined, let the stack decide.

Enumerator
OCREP_PROP_NULL 
OCREP_PROP_INT 
OCREP_PROP_DOUBLE 
OCREP_PROP_BOOL 
OCREP_PROP_STRING 
OCREP_PROP_BYTE_STRING 
OCREP_PROP_OBJECT 
OCREP_PROP_ARRAY 

Resource Properties.

The value of a policy property is defined as bitmap. The LSB represents OC_DISCOVERABLE and Second LSB bit represents OC_OBSERVABLE and so on. Not including the policy property is equivalent to zero.

Enumerator
OC_RES_PROP_NONE 

When none of the bits are set, the resource is non-secure, non-discoverable & non-observable by the client.

OC_DISCOVERABLE 

When this bit is set, the resource is allowed to be discovered by clients.

OC_OBSERVABLE 

When this bit is set, the resource is allowed to be observed by clients.

OC_ACTIVE 

When this bit is set, the resource is initialized, otherwise the resource is 'inactive'.

'inactive' signifies that the resource has been marked for deletion or is already deleted.

OC_SLOW 

When this bit is set, the resource has been marked as 'slow'.

'slow' signifies that responses from this resource can expect delays in processing its requests from clients.

OC_NONSECURE 

When this bit is set, the resource supports access via non-secure endpoints.

OC_SECURE 
OC_EXPLICIT_DISCOVERABLE 

When this bit is set, the resource is allowed to be discovered only if discovery request contains an explicit querystring.

Ex: GET /oic/res?rt=oic.sec.acl

Possible return values from client application callback.

A client application callback returns an OCStackApplicationResult to indicate whether the stack should continue to keep the callback registered.

Enumerator
OC_STACK_DELETE_TRANSACTION 

Make no more calls to the callback and call the OCClientContextDeleter for this callback.

OC_STACK_KEEP_TRANSACTION 

Keep this callback registered and call it if an apropriate event occurs.

Declares Stack Results & Errors.

Enumerator
OC_STACK_OK 

Success status code - START HERE.

OC_STACK_RESOURCE_CREATED 

203, 205

OC_STACK_RESOURCE_DELETED 

201

OC_STACK_CONTINUE 

202

OC_STACK_RESOURCE_CHANGED 
OC_STACK_INVALID_URI 

204

Success status code - END HERE. Error status code - START HERE.

OC_STACK_INVALID_QUERY 
OC_STACK_INVALID_IP 

400

OC_STACK_INVALID_PORT 
OC_STACK_INVALID_CALLBACK 
OC_STACK_INVALID_METHOD 
OC_STACK_INVALID_PARAM 

405

Invalid parameter.

OC_STACK_INVALID_OBSERVE_PARAM 
OC_STACK_NO_MEMORY 
OC_STACK_COMM_ERROR 
OC_STACK_TIMEOUT 

504

OC_STACK_ADAPTER_NOT_ENABLED 
OC_STACK_NOTIMPL 
OC_STACK_NO_RESOURCE 

Resource not found.

OC_STACK_RESOURCE_ERROR 

404

e.g: not supported method or interface.

OC_STACK_SLOW_RESOURCE 
OC_STACK_DUPLICATE_REQUEST 
OC_STACK_NO_OBSERVERS 

Resource has no registered observers.

OC_STACK_OBSERVER_NOT_FOUND 
OC_STACK_VIRTUAL_DO_NOT_HANDLE 
OC_STACK_INVALID_OPTION 
OC_STACK_MALFORMED_RESPONSE 

402

The remote reply contained malformed data.

OC_STACK_PERSISTENT_BUFFER_REQUIRED 
OC_STACK_INVALID_REQUEST_HANDLE 
OC_STACK_INVALID_DEVICE_INFO 
OC_STACK_INVALID_JSON 
OC_STACK_UNAUTHORIZED_REQ 

Request is not authorized by Resource Server.

OC_STACK_TOO_LARGE_REQ 

401

OC_STACK_PDM_IS_NOT_INITIALIZED 

413

Error code from PDM

OC_STACK_DUPLICATE_UUID 
OC_STACK_INCONSISTENT_DB 
OC_STACK_AUTHENTICATION_FAILURE 

Error code from OTM This error is pushed from DTLS interface when handshake failure happens.

OC_STACK_NOT_ALLOWED_OXM 
OC_STACK_CONTINUE_OPERATION 
OC_STACK_BAD_ENDPOINT 

Request come from endpoint which is not mapped to the resource.

OC_STACK_PRESENCE_STOPPED 

Insert all new error codes here!.

OC_STACK_PRESENCE_TIMEOUT 
OC_STACK_PRESENCE_DO_NOT_HANDLE 
OC_STACK_USER_DENIED_REQ 

Request is denied by the user.

OC_STACK_NOT_ACCEPTABLE 
OC_STACK_FORBIDDEN_REQ 

406

ERROR code from server

OC_STACK_INTERNAL_SERVER_ERROR 

403

OC_STACK_GATEWAY_TIMEOUT 

500

OC_STACK_SERVICE_UNAVAILABLE 

504

OC_STACK_ERROR 

503

ERROR in stack.

This enum type for indicate Transport Protocol Suites.

Enumerator
OC_NO_TPS 

For initialize.

OC_COAP 

coap + udp

OC_COAPS 

coaps + udp

OC_ALL 

Allow all endpoint.

These enums (OCTransportAdapter and OCTransportFlags) must be kept synchronized with OCConnectivityType (below) as well as CATransportAdapter and CATransportFlags (in CACommon.h).

Enumerator
OC_DEFAULT_ADAPTER 

value zero indicates discovery.

OC_ADAPTER_IP 

IPv4 and IPv6, including 6LoWPAN.

OC_ADAPTER_GATT_BTLE 

GATT over Bluetooth LE.

OC_ADAPTER_RFCOMM_BTEDR 

RFCOMM over Bluetooth EDR.

OC_ADAPTER_TCP 

CoAP over TCP.

OC_ADAPTER_NFC 

NFC Transport for Messaging.

Enumerator
OC_DEFAULT_BT_FLAGS 

default flag is 0.

OC_LE_ADV_DISABLE 

disable BLE advertisement.

OC_LE_ADV_ENABLE 

enable BLE advertisement.

OC_LE_SERVER_DISABLE 

disable gatt server.

OC_EDR_SERVER_DISABLE 

disable rfcomm server.

Enum layout assumes some targets have 16-bit integer (e.g., Arduino).

Enumerator
OC_DEFAULT_FLAGS 

default flag is 0

OC_FLAG_SECURE 

Insecure transport is the default (subject to change).

secure the transport path

OC_IP_USE_V6 

IPv4 & IPv6 auto-selection is the default.

IP & TCP adapter only.

OC_IP_USE_V4 

IP & TCP adapter only.

OC_MULTICAST 

Multicast only.

OC_SCOPE_INTERFACE 

Link-Local multicast is the default multicast scope for IPv6.

These are placed here to correspond to the IPv6 multicast address bits. IPv6 Interface-Local scope (loopback).

OC_SCOPE_LINK 

IPv6 Link-Local scope (default).

OC_SCOPE_REALM 

IPv6 Realm-Local scope.

OC_SCOPE_ADMIN 

IPv6 Admin-Local scope.

OC_SCOPE_SITE 

IPv6 Site-Local scope.

OC_SCOPE_ORG 

IPv6 Organization-Local scope.

OC_SCOPE_GLOBAL 

IPv6 Global scope.

Transport Protocol IDs.

Enumerator
OC_INVALID_ID 

For invalid ID.

OC_COAP_ID