IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NSConsumerInterface.h
Go to the documentation of this file.
1 //******************************************************************
2 //
3 // Copyright 2016 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
10 //
11 // http://www.apache.org/licenses/LICENSE-2.0
12 //
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20 
27 #ifndef _NS_CONSUMER_INTERFACE_H_
28 #define _NS_CONSUMER_INTERFACE_H_
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif // __cplusplus
34 
35 #include "NSCommon.h"
36 
43 
50 
58 
59 typedef struct
60 {
64 
66 
73 
79 
85 NSResult NSConsumerEnableRemoteService(const char * serverAddress);
86 
87 #ifdef WITH_MQ
88 
94 NSResult NSConsumerSubscribeMQService(const char * serverAddress, const char * topicName);
95 #endif
96 
102 
108 NSResult NSSubscribe(const char * providerId);
109 
115 NSResult NSUnsubscribe(const char * providerId);
116 
126  const char * providerId, uint64_t messageId, NSSyncType type);
127 
133 NSProvider * NSConsumerGetProvider(const char * providerId);
134 
140 NSTopicLL * NSConsumerGetTopicList(const char * providerId);
141 
148 NSResult NSConsumerUpdateTopicList(const char * providerId, NSTopicLL * topics);
149 
150 #ifdef __cplusplus
151 }
152 #endif // __cplusplus
153 
154 #endif // _NS_CONSUMER_INTERFACE_H_
NSProvider * NSConsumerGetProvider(const char *providerId)
Request NSProvider that is matched by provider id.
NSResult NSUnsubscribe(const char *providerId)
Request to unsubscribe in order not to receive notification message from provider.
Synchronization information of the notification message.
Definition: NSCommon.h:163
Notification Message.
Definition: NSCommon.h:141
Definition: NSConsumerInterface.h:59
NSSyncInfoReceivedCallback syncInfoCb
Definition: NSConsumerInterface.h:63
NSResult NSConsumerUpdateTopicList(const char *providerId, NSTopicLL *topics)
Select Topic list that is wanted to subscribe from provider.
Provider information.
Definition: NSCommon.h:123
void(* NSSyncInfoReceivedCallback)(NSSyncInfo *)
Invoked when the synchronization data which has notification message read/delete event from provider/...
Definition: NSConsumerInterface.h:57
NSProviderState
Provider state of notification consumer service.
Definition: NSCommon.h:50
NSResult NSSubscribe(const char *providerId)
Request to subscribe notification message resource of provider.
NSResult NSStopConsumer()
Terminate notification service for consumer.
NSMessageReceivedCallback messageCb
Definition: NSConsumerInterface.h:62
NSTopicLL * NSConsumerGetTopicList(const char *providerId)
Request NSTopic list that is subscribed from provider.
Topic linked list.
Definition: NSCommon.h:103
NSResult NSStartConsumer(NSConsumerConfig config)
Initialize notification service for consumer.
NSProviderStateCallback changedCb
Definition: NSConsumerInterface.h:61
void(* NSProviderStateCallback)(NSProvider *, NSProviderState)
Invoked when the provider state is changed.
Definition: NSConsumerInterface.h:42
NSResult NSConsumerEnableRemoteService(const char *serverAddress)
Request to discover to remote address as parameter.
void(* NSMessageReceivedCallback)(NSMessage *)
Invoked when the notification message from provider is received synchronization.
Definition: NSConsumerInterface.h:49
NSSyncType
Notification message status to synchronize.
Definition: NSCommon.h:63
NSResult NSRescanProvider()
Request discovery manually.
enum eResult NSResult
Result code of notification service.
NSResult NSConsumerSendSyncInfo(const char *providerId, uint64_t messageId, NSSyncType type)
Send sync type to provider in order to synchronize notification status with other consumers when cons...
This file provides APIs of Notification Service for common functions.