From: Sashi Penta Date: Wed, 3 Sep 2014 04:10:52 +0000 (-0700) Subject: Fixed a minor bug in C stack and minor cleanup from Presence Notification. X-Git-Tag: 1.2.0+RC1~2284 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3fd29a8d4a024d854cbd8ebaca2309e0f2d642a3;p=platform%2Fupstream%2Fiotivity.git Fixed a minor bug in C stack and minor cleanup from Presence Notification. Release notes from Sudarhan, with minor comments from Sashi. OCPlatform.h with better comments from Sudarshan. Change-Id: Ie1950b6d3486e3a2314ac7428350f61bba20351f --- diff --git a/csdk/occoap/src/occoap.c b/csdk/occoap/src/occoap.c index c74932a..018d840 100644 --- a/csdk/occoap/src/occoap.c +++ b/csdk/occoap/src/occoap.c @@ -197,12 +197,6 @@ static void HandleCoAPRequests(struct coap_context_t *ctx, { case OC_STACK_OK: observeOption = rcvdObsReq->option; - /* - OCStackResult FormOptionList(coap_list_t * * optListLoc, uint8_t * addMediaType, - uint32_t * addMaxAge, uint8_t observeOptionLength, uint8_t * observeOptionPtr, - uint16_t * addPortNumber, uint8_t uriLength, unsigned char * uri, - uint8_t queryLength, unsigned char * query) - */ result = FormOptionList(&optList, &mediaType, &maxAge, 0, NULL, NULL, 0, NULL, 0, NULL); break; diff --git a/csdk/stack/include/internal/occlientcb.h b/csdk/stack/include/internal/occlientcb.h index cf236a2..17ccada 100644 --- a/csdk/stack/include/internal/occlientcb.h +++ b/csdk/stack/include/internal/occlientcb.h @@ -25,9 +25,6 @@ #include #include -// TODO platform independence (for time_t) -#include - typedef struct OCPresence { // This is the TTL associated with presence uint32_t TTL; diff --git a/csdk/stack/src/occlientcb.c b/csdk/stack/src/occlientcb.c index cc4b283..9843513 100644 --- a/csdk/stack/src/occlientcb.c +++ b/csdk/stack/src/occlientcb.c @@ -61,8 +61,10 @@ void DeleteClientCB(ClientCB * cbNode) { OCFree(cbNode->handle); OCFree(cbNode->requestUri); #ifdef WITH_PRESENCE - OCFree(cbNode->presence->timeOut); - OCFree(cbNode->presence); + if(cbNode->presence) { + OCFree(cbNode->presence->timeOut); + OCFree(cbNode->presence); + } #endif OCFree(cbNode); cbNode = NULL; diff --git a/csdk/stack/src/ocobserve.c b/csdk/stack/src/ocobserve.c index 6bea913..f21c728 100644 --- a/csdk/stack/src/ocobserve.c +++ b/csdk/stack/src/ocobserve.c @@ -195,7 +195,6 @@ OCStackResult SendObserverNotification (OCMethod method, OCResource *resPtr, uin // Even if entity handler for a resource is not successful // we continue calling entity handler for other resources - //ehRet = resPtr->entityHandler (OC_REQUEST_FLAG, entityHandlerReq); ehRet = BuildObsJSONResponse((OCResource *) resPtr, entityHandlerReq); jsonPayload = (unsigned char *)entityHandlerReq->resJSONPayload; #ifdef WITH_PRESENCE diff --git a/csdk/stack/src/ocstack.c b/csdk/stack/src/ocstack.c index 06db083..fdedd1e 100644 --- a/csdk/stack/src/ocstack.c +++ b/csdk/stack/src/ocstack.c @@ -177,22 +177,6 @@ int ParseIPv4Address(unsigned char * ipAddrStr, uint8_t * ipAddr, uint16_t * por } } -#ifdef PRESENCE_NOTIFICATION -OCStackResult sendPresenceNotification() -{ - OCStackResult result = OC_STACK_ERROR; - if(SERVER_DISCOVERABLE == 1) - { - result = SendObserverNotification(presenceResource, OC_REST_PRESENCE); - } - else - { - result = OC_STACK_OK; - } - return result; -} -#endif - //----------------------------------------------------------------------------- // Private internal function prototypes //----------------------------------------------------------------------------- diff --git a/examples/makefile b/examples/makefile index 37f7469..b483d5f 100644 --- a/examples/makefile +++ b/examples/makefile @@ -17,7 +17,7 @@ CXX_INC += -I../csdk/logger/include CXX_INC += -I../csdk/libcoap # Force metatargets to build: -.PHONY: prep_dirs simpleserver simpleclient simpleclientserver roomserver roomclient ocicuc presenceserver presenceclient +.PHONY: prep_dirs simpleserver simpleclient simpleclientserver roomserver roomclient presenceserver presenceclient ocicuc all: .PHONY diff --git a/RELEASE.txt b/releaseNotes/Aug5th2014.txt similarity index 100% rename from RELEASE.txt rename to releaseNotes/Aug5th2014.txt diff --git a/releaseNotes/Sept2nd2014.txt b/releaseNotes/Sept2nd2014.txt new file mode 100644 index 0000000..119fe2e --- /dev/null +++ b/releaseNotes/Sept2nd2014.txt @@ -0,0 +1,119 @@ +Release notes +**************************************************************************** +Release date: Sept 2nd, 2014. +OS: Ubuntu 12.0.4 and above +Requires boost version 1.55 to build. +Code buildable in gcc 4.6.3 and above. +NOTE: Boost is not distributed but should be installed in the Ubuntu machine. +***************************************************************************** + +What’s new? + +-------------------------------------------- +Class OCPlatform (Header file: OCPlatform.h) +-------------------------------------------- + +***************** +startPresence API +***************** + +This API allows the server to notify its presence via multicast. + +NOTE: This applies to server side functionality only. + +******************* +stopPresence API +******************* + +This API allows the server to stop presence notification. + +NOTE: This applies to server side functionality. + + +****************** +subscribePresence API +****************** + +This API allows a client to subscribe to a device's presence notifications. Notifications include +new addition of resource on the device, deletion of a resource on the device, change in properties +of a resource. + +NOTE: This applies to client side functionality only. +NOTE: In this release, when client uses subscribePresence API, it gets notified only for new +addition of resource on the device (server). + +******************* +unsubscribePresence API +******************* + +This API allows a client to unsubscribe from a device's presence events. + +NOTE: This applies to client side functionality only. + +-------------------------------------------- + Header file: OCStack.h (in base) +-------------------------------------------- + +***************** +OCStartPresence API +***************** + +This API will start sending out presence notifications to clients via multicast. + +NOTE: This applies to server side functionality only. + +******************* +OCStopPresence API +******************* + +This API will stop sending out presence notifications to clients via multicast. + +NOTE: This applies to server side functionality. + +------------ +Other Notes: +------------ + +Security model is still open. +APIs have OCStackResult as return type. This is will indicate success or failure for the API operation. + +Implementation for presence code is under 'WITH_PRESENCE' preprocessor macro in both C (base) and C++ (SDK). + +Maximum length of URI supported is 64 bytes (sent from the client) +Maximum length of query supported is 64 bytes (sent from the client) +Maximum length of request and response from server for Ardunio is is 256 bytes +Maximum length of request and response from server for non-Ardunio is is 1024 bytes + +------------- +How to build: +------------- + +REFER https://oic-review.01.org/gerrit for more details on getting oic-resource repo. +If the code is not cloned: +Clone the oic-resource repo using this command: git clone oic:oic-resource +Clone the oic-utilities repo using this command: git clone oic:oic-utilities + +NOTE: If the repo is already cloned, use 'git pull' inside oic-resource folder to get the latest code. + +In repo oic-core, root folder ccf-opensource consists of ‘OIC’ folder. Inside OIC folder there is a Makefile. + +Before building, make sure to have contents from oic-utilities repo at the folder level where oic-resource is. + +Inside oic-resource directory, use ‘make’ to build the entire OIC code. This would build the C++ SDK, core(i.e base) and samples. + +Use ‘make BUILD=debug’ to build the entire OIC code in debug mode. This would build the C++ SDK, core(i.e base) and samples. All the executables for debug build +are in 'debug/samples'. + +-------- +Samples: +-------- + +After building the code in oic-resource, executables are in directory named 'release/samples'. +A sample for hosting a resource on a server and a sample for client for discovering resources are provided in the following paths: + +Server sample location: oic-resource/examples/simpleserver.cpp +Client sample location: oic-resource/examples/simpleclient.cpp +Server and client mode (mode type both) location: oic-resource/examples/simpleclientserver.cpp + +Sample with basic presence feature for server side: oic-resource/examples/presenceserver.cpp +Sample with basic presence feature for client side: oic-resource/examples/presenceclient.cpp