IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
NSConsumerInterface.h File Reference

This file provides APIs of Notification Service for Consumer. More...

Go to the source code of this file.

Classes

struct  NSConsumerConfig
 

Typedefs

typedef void(* NSProviderStateCallback )(NSProvider *, NSProviderState)
 Invoked when the provider state is changed. More...
 
typedef void(* NSMessageReceivedCallback )(NSMessage *)
 Invoked when the notification message from provider is received synchronization. More...
 
typedef void(* NSSyncInfoReceivedCallback )(NSSyncInfo *)
 Invoked when the synchronization data which has notification message read/delete event from provider/consumer is received synchronization. More...
 

Functions

NSResult NSStartConsumer (NSConsumerConfig config)
 Initialize notification service for consumer. More...
 
NSResult NSStopConsumer ()
 Terminate notification service for consumer. More...
 
NSResult NSConsumerEnableRemoteService (const char *serverAddress)
 Request to discover to remote address as parameter. More...
 
NSResult NSRescanProvider ()
 Request discovery manually. More...
 
NSResult NSSubscribe (const char *providerId)
 Request to subscribe notification message resource of provider. More...
 
NSResult NSUnsubscribe (const char *providerId)
 Request to unsubscribe in order not to receive notification message from provider. More...
 
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 consumer consumes the notification such as READ, DELETE. More...
 
NSProviderNSConsumerGetProvider (const char *providerId)
 Request NSProvider that is matched by provider id. More...
 
NSTopicLLNSConsumerGetTopicList (const char *providerId)
 Request NSTopic list that is subscribed from provider. More...
 
NSResult NSConsumerUpdateTopicList (const char *providerId, NSTopicLL *topics)
 Select Topic list that is wanted to subscribe from provider. More...
 

Detailed Description

This file provides APIs of Notification Service for Consumer.

Typedef Documentation

typedef void(* NSMessageReceivedCallback)(NSMessage *)

Invoked when the notification message from provider is received synchronization.

Parameters
[in]messageNotification message
typedef void(* NSProviderStateCallback)(NSProvider *, NSProviderState)

Invoked when the provider state is changed.

Parameters
[in]providerProvider which has the notification resource
[in]stateResponse which has the provider state
typedef void(* NSSyncInfoReceivedCallback)(NSSyncInfo *)

Invoked when the synchronization data which has notification message read/delete event from provider/consumer is received synchronization.

Parameters
[in]syncInfoSynchronization information of the notification message

Function Documentation

NSResult NSConsumerEnableRemoteService ( const char *  serverAddress)

Request to discover to remote address as parameter.

Parameters
[in]serverAddresscombined with IP address and port number using delimiter :
Returns
NS_OK or result code of NSResult
NSProvider* NSConsumerGetProvider ( const char *  providerId)

Request NSProvider that is matched by provider id.

Parameters
[in]providerIdthe id of provider that user wants to get
Returns
NSProvider
NSTopicLL* NSConsumerGetTopicList ( const char *  providerId)

Request NSTopic list that is subscribed from provider.

Parameters
[in]providerIdthe Id of provider that user wants to get
Returns
NSResult
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 consumer consumes the notification such as READ, DELETE.

Parameters
[in]providerIdProvider id of the Notification message
[in]messageIdNotification message id to synchronize the status
[in]typechanged notification status from NSSyncType
Returns
NS_OK or result code of NSResult
NSResult NSConsumerUpdateTopicList ( const char *  providerId,
NSTopicLL topics 
)

Select Topic list that is wanted to subscribe from provider.

Parameters
[in]providerIdthe Id of provider that user wants to set
[in]topicsthe topic list that user wants to set
Returns
NSResult
NSResult NSRescanProvider ( )

Request discovery manually.

Returns
NS_OK or result code of NSResult
NSResult NSStartConsumer ( NSConsumerConfig  config)

Initialize notification service for consumer.

Parameters
[in]configNSConsumerconfig structure of callback functions
Returns
NS_OK or result code of NSResult
NSResult NSStopConsumer ( )

Terminate notification service for consumer.

Returns
NS_OK or result code of NSResult
NSResult NSSubscribe ( const char *  providerId)

Request to subscribe notification message resource of provider.

Parameters
[in]providerIdthe Id of Provider who send the notification message
Returns
NS_OK or result code of NSResult
NSResult NSUnsubscribe ( const char *  providerId)

Request to unsubscribe in order not to receive notification message from provider.

Parameters
[in]providerIdthe Id of Provider who send the notification message
Returns
NS_OK or result code of NSResult