Fixed a minor bug in C stack and minor cleanup from Presence Notification.
authorSashi Penta <sashi.kumar.penta@intel.com>
Wed, 3 Sep 2014 04:10:52 +0000 (21:10 -0700)
committerSashi Penta <sashi.kumar.penta@intel.com>
Wed, 3 Sep 2014 05:02:46 +0000 (22:02 -0700)
Release notes from Sudarhan, with minor comments from Sashi.

OCPlatform.h with better comments from Sudarshan.

Change-Id: Ie1950b6d3486e3a2314ac7428350f61bba20351f

csdk/occoap/src/occoap.c
csdk/stack/include/internal/occlientcb.h
csdk/stack/src/occlientcb.c
csdk/stack/src/ocobserve.c
csdk/stack/src/ocstack.c
examples/makefile
releaseNotes/Aug5th2014.txt [moved from RELEASE.txt with 100% similarity]
releaseNotes/Sept2nd2014.txt [new file with mode: 0644]

index c74932a..018d840 100644 (file)
@@ -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;
index cf236a2..17ccada 100644 (file)
@@ -25,9 +25,6 @@
 #include <ocstack.h>
 #include <occoaptoken.h>
 
-// TODO platform independence (for time_t)
-#include <time.h>
-
 typedef struct OCPresence {
     // This is the TTL associated with presence
     uint32_t TTL;
index cc4b283..9843513 100644 (file)
@@ -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;
index 6bea913..f21c728 100644 (file)
@@ -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
index 06db083..fdedd1e 100644 (file)
@@ -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
 //-----------------------------------------------------------------------------
index 37f7469..b483d5f 100644 (file)
@@ -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
 
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 (file)
index 0000000..119fe2e
--- /dev/null
@@ -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\92s 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 \91OIC\92 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 \91make\92 to build the entire OIC code. This would build the C++ SDK, core(i.e base) and samples. 
+
+Use \91make BUILD=debug\92 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