/** Gateway URI.*/
#define OC_RSRVD_GATEWAY_URI "/oic/gateway"
#endif
+
+#ifdef WITH_MQ
+/** MQ Broker URI.*/
+#define OC_RSRVD_WELL_KNOWN_MQ_URI "/.well-known/ocf/ps"
+#endif
+
#ifdef WITH_PRESENCE
/** Presence URI through which the OIC devices advertise their presence.*/
#define OC_RSRVD_PRESENCE_URI "/oic/ad"
+#ifdef WITH_CLOUD
+/** Presence URI through which the OCF devices advertise their device presence.*/
+#define OCF_RSRVD_DEVICE_PRESENCE_URI "/.well-known/ocf/prs"
+#endif
+
/** Sets the default time to live (TTL) for presence.*/
#define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
/** To represent resource type with RES.*/
#define OC_RSRVD_RESOURCE_TYPE_RES "oic.wk.res"
+#ifdef WITH_MQ
+/** To represent content type with MQ Broker.*/
+#define OC_RSRVD_RESOURCE_TYPE_MQ_BROKER "ocf.wk.ps"
+
+/** To represent content type with MQ Topic.*/
+#define OC_RSRVD_RESOURCE_TYPE_MQ_TOPIC "ocf.wk.ps.topic"
+#endif
+
/** To represent interface.*/
#define OC_RSRVD_INTERFACE "if"
#ifdef RA_ADAPTER
#define MAX_ADDR_STR_SIZE (256)
#else
-/** Max Address could be "coap+tcp://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:xxxxx" */
-#define MAX_ADDR_STR_SIZE (59)
+/** Max Address could be
+ * "coaps+tcp://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyy.yyy.yyy.yyy]:xxxxx"
+ * +1 for null terminator.
+ */
+#define MAX_ADDR_STR_SIZE (66)
#endif
/** Length of MAC address */
/** To represent resource type with Publish RD.*/
#define OC_RSRVD_RESOURCE_TYPE_RDPUBLISH "oic.wk.rdpub"
+/** Cloud Account */
+
+/** Account URI.*/
+#define OC_RSRVD_ACCOUNT_URI "/.well-known/ocf/account"
+
+/** Account session URI.*/
+#define OC_RSRVD_ACCOUNT_SESSION_URI "/.well-known/ocf/account/session"
+
+/** Account token refresh URI.*/
+#define OC_RSRVD_ACCOUNT_TOKEN_REFRESH_URI "/.well-known/ocf/account/tokenrefresh"
+
+/** Defines auth provider. */
+#define OC_RSRVD_AUTHPROVIDER "authprovider"
+
+/** Defines auth code. */
+#define OC_RSRVD_AUTHCODE "authcode"
+
+/** Defines session. */
+#define OC_RSRVD_ACCESS_TOKEN "accesstoken"
+
+/** Defines status. */
+#define OC_RSRVD_STATUS "status"
+
+/** Defines grant type. */
+#define OC_RSRVD_GRANT_TYPE "granttype"
+
+/** Defines refresh token. */
+#define OC_RSRVD_REFRESH_TOKEN "refreshtoken"
+
+/** To represent grant type with refresh token. */
+#define OC_RSRVD_GRANT_TYPE_REFRESH_TOKEN "refresh_token"
+
/**
* Mark a parameter as unused. Used to prevent unused variable compiler warnings.
* Used in three cases:
/** IP & TCP adapter only.*/
OC_IP_USE_V4 = (1 << 6),
- /** internal use only.*/
- OC_RESERVED1 = (1 << 7), // internal use only
+ /** Multicast only.*/
+ OC_MULTICAST = (1 << 7),
/** Link-Local multicast is the default multicast scope for IPv6.
* These are placed here to correspond to the IPv6 multicast address bits.*/
char addr[MAX_ADDR_STR_SIZE];
/** usually zero for default interface.*/
- uint32_t interface;
+ uint32_t ifindex;
#if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
char routeData[MAX_ADDR_STR_SIZE]; //destination GatewayID:ClientId
#endif
* processing its requests from clients.*/
OC_SLOW = (1 << 3),
+#ifdef __WITH_DTLS__
/** When this bit is set, the resource is a secure resource.*/
OC_SECURE = (1 << 4),
+#else
+ OC_SECURE = (0),
+#endif
/** 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 */
OC_EXPLICIT_DISCOVERABLE = (1 << 5)
+
+#ifdef WITH_MQ
+ /** When this bit is set, the resource is allowed to be published */
+ ,OC_MQ_PUBLISHER = (1 << 6)
+#endif
+
+#ifdef MQ_BROKER
+ /** When this bit is set, the resource is allowed to be notified as MQ broker.*/
+ ,OC_MQ_BROKER = (1 << 7)
+#endif
} OCResourceProperty;
/**
OC_STACK_RESOURCE_CREATED,
OC_STACK_RESOURCE_DELETED,
OC_STACK_CONTINUE,
+ OC_STACK_RESOURCE_CHANGED,
/** Success status code - END HERE.*/
/** Error status code - START HERE.*/
OC_OBSERVE_DEREGISTER = 1,
/** Others. */
- OC_OBSERVE_NO_OPTION = 2
+ OC_OBSERVE_NO_OPTION = 2,
+
+//#ifdef WITH_MQ
+ OC_MQ_SUBSCRIBER = 3,
+
+ OC_MQ_UNSUBSCRIBER = 4,
+//#endif
+
} OCObserveAction;
{
OC_EH_OK = 0,
OC_EH_ERROR,
- OC_EH_RESOURCE_CREATED,
- OC_EH_RESOURCE_DELETED,
- OC_EH_SLOW,
- OC_EH_FORBIDDEN,
- OC_EH_RESOURCE_NOT_FOUND
+ OC_EH_RESOURCE_CREATED, // 2.01
+ OC_EH_RESOURCE_DELETED, // 2.02
+ OC_EH_SLOW, // 2.05
+ OC_EH_FORBIDDEN, // 4.03
+ OC_EH_RESOURCE_NOT_FOUND, // 4.04
+ OC_EH_VALID, // 2.03
+ OC_EH_CHANGED, // 2.04
+ OC_EH_CONTENT, // 2.05
+ OC_EH_BAD_REQ, // 4.00
+ OC_EH_UNAUTHORIZED_REQ, // 4.01
+ OC_EH_BAD_OPT, // 4.02
+ OC_EH_METHOD_NOT_ALLOWED, // 4.05
+ OC_EH_NOT_ACCEPTABLE, // 4.06
+ OC_EH_INTERNAL_SERVER_ERROR, // 5.00
+ OC_EH_RETRANSMIT_TIMEOUT // 5.04
} OCEntityHandlerResult;
/**
OCStringLL *types;
/** Pointer to the device specification version.*/
char *specVersion;
- /** Pointer to the device data model version.*/
- char *dataModelVersion;
+ /** Pointer to the device data model versions (in CSV format).*/
+ OCStringLL *dataModelVersions;
} OCDeviceInfo;
#ifdef RA_ADAPTER
struct OCResourceCollectionPayload *next;
} OCResourceCollectionPayload;
-typedef struct
+typedef struct OCDiscoveryPayload
{
OCPayload base;
char *uri;
/** Resource Type */
- char *type;
+ OCStringLL *type;
/** Interface */
- OCStringLL *interface;
+ OCStringLL *iface;
/** This structure holds the old /oic/res response. */
OCResourcePayload *resources;
+ /** Holding address of the next DiscoveryPayload. */
+ struct OCDiscoveryPayload *next;
+
} OCDiscoveryPayload;
/**
char *sid;
char* deviceName;
char* specVersion;
- char* dataModelVersion;
+ OCStringLL *dataModelVersions;
OCStringLL *interfaces;
OCStringLL *types;
} OCDevicePayload;
/** Pointer to the array of the received vendor specific header options.*/
OCHeaderOption * rcvdVendorSpecificHeaderOptions;
+ /** Message id.*/
+ uint16_t messageID;
+
/** the payload from the request PDU.*/
OCPayload *payload;