#include <stdint.h>\r
\r
/**\r
- * Invoked the subscription request from consumer is received\r
- * @param[in] consumer Consumer who subscribes the resource\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
- * Invoked when the synchronization data which has notification message \r
- * read/delete event from consumer is received\r
+ * Provider use this callback function to receive the status of the message\r
* synchronization\r
- * @param[in] syncinfo Synchronization information of the notification message\r
+ * @param[in] sync Synchronization information of the notification message\r
*/\r
typedef void (*NSProviderSyncInfoCallback)(NSSyncInfo *);\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
+ * Set provider service with the following configuration\r
+ */\r
+typedef struct\r
+{\r
+ /* Invoked when the subscription request from consumer is received */\r
+ NSSubscribeRequestCallback subRequestCallback;\r
+ /* Invoked when the synchronization data, read and deleted, is sent by consumer is received */\r
+ NSProviderSyncInfoCallback syncInfoCallback;\r
+ /* Set the policy for notification servcie refering to following\r
+ * if policy is true, provider decides to allow or deny for all the subscribing consumers.\r
+ * Otherwise(policy is false) consumer decides to request subscription to discovered providers.\r
+ */\r
+ bool policy;\r
+ /* User Information */\r
+ char * userInfo;\r
+\r
+} NSProviderConfig;\r
+\r
+/**\r
+ * Initialize notification service for provider service\r
+ * @param[in] config Refer to NSProviderConfig\r
* @return ::NS_OK or result code of NSResult\r
*/\r
+//TODO next commit, change to NSProviderConfig ..\r
NSResult NSStartProvider(bool policy, NSSubscribeRequestCallback subscribeRequestCb,\r
NSProviderSyncInfoCallback syncCb);\r
\r
NSResult NSAcceptSubscription(NSConsumer *consumer, bool accepted);\r
\r
/**\r
- * Send sync type in order to synchronize notification status with other consumers,\r
- * when provider consumes the notification such as READ, DELETE\r
- * @param[in] messageId Notification message if to synchronize the status\r
- * @param[in] type changed notification status from NSSyncType\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 NSProviderSendSyncInfo(uint64_t messageId, NSSyncType type);\r
+//TODO will use Function.\r
+// NSResult NSGetConsumerList(uint8_t *list, uint32_t size);\r
\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 NSProviderSendSyncInfo(uint64_t messageId, NSSyncType type);\r
\r
/**\r
- * Initialize NSMessage structure with message id and provider(device) id\r
+ * Initialize NSMessage struct, our service set message id and provider(device) id\r
* @return ::NSMessage *\r
*/\r
NSMessage * NSCreateMessage();\r