extern "C" {
#endif // __cplusplus
-/** For the feature presence.*/
-#define WITH_PRESENCE
-
#include "ocpresence.h"
// TODO : need for secure psi
/** KeepAlive URI.*/
#define OC_RSRVD_KEEPALIVE_URI "/oic/ping"
-#ifdef WITH_PRESENCE
-/** 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"
-#endif // WITH_PRESENCE
-
/** For multicast Discovery mechanism.*/
#define OC_MULTICAST_DISCOVERY_URI "/oic/res"
/** Separator for multiple query string.*/
#define OC_QUERY_SEPARATOR "&;"
-#ifdef WITH_PRESENCE
/**
* OC_DEFAULT_PRESENCE_TTL_SECONDS sets the default time to live (TTL) for presence.
*/
/** To delete.*/
#define OC_RSRVD_TRIGGER_DELETE "delete"
-#endif // WITH_PRESENCE
-
/**
* Attributes used to form a proper OIC conforming JSON message.
*/
/** To represent resource type.*/
#define OC_RSRVD_RESOURCE_TYPE "rt"
-#ifdef WITH_PRESENCE
/** To represent resource type with presence.*/
#define OC_RSRVD_RESOURCE_TYPE_PRESENCE "oic.wk.ad"
-#endif
/** To represent resource type with device.*/
#define OC_RSRVD_RESOURCE_TYPE_DEVICE "oic.wk.d"
/** Register observe request for all notifications, including stale notifications.*/
OC_REST_OBSERVE_ALL = (1 << 5),
-#ifdef WITH_PRESENCE
/** Subscribe for all presence notifications of a particular resource.*/
OC_REST_PRESENCE = (1 << 7),
-#endif
/** Allows OCDoResource caller to do discovery.*/
OC_REST_DISCOVER = (1 << 8)
} OCMethod;
OC_STACK_NOT_ALLOWED_OXM,
/** Insert all new error codes here!.*/
-#ifdef WITH_PRESENCE
OC_STACK_PRESENCE_STOPPED = 128,
OC_STACK_PRESENCE_TIMEOUT,
OC_STACK_PRESENCE_DO_NOT_HANDLE,
-#endif
/** Request is denied by the user*/
OC_STACK_USER_DENIED_REQ,
/** ERROR code from server */
OC_STACK_FORBIDDEN_REQ, /** 403*/
+ OC_STACK_TOO_MANY_REQUESTS, /** 429*/
OC_STACK_INTERNAL_SERVER_ERROR, /** 500*/
OC_STACK_NOT_IMPLEMENTED, /** 501*/
OC_STACK_BAD_GATEWAY, /** 502*/
OC_EH_NOT_ACCEPTABLE = 406,
OC_EH_TOO_LARGE = 413,
OC_EH_UNSUPPORTED_MEDIA_TYPE = 415,
+ OC_EH_TOO_MANY_REQUESTS = 429,
OC_EH_INTERNAL_SERVER_ERROR = 500,
OC_EH_NOT_IMPLEMENTED = 501,
OC_EH_BAD_GATEWAY = 502,
PAYLOAD_TYPE_REPRESENTATION,
/** The payload is an OCSecurityPayload */
PAYLOAD_TYPE_SECURITY,
-#ifdef WITH_PRESENCE
/** The payload is an OCPresencePayload */
PAYLOAD_TYPE_PRESENCE
-#endif
} OCPayloadType;
/**
size_t payloadSize;
} OCSecurityPayload;
-#ifdef WITH_PRESENCE
typedef struct
{
OCPayload base;
OCPresenceTrigger trigger;
char* resourceType;
} OCPresencePayload;
-#endif
/**
* Incoming requests handled by the server. Requests are passed in as a parameter to the