X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=resource%2Fcsdk%2Fstack%2Finclude%2Focpayload.h;h=204af4fefd89e3dea8ffc9fd9c1941c04da5644e;hb=edcfc3d2329da7b914771c0dcff5f42c9b74fd93;hp=95ff3cba1eb0340bfc78acb0e8c425e6ea5fe11d;hpb=495ebf2780c41444fe332c4af44de20c7e826b44;p=platform%2Fupstream%2Fiotivity.git diff --git a/resource/csdk/stack/include/ocpayload.h b/resource/csdk/stack/include/ocpayload.h index 95ff3cb..204af4f 100644 --- a/resource/csdk/stack/include/ocpayload.h +++ b/resource/csdk/stack/include/ocpayload.h @@ -27,11 +27,12 @@ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS #endif + #include #include #include "octypes.h" -#ifdef __WITH_TLS__ +#if defined(__WITH_TLS__) || defined(__WITH_DTLS__) #include "securevirtualresourcetypes.h" #endif @@ -73,6 +74,8 @@ size_t calcDimTotal(const size_t dimensions[MAX_REP_ARRAY_DEPTH]); OCRepPayload* OCRepPayloadClone(const OCRepPayload* payload); +OCRepPayload* OCRepPayloadBatchClone(const OCRepPayload* repPayload); + void OCRepPayloadAppend(OCRepPayload* parent, OCRepPayload* child); bool OCRepPayloadSetUri(OCRepPayload* payload, const char* uri); @@ -248,17 +251,6 @@ OCResourcePayload* OCDiscoveryPayloadGetResource(OCDiscoveryPayload* payload, si void OCDiscoveryResourceDestroy(OCResourcePayload* payload); void OCDiscoveryPayloadDestroy(OCDiscoveryPayload* payload); -// Device Payload -OCDevicePayload* OCDevicePayloadCreate(const char* sid, const char* dname, - const OCStringLL *types, const char* specVer, const char* dmVer); -void OCDevicePayloadDestroy(OCDevicePayload* payload); - -// Platform Payload -OCPlatformPayload* OCPlatformPayloadCreate(const OCPlatformInfo* platformInfo); -OCPlatformPayload* OCPlatformPayloadCreateAsOwner(OCPlatformInfo* platformInfo); -void OCPlatformInfoDestroy(OCPlatformInfo *info); -void OCPlatformPayloadDestroy(OCPlatformPayload* payload); - // Presence Payload OCPresencePayload* OCPresencePayloadCreate(uint32_t seqNum, uint32_t maxAge, OCPresenceTrigger trigger, const char* resourceType); @@ -279,11 +271,19 @@ OCStringLL* OCCreateOCStringLL(const char* text); /** * This function creates a string from a list (with separated contents if several) * @param ll Pointer to list - * @return newly allocated string + * @return newly allocated string. Caller takes ownership and must later free this memory with OICFree. * @note separator is ',' (according to rfc4180) **/ char* OCCreateString(const OCStringLL* ll); +/** + * This function copies contents (and allocates if necessary) + * @param dest existing bytestring (or null to allocate here) + * @param source existing bytestring + * @return true of success false on any errors + **/ +bool OCByteStringCopy(OCByteString *dest, const OCByteString *source); + #ifdef __cplusplus } #endif