added cacheadapter interface and memorycache of notification.
[platform/upstream/iotivity.git] / service / notification / include / NSProviderInterface.h
index 606ff5c..f5c5578 100644 (file)
 //\r
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
 \r
+/**\r
+ * @file\r
+ *\r
+ * This file provides APIs of Notification Service for Provider.\r
+ */\r
+\r
 #ifndef _NS_PROVIDER_INTERFACE_H_\r
 #define _NS_PROVIDER_INTERFACE_H_\r
 \r
 #ifdef __cplusplus\r
-extern "C" {\r
+extern "C"\r
+{\r
 #endif // __cplusplus\r
 \r
 #include "NSCommon.h"\r
 #include <stdbool.h>\r
 #include <stdint.h>\r
 \r
+/**\r
+ * Provider uses this callback function to receive subscription request of consumer\r
+ * @param[in] consumer        Consumer who subscribes the resource\r
+ */\r
+typedef void (*NSSubscribeRequestCallback)(NSConsumer *);\r
+\r
+/**\r
+ * Provider use this callback function to receive the status of the message\r
+ * synchronization\r
+ * @param[in] sync        Synchronization information of the notification message\r
+ */\r
+typedef void (*NSSyncCallback)(NSSync *);\r
+\r
+/**\r
+ * Initialize notification service for provider\r
+ * @param[in]  policy   Accepter\r
+ * @param[in]  subscribeRequestCallback   Callback function to register for receiving\r
+ * subscription request from consumer\r
+ * @param[in]  syncCallback   Callback function to register for receiving  sync data\r
+ * @return ::NS_OK or result code of NSResult\r
+ */\r
 NSResult NSStartProvider(NSAccessPolicy policy, NSSubscribeRequestCallback subscribeRequestCb,\r
         NSSyncCallback syncCb);\r
 \r
+/**\r
+ * Terminate notification service for provider\r
+ * @return ::NS_OK or result code of NSResult\r
+ */\r
 NSResult NSStopProvider();\r
 \r
+/**\r
+ * Send notification message to all subscribers\r
+ * @param[in]  message  Notification message including id, title, contentText\r
+ * @return ::NS_OK or result code of NSResult\r
+ */\r
 NSResult NSSendNotification(NSMessage *msg);\r
 \r
-NSResult NSReadCheck(NSMessage *msg);\r
-\r
+/**\r
+ * Send acceptance to consumer who subscribes the resource of notification message\r
+ * @param[in]  consumer  Consumer who subscribes the resource\r
+ * @param[in]  accepted  the result of acceptance; Allow or Deny\r
+ * @return ::NS_OK or result code of NSResult\r
+ */\r
 NSResult NSAccept(NSConsumer *consumer, bool accepted);\r
 \r
-NSResult NSGetConsumerList(uint8_t *list, uint32_t size);\r
-\r
-NSResult NSTestStartPresence();\r
+/**\r
+ * Get consumer list that is stored in the cache of notification service\r
+ * @param[in]  list  Consumer list\r
+ * @param[in]  size  the number of consumers stored in the cache\r
+ * @return ::NS_OK or result code of NSResult\r
+ */\r
+// NSResult NSGetConsumerList(uint8_t *list, uint32_t size);\r
 \r
-NSResult NSTestStopPresence();\r
+/**\r
+ * Send read-check to provider in order to synchronize notification status with other consumers\r
+ * @param[in]  message  Notification message to synchronize the status\r
+ * @return ::NS_OK or result code of NSResult\r
+ */\r
+NSResult NSProviderReadCheck(NSMessage *);\r
 \r
 #ifdef __cplusplus\r
 }\r