[CONPRO-1251]Updated typo error
[platform/upstream/iotivity.git] / resource / csdk / stack / include / internal / ocobserve.h
index 85ecd4e..2fa6724 100644 (file)
@@ -96,6 +96,18 @@ typedef struct ResourceObserver
 
 } ResourceObserver;
 
+/**
+ *  Initialize observer list.
+ *
+ * @return ::OC_STACK_OK on success, some other value upon failure.
+ */
+OCStackResult InitializeObserverList();
+
+/**
+ *  Terminate observer list.
+ */
+void TerminateObserverList();
+
 #ifdef WITH_PRESENCE
 /**
  * Create an observe response and send to all observers in the observe list.
@@ -191,6 +203,16 @@ OCStackResult AddObserver (const char         *resUri,
  */
  OCStackResult DeleteObserverUsingToken (CAToken_t token, uint8_t tokenLength);
 
+ /**
+  * Delete observer with device address from list of observers.
+  * Free memory that was allocated for the observer in the list.
+  *
+  * @param devAddr Device's address.
+  *
+  * @return ::OC_STACK_OK on success, some other value upon failure.
+  */
+OCStackResult DeleteObserverUsingDevAddr(const OCDevAddr *devAddr);
+
 /**
  * Search the list of observers for the specified token.
  *
@@ -198,6 +220,7 @@ OCStackResult AddObserver (const char         *resUri,
  * @param tokenLength      Length of token.
  *
  * @return Pointer to found observer.
+ * This is copy of observer, caller must release its memory using FreeObserver().
  */
 ResourceObserver* GetObserverUsingToken (const CAToken_t token, uint8_t tokenLength);
 
@@ -207,10 +230,20 @@ ResourceObserver* GetObserverUsingToken (const CAToken_t token, uint8_t tokenLen
  * @param observeId        Observer ID to search for.
  *
  * @return Pointer to found observer.
+ * This is copy of observer, caller must release its memory using FreeObserver().
  */
 ResourceObserver* GetObserverUsingId (const OCObservationId observeId);
 
 /**
+ * Search the list of observers for the specified observe ID.
+ *
+ * @param observeId        Observer ID to search for.
+ *
+ * @return true if observer found matched with observer ID, otherwise false.
+ */
+bool IsObserverAvailable (const OCObservationId observeId);
+
+/**
  *  Add observe header option to a request.
  *
  * @param caHdrOpt        Target request CA header option.
@@ -245,5 +278,12 @@ GetObserveHeaderOption (uint32_t * observationOption,
                         CAHeaderOption_t *options,
                         uint8_t * numOptions);
 
+/**
+ *  Free memory associated with observer.
+ *
+ * @param obsNode        Observer to be freed.
+ */
+void FreeObserver (ResourceObserver* obsNode);
+
 #endif //OC_OBSERVE_H