Add support OCNotifyAllObservers and OCNotifyListOfObservers
authorSashi Penta <sashi.kumar.penta@intel.com>
Sat, 20 Dec 2014 00:54:11 +0000 (16:54 -0800)
committerSashi Penta <sashi.kumar.penta@intel.com>
Sat, 20 Dec 2014 01:04:51 +0000 (17:04 -0800)
Change-Id: If878e1a2da88b364ecf9601d844d2caf3d5ce1ed
Signed-off-by: Sashi Penta <sashi.kumar.penta@intel.com>
resource/csdk/stack/src/ocobserve.c

index f4df785..8960b99 100644 (file)
@@ -107,11 +107,23 @@ OCStackResult SendAllObserverNotification (OCMethod method, OCResource *resPtr,
             {
             #endif
                 qos = DetermineObserverQoS(method, resourceObserver, qos);
+
+#ifdef CA_INT
+                result = AddServerCARequest(&request, 0, 0, 0, 1, OC_REST_GET,
+                        0, resPtr->sequenceNum, qos, resourceObserver->query,
+                        NULL, NULL,
+                        &resourceObserver->token, resourceObserver->addr,
+                        resourceObserver->resUri, 0,
+                        &(resourceObserver->addressInfo), resourceObserver->connectivityType,
+                        resourceObserver->CAToken);
+#else
                 result = AddServerRequest(&request, 0, 0, 0, 1, OC_REST_GET,
                         0, resPtr->sequenceNum, qos, resourceObserver->query,
                         NULL, NULL,
                         &resourceObserver->token, resourceObserver->addr,
                         resourceObserver->resUri, 0);
+#endif // CA_INT
+
                 request->observeResult = OC_STACK_OK;
                 if(request && result == OC_STACK_OK)
                 {
@@ -199,10 +211,21 @@ OCStackResult SendListObserverNotification (OCResource * resource,
             {
                 qos = DetermineObserverQoS(OC_REST_GET, observation, qos);
 
+
+#ifdef CA_INT
+                result = AddServerCARequest(&request, 0, 0, 0, 1, OC_REST_GET,
+                        0, resource->sequenceNum, qos, observation->query,
+                        NULL, NULL, &observation->token,
+                        observation->addr, observation->resUri, 0,
+                        &(observation->addressInfo), observation->connectivityType,
+                        observation->CAToken);
+#else
                 result = AddServerRequest(&request, 0, 0, 0, 1, OC_REST_GET,
                         0, resource->sequenceNum, qos, observation->query,
                         NULL, NULL, &observation->token,
                         observation->addr, observation->resUri, 0);
+#endif //CA_INT
+
                 request->observeResult = OC_STACK_OK;
                 if(request && result == OC_STACK_OK)
                 {