CPP Device Virtualization API Reference for Oracle Internet of Things Cloud Service Client Software Library. Release 21.1.1.0.0-3. E92477-09
|
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... | |
DeviceModel & | getDeviceModel (const std::string &deviceModelUrl) throw (GeneralException, CanNotAuthorizeException, std::invalid_argument) |
Get the DeviceModel for the device model urn. More... | |
StorageObject & | createStorageObject (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... | |
StorageObject & | createStorageObject (const std::string &uri) throw (GeneralException, CanNotAuthorizeException) |
Create a new iotdcl::StorageObject from the URI for a named object in storage. More... | |
VirtualDevice & | createVirtualDevice (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... | |
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.
configFilePath | the path of the configuration file |
configFilePassword | the configuration file password |
std::invalid_argument | if filePath or password is NULL. |
GeneralException | otherwise. |
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
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
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
. 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.
restricted | indicate whether or not credentials are required for activating the indirectly connected device |
hardwareId | an identifier unique within the Cloud Service instance |
metaData | The metadata of the device |
urns | should contain the device model type URNs supported by the indirectly connected device. The deviceModels
|
std::invalid_argument | if hardwareId or urns is incorrect. |
CanNotAuthorizeException | if there are problems with authorization. |
GeneralException | otherwise. |
|
static |
The.
attribute. This attribute is to be used when setting the
value in the meta-data.
|
static |
The.
attribute. This attribute is to be used when setting the
value in the meta-data.
|
static |
The.
attribute. This attribute is to be used when setting the
value in the meta-data.
|
static |
The.
attribute. This attribute is to be used when setting the
value in the meta-data.
|
static |
The.
attribute. This attribute is to be used when setting the
value in the meta-data.
|
static |
The.
attribute. This attribute is to be used when setting the
value in the meta-data.
|
static |
The.
attribute. This attribute is to be used when setting the
value in the meta-data.