IoTivity C++ SDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OIC::Service::NSConsumerService Class Reference

This class provides a set of C++APIs for Notification Consumer. More...

Public Types

typedef void(* ProviderDiscoveredCallback )(std::shared_ptr< NSProvider >)
 Consumer uses this callback function to receive the discovered providers. More...
 

Public Member Functions

NSResult start (ProviderDiscoveredCallback providerDiscovered)
 Initialize notification service for consumer. More...
 
NSResult stop ()
 Terminate notification service for consumer. More...
 
NSResult enableRemoteService (const std::string &serverAddress)
 Request to discover to remote address as parameter. More...
 
NSResult subscribeMQService (const std::string &serverAddress, const std::string &topicName)
 Request to subscribe to remote MQ address as parameter. More...
 
NSResult rescanProvider ()
 Request discovery manually. More...
 
ProviderDiscoveredCallback getProviderDiscoveredCb ()
 get the callback for ProviderDiscovered More...
 
std::shared_ptr< NSProvidergetProvider (const std::string &id)
 request to get NSProvider pointer More...
 
NSAcceptedProvidersgetAcceptedProviders ()
 get handle of providers accepted. More...
 

Static Public Member Functions

static NSConsumerServicegetInstance ()
 API for getting the Instance of NSConsumerService class. More...
 

Detailed Description

This class provides a set of C++APIs for Notification Consumer.

Member Typedef Documentation

typedef void(* OIC::Service::NSConsumerService::ProviderDiscoveredCallback)(std::shared_ptr< NSProvider >)

Consumer uses this callback function to receive the discovered providers.

Parameters
[in]providerProvider who has the notification resource

Member Function Documentation

NSResult OIC::Service::NSConsumerService::enableRemoteService ( const std::string &  serverAddress)

Request to discover to remote address as parameter.

Parameters
[in]serverAddresscombined with IP address and port number using delimiter :
Returns
NSResult code of Consumer Service
NSAcceptedProviders* OIC::Service::NSConsumerService::getAcceptedProviders ( )

get handle of providers accepted.

Returns
m_acceptedProviders -accepted providers
static NSConsumerService* OIC::Service::NSConsumerService::getInstance ( )
static

API for getting the Instance of NSConsumerService class.

Returns
Instance of the "NSConsumerService" class
std::shared_ptr<NSProvider> OIC::Service::NSConsumerService::getProvider ( const std::string &  id)

request to get NSProvider pointer

Parameters
id-id as string
Returns
shared pointer to NSProvider
ProviderDiscoveredCallback OIC::Service::NSConsumerService::getProviderDiscoveredCb ( )

get the callback for ProviderDiscovered

Returns
ProviderDiscoveredCallback callbak set
NSResult OIC::Service::NSConsumerService::rescanProvider ( )

Request discovery manually.

Returns
NS_OK or result code of NSResult
NSResult OIC::Service::NSConsumerService::start ( ProviderDiscoveredCallback  providerDiscovered)

Initialize notification service for consumer.

Parameters
providerDiscoveredCallback function pointers to ProviderDiscoveredCallback,
Returns
NS_OK or result code of NSResult
NSResult OIC::Service::NSConsumerService::stop ( )

Terminate notification service for consumer.

Returns
NS_OK or result code of NSResult
NSResult OIC::Service::NSConsumerService::subscribeMQService ( const std::string &  serverAddress,
const std::string &  topicName 
)

Request to subscribe to remote MQ address as parameter.

Parameters
[in]serverAddressserver address combined with IP address and port number and MQ broker uri using delimiter :
[in]topicNamethe interest Topic name for subscription.
Returns
NS_OK or result code of NSResult

The documentation for this class was generated from the following file: