#include "ocstack.h"
#include "ocstackconfig.h"
#include "occlientcb.h"
-#include <logger.h>
#include <ocrandom.h>
#include "cacommon.h"
#include "cainterface.h"
+#include "securevirtualresourcetypes.h"
#ifdef __cplusplus
extern "C" {
/** The coap scheme */
#define OC_COAP_SCHEME "coap://"
-/** the first outgoing sequence number will be 5*/
-#define OC_OFFSET_SEQUENCE_NUMBER (4)
+/** the first outgoing sequence number will be 2*/
+#define OC_OFFSET_SEQUENCE_NUMBER (1)
/**
* This structure will be created in occoap and passed up the stack on the server side.
/** The REST method retrieved from received request PDU.*/
OCMethod method;
+ /** the requested payload format. */
+ OCPayloadFormat acceptFormat;
+
/** resourceUrl will be filled in occoap using the path options in received request PDU.*/
char resourceUrl[MAX_URI_LENGTH];
OCStackResult SendDirectStackResponse(const CAEndpoint_t* endPoint, const uint16_t coapID,
const CAResponseResult_t responseResult, const CAMessageType_t type,
const uint8_t numOptions, const CAHeaderOption_t *options,
- CAToken_t token, uint8_t tokenLength);
+ CAToken_t token, uint8_t tokenLength, const char *resourceUri);
#ifdef WITH_PRESENCE
OCStackResult CAResultToOCResult(CAResult_t caResult);
/**
- * Get a byte representation of the server instance ID.
- * The memory is managed internal to this function, so freeing it externally will
- * result in a runtime error.
- *
- * Note: This will NOT seed the RNG, so it must be called after the RNG is seeded.
- * This is done automatically during the OCInit process,
- * so ensure that this call is done after that.
- *
- * @return A uint8_t representation the server instance ID.
- */
-const uint8_t* OCGetServerInstanceID(void);
-
-/**
- * Get a string representation the server instance ID.
- * The memory is managed internal to this function, so freeing externally will result
- * in a runtime error.
- * Note: This will NOT seed the RNG, so it must be called after the RNG is seeded.
- * This is done automatically during the OCInit process,
- * so ensure that this call is done after that.
+ * Converts a OCStackResult type to a bool type.
*
- * @return A string representation the server instance ID.
+ * @param ocResult OCStackResult value to convert.
+ * @return true on success, false upon failure.
*/
-const char* OCGetServerInstanceIDString(void);
+bool OCResultToSuccess(OCStackResult ocResult);
/**
* Map OCQualityOfService to CAMessageType.
OCResourceProperty resourceProperties, uint8_t enable);
#endif
-const char *convertTriggerEnumToString(OCPresenceTrigger trigger);
+OC_EXPORT const char *convertTriggerEnumToString(OCPresenceTrigger trigger);
-OCPresenceTrigger convertTriggerStringToEnum(const char * triggerStr);
+OC_EXPORT OCPresenceTrigger convertTriggerStringToEnum(const char * triggerStr);
void CopyEndpointToDevAddr(const CAEndpoint_t *in, OCDevAddr *out);
#endif // __cplusplus
#endif /* OCSTACKINTERNAL_H_ */
-