/** Resource Type.*/
#define OC_RSRVD_RESOURCE_TYPES_URI "/oic/res/types/d"
-#if defined (ROUTING_GATEWAY) || defined (ROUTING_EP)
+
/** Gateway URI.*/
#define OC_RSRVD_GATEWAY_URI "/oic/gateway"
-#endif
-#ifdef WITH_PRESENCE
+
+/** MQ Broker URI.*/
+#define OC_RSRVD_WELL_KNOWN_MQ_URI "/oic/ps"
+
+
+/** Presence */
/** Presence URI through which the OIC devices advertise their presence.*/
#define OC_RSRVD_PRESENCE_URI "/oic/ad"
+/** Presence URI through which the OIC devices advertise their device presence.*/
+#define OC_RSRVD_DEVICE_PRESENCE_URI "/oic/prs"
+
/** Sets the default time to live (TTL) for presence.*/
-#define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
+#define OC_DEFAULT_PRESENCE_TTL_SECONDS (60)
/** For multicast Discovery mechanism.*/
-#define OC_MULTICAST_DISCOVERY_URI "/oic/res"
+#define OC_MULTICAST_DISCOVERY_URI "/oic/res"
/** Separator for multiple query string.*/
-#define OC_QUERY_SEPARATOR "&;"
+#define OC_QUERY_SEPARATOR "&;"
/**
* OC_DEFAULT_PRESENCE_TTL_SECONDS sets the default time to live (TTL) for presence.
* 60 sec/min * 60 min/hr * 24 hr/day
*/
#define OC_MAX_PRESENCE_TTL_SECONDS (60 * 60 * 24)
-#endif
+
/**
* Presence "Announcement Triggers".
#define OC_RSRVD_OC "oic"
+
/** For payload. */
#define OC_RSRVD_PAYLOAD "payload"
#define OC_RSRVD_RESOURCE_TYPE_PLATFORM "oic.wk.p"
/** To represent resource type with RES.*/
-#define OC_RSRVD_RESOURCE_TYPE_RES "oic.wk.res"
+#define OC_RSRVD_RESOURCE_TYPE_RES "oic.wk.res"
+
+/** To represent content type with MQ Broker.*/
+#define OC_RSRVD_RESOURCE_TYPE_MQ_BROKER "oic.wk.ps"
+
+/** To represent content type with MQ Topic.*/
+#define OC_RSRVD_RESOURCE_TYPE_MQ_TOPIC "oic.wk.ps.topic"
+
/** To represent interface.*/
#define OC_RSRVD_INTERFACE "if"
+/** To indicate how long RD should publish this item.*/
+#define OC_RSRVD_DEVICE_TTL "lt"
+
/** To represent time to live.*/
#define OC_RSRVD_TTL "ttl"
#define OC_RSRVD_HOSTING_PORT "port"
/** TCP Port. */
-#define OC_RSRVD_TCP_PORT "tcp"
+#define OC_RSRVD_TCP_PORT "x.org.iotivity.tcp"
/** For Server instance ID.*/
#define OC_RSRVD_SERVER_INSTANCE_ID "sid"
#define OC_RSRVD_SUPPORT_URL "mnsl"
/** System time for the platform. */
-#define OC_RSRVD_SYSTEM_TIME "st"
+#define OC_RSRVD_SYSTEM_TIME "st"
/**
* Device.
#define OC_RSRVD_DATA_MODEL_VERSION "dmv"
/** Device specification version.*/
-#define OC_SPEC_VERSION "core.1.0.0"
+#define OC_SPEC_VERSION "core.1.0.0"
/** Device Data Model version.*/
-#define OC_DATA_MODEL_VERSION "res.1.0.0"
+#define OC_DATA_MODEL_VERSION "res.1.0.0"
/**
* These provide backward compatibility - their use is deprecated.
#ifndef GOING_AWAY
/** Multicast Prefix.*/
-#define OC_MULTICAST_PREFIX "224.0.1.187:5683"
+#define OC_MULTICAST_PREFIX "224.0.1.187:5683"
/** Multicast IP address.*/
-#define OC_MULTICAST_IP "224.0.1.187"
+#define OC_MULTICAST_IP "224.0.1.187"
/** Multicast Port.*/
-#define OC_MULTICAST_PORT 5683
+#define OC_MULTICAST_PORT (5683)
#endif // GOING_AWAY
/** Max Device address size. */
#define MAX_ADDR_STR_SIZE (256)
#else
/** Max Address could be
- * "coap+tcp://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyy.yyy.yyy.yyy]:xxxxx"
+ * "coaps+tcp://[xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:yyy.yyy.yyy.yyy]:xxxxx"
* +1 for null terminator.
*/
-#define MAX_ADDR_STR_SIZE (65)
+#define MAX_ADDR_STR_SIZE (66)
#endif
/** Length of MAC address */
#define MAC_ADDR_BLOCKS (6)
/** Max identity size. */
-#define MAX_IDENTITY_SIZE (32)
+#define MAX_IDENTITY_SIZE (37)
/** Universal unique identity size. */
#define UUID_IDENTITY_SIZE (128/8)
#define OC_RSRVD_TITLE "title"
/** Defines URI. */
-#define OC_RSRVD_URI "uri"
+#define OC_RSRVD_URI "anchor"
/** Defines media type. */
-#define OC_RSRVD_MEDIA_TYPE "mt"
+#define OC_RSRVD_MEDIA_TYPE "type"
/** 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"
+#define OC_RSRVD_ACCOUNT_URI "/oic/account"
/** Account session URI.*/
-#define OC_RSRVD_ACCOUNT_SESSION_URI "/.well-known/ocf/account/session"
+#define OC_RSRVD_ACCOUNT_SESSION_URI "/oic/account/session"
/** Account token refresh URI.*/
-#define OC_RSRVD_ACCOUNT_TOKEN_REFRESH_URI "/.well-known/ocf/account/tokenrefresh"
+#define OC_RSRVD_ACCOUNT_TOKEN_REFRESH_URI "/oic/account/tokenrefresh"
+
+/** ACL group URI.*/
+#define OC_RSRVD_ACL_GROUP_URI "/oic/acl/group"
+
+/** ACL invite URI.*/
+#define OC_RSRVD_ACL_INVITE_URI "/oic/acl/invite"
/** Defines auth provider. */
#define OC_RSRVD_AUTHPROVIDER "authprovider"
/** Defines auth code. */
#define OC_RSRVD_AUTHCODE "authcode"
-/** Defines session. */
+/** Defines access token. */
#define OC_RSRVD_ACCESS_TOKEN "accesstoken"
-/** Defines status. */
-#define OC_RSRVD_STATUS "status"
+/** Defines login. */
+#define OC_RSRVD_LOGIN "login"
+
+/** Defines search. */
+#define OC_RSRVD_SEARCH "search"
/** Defines grant type. */
#define OC_RSRVD_GRANT_TYPE "granttype"
/** Defines refresh token. */
#define OC_RSRVD_REFRESH_TOKEN "refreshtoken"
+/** Defines user UUID. */
+#define OC_RSRVD_USER_UUID "uid"
+
+/** Defines user ID. */
+#define OC_RSRVD_USER_ID "userid"
+
+/** Defines group ID. */
+#define OC_RSRVD_GROUP_ID "gid"
+
+/** Defines group Master ID. */
+#define OC_RSRVD_GROUP_MASTER_ID "gmid"
+
+/** Defines group type. */
+#define OC_RSRVD_GROUP_TYPE "gtype"
+
+/** Defines member of group ID. */
+#define OC_RSRVD_MEMBER_ID "mid"
+
+/** Defines device ID list. */
+#define OC_RSRVD_DEVICE_ID_LIST "dilist"
+
+/** Defines public. */
+#define OC_RSRVD_PUBLIC "Public"
+
+/** Defines private. */
+#define OC_RSRVD_PRIVATE "Private"
+
+/** Defines options. */
+#define OC_RSRVD_INVITE "invite"
+
+/** Defines options. */
+#define OC_RSRVD_OPTIONS "options"
+
/** To represent grant type with refresh token. */
#define OC_RSRVD_GRANT_TYPE_REFRESH_TOKEN "refresh_token"
/** 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),
+ 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),
+ ,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),
+ ,OC_MQ_BROKER = (1 << 7)
#endif
} OCResourceProperty;
OC_OBSERVE_DEREGISTER = 1,
/** Others. */
- OC_OBSERVE_NO_OPTION = 2
+ OC_OBSERVE_NO_OPTION = 2,
+
} OCObserveAction;
{
/** This is the target relative URI. */
char *href;
+ /** The relation of the target URI referenced by the link to the context URI;
+ * The default value is null. */
+ char *rel;
/** Resource Type - A standard OIC specified or vendor defined resource
* type of the resource referenced by the target URI. */
OCStringLL *rt;
/** Interface - The interfaces supported by the resource referenced by the target URI. */
OCStringLL *itf;
- /** The relation of the target URI referenced by the link to the context URI;
- * The default value is null. */
- char *rel;
- /** Specifies if the resource referenced by the target URIis observable or not. */
- bool obs;
+ /** Bitmap - The bitmap holds observable, discoverable, secure option flag. */
+ uint8_t p;
/** A title for the link relation. Can be used by the UI to provide a context. */
char *title;
/** This is used to override the context URI e.g. override the URI of the containing collection. */
- char *uri;
+ char *anchor;
/** The instance identifier for this web link in an array of web links - used in links. */
union
{
/** Use UUID for universal uniqueness - used in /oic/res to identify the device. */
OCIdentity uniqueUUID;
};
+ /** Time to keep holding resource.*/
+ uint64_t ttl;
/** A hint of the media type of the representation of the resource referenced by the target URI. */
- OCStringLL *mt;
+ OCStringLL *type;
/** Holding address of the next resource. */
struct OCLinksPayload *next;
} OCLinksPayload;
OCDeviceInfo n;
/** Device identifier. */
OCIdentity di;
- /** The base URI where the resources are hold. */
- char *baseURI;
- /** Bitmap holds observable, discoverable, secure option flag.*/
- uint8_t bitmap;
- /** Port set in case, the secure flag is set above. */
- uint16_t port;
- /** Id for each set of links i.e. tag. */
- union
- {
- /** An ordinal number that is not repeated - must be unique in the collection context. */
- uint8_t ins;
- /** Any unique string including a URI. */
- char *uniqueStr;
- /** Use UUID for universal uniqueness - used in /oic/res to identify the device. */
- OCIdentity uniqueUUID;
- };
- /** Defines the list of allowable resource types (for Target and anchors) in links included
- * in the collection; new links being created can only be from this list. */
- char *rts;
- /** When specified this is the default relationship to use when an OIC Link does not specify
- * an explicit relationship with *rel* parameter. */
- char *drel;
/** Time to keep holding resource.*/
- uint32_t ttl;
+ uint64_t ttl;
} OCTagsPayload;
/** Resource collection payload. */
OCTagsPayload *tags;
/** Array of links payload. */
OCLinksPayload *setLinks;
- /** Holding address of the next resource. */
- struct OCResourceCollectionPayload *next;
} OCResourceCollectionPayload;
typedef struct OCDiscoveryPayload
/**
* 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;
*/
typedef OCEntityHandlerResult (*OCEntityHandler)
(OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest, 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 OCEntityHandlerResult (*OCDeviceEntityHandler)
(OCEntityHandlerFlag flag, OCEntityHandlerRequest * entityHandlerRequest, char* uri, void* callbackParam);