CPP Device Virtualization API Reference for Oracle Internet of Things Cloud Service Client Software Library. Release 21.1.1.0.0-3. E92477-09
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
iotdcl::GatewayDevice Class Reference
+ Inheritance diagram for iotdcl::GatewayDevice:

Public Member Functions

 GatewayDevice (const std::string &filePath, const std::string &password) throw (std::invalid_argument, GeneralException)
 Constructs a new GatewayDevice instance that will load the device configuration from the given file path and password. More...
 
virtual ~GatewayDevice ()
 Destructor.
 
std::string registerDevice (const bool restricted, const std::string &hardwareId, const std::map< std::string, std::string > &metaData, const std::initializer_list< std::string > &urns) throw (GeneralException, CanNotAuthorizeException, std::invalid_argument)
 Register an indirectly-connected device with the cloud service and specify whether the gateway device is required to have the appropriate credentials for activating the indirectly-connected device. More...
 
- Public Member Functions inherited from iotdcl::DirectlyConnectedDevice
 DirectlyConnectedDevice (const std::string &filePath, const std::string &password) throw (GeneralException, std::invalid_argument)
 Constructs a new DirectlyConnectedDevice instance that will load the device configuration from the given file path and password. More...
 
virtual ~DirectlyConnectedDevice ()
 Destructor.
 
const std::string & getEndpointId () const
 Return the endpoint identifier of this directly-connected device. More...
 
bool isActivated ()
 Returns whether the device has been activated. More...
 
void activate (const std::initializer_list< std::string > &deviceModelUrls) throw (GeneralException, CanNotAuthorizeException, std::invalid_argument)
 Activate the device. More...
 
DeviceModelgetDeviceModel (const std::string &deviceModelUrl) throw (GeneralException, CanNotAuthorizeException, std::invalid_argument)
 Get the DeviceModel for the device model urn. More...
 
StorageObjectcreateStorageObject (const std::string &name, const std::string &contentType) throw (GeneralException, CanNotAuthorizeException)
 Create a new iotdcl::StorageObject with the given object name and mime–type. More...
 
StorageObjectcreateStorageObject (const std::string &uri) throw (GeneralException, CanNotAuthorizeException)
 Create a new iotdcl::StorageObject from the URI for a named object in storage. More...
 
VirtualDevicecreateVirtualDevice (const std::string &endpointId, DeviceModel &model) throw (GeneralException, CanNotAuthorizeException, std::invalid_argument)
 Create a iotcs::AbstractVirtualDevice instance with the given device model for the given device identifier. More...
 

Static Public Attributes

static const std::string MANUFACTURER
 The. More...
 
static const std::string MODEL_NUMBER
 The. More...
 
static const std::string SERIAL_NUMBER
 The. More...
 
static const std::string DEVICE_CLASS
 The. More...
 
static const std::string PROTOCOL
 The. More...
 
static const std::string PROTOCOL_DEVICE_CLASS
 The. More...
 
static const std::string PROTOCOL_DEVICE_ID
 The. More...
 

Constructor & Destructor Documentation

iotdcl::GatewayDevice::GatewayDevice ( const std::string &  filePath,
const std::string &  password 
)
throw (std::invalid_argument,
GeneralException
)

Constructs a new GatewayDevice instance that will load the device configuration from the given file path and password.

Parameters
configFilePaththe path of the configuration file
configFilePasswordthe configuration file password
Exceptions
std::invalid_argumentif filePath or password is NULL.
GeneralExceptionotherwise.

Member Function Documentation

std::string iotdcl::GatewayDevice::registerDevice ( const bool  restricted,
const std::string &  hardwareId,
const std::map< std::string, std::string > &  metaData,
const std::initializer_list< std::string > &  urns 
)
throw (GeneralException,
CanNotAuthorizeException,
std::invalid_argument
)

Register an indirectly-connected device with the cloud service and specify whether the gateway device is required to have the appropriate credentials for activating the indirectly-connected device.

The

restricted

parameter controls whether or not the client library is required to supply credentials for activating the indirectly-connected device. The client library will always supply credentials for an indirectly-connected device whose trusted assets have been provisioned to the client. If, however, the trusted assets of the indirectly-connected device have not been provisioned to the client, the client library can create credentials that attempt to restrict the indirectly connected device to this gateway device.

Pass true for the restricted parameter to ensure the indirectly-connected device cannot be activated by this gateway device without presenting credentials. If restricted is true, the client library will provide credentials to the server. The server will reject the activation request if the indirectly connected device is not allowed to roam to this gateway device.

Pass

false

to allow the indirectly-connected device to be activated without presenting credentials if the trusted assets of the indirectly-connected device have not been provisioned to the client. If restricted is false, the client library will provide credentials if, and only if, the credentials have been provisioned to the client. The server will reject the activation if credentials are required but not supplied, or if the provisioned credentials do not allow the indirectly connected device to roam to this gateway device.

The hardwareId is a unique identifier within the cloud service instance and may not be

null

. If one is not present for the device, it should be generated based on other metadata such as: model, manufacturer, serial number, etc.

The metaData Map should typically contain all the standard metadata (the constants documented in this class) along with any other vendor defined metadata.

Parameters
restrictedindicate whether or not credentials are required for activating the indirectly connected device
hardwareIdan identifier unique within the Cloud Service instance
metaDataThe metadata of the device
urnsshould contain the device model type URNs supported by the indirectly connected device. The
deviceModels
parameter is one or more, comma separated, device model URNs.
Returns
The endpoint id of the indirectly-connected device
Exceptions
std::invalid_argumentif hardwareId or urns is incorrect.
CanNotAuthorizeExceptionif there are problems with authorization.
GeneralExceptionotherwise.

Member Data Documentation

const std::string iotdcl::GatewayDevice::DEVICE_CLASS
static

The.

deviceClass

attribute. This attribute is to be used when setting the

deviceClass

value in the meta-data.

const std::string iotdcl::GatewayDevice::MANUFACTURER
static

The.

manufacturer

attribute. This attribute is to be used when setting the

manufacturer

value in the meta-data.

const std::string iotdcl::GatewayDevice::MODEL_NUMBER
static

The.

modelNumber

attribute. This attribute is to be used when setting the

modelNumber

value in the meta-data.

const std::string iotdcl::GatewayDevice::PROTOCOL
static

The.

protocol

attribute. This attribute is to be used when setting the

protocol

value in the meta-data.

const std::string iotdcl::GatewayDevice::PROTOCOL_DEVICE_CLASS
static

The.

protocolDeviceClass

attribute. This attribute is to be used when setting the

protocolDeviceClass

value in the meta-data.

const std::string iotdcl::GatewayDevice::PROTOCOL_DEVICE_ID
static

The.

protocolDeviceId

attribute. This attribute is to be used when setting the

protocolDeviceId

value in the meta-data.

const std::string iotdcl::GatewayDevice::SERIAL_NUMBER
static

The.

serialNumber

attribute. This attribute is to be used when setting the

serialNumber

value in the meta-data.


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