.. _object_CloudOfThingsClient: :index:`CloudOfThingsClient` ---------------------------- Description *********** The CloudOfThingsClient object is used to connect to the Cloud of Things. A tenant is required to use the cloud and each device has to be registered. :**› Inherits**: :ref:`Object ` Overview ******** Properties ++++++++++ .. hlist:: :columns: 2 * :ref:`clientId ` * :ref:`error ` * :ref:`errorString ` * :ref:`iccid ` * :ref:`imei ` * :ref:`imsi ` * :ref:`objects ` * :ref:`registrator ` * :ref:`remoteConnectionManager ` * :ref:`tenant ` * :ref:`transport ` * :ref:`Object.objectId ` * :ref:`Object.parent ` Methods +++++++ .. hlist:: :columns: 1 * :ref:`Object.deserializeProperties() ` * :ref:`Object.fromJson() ` * :ref:`Object.serializeProperties() ` * :ref:`Object.toJson() ` Signals +++++++ .. hlist:: :columns: 1 * :ref:`errorOccurred() ` * :ref:`objectsDataChanged() ` * :ref:`Object.completed() ` Enumerations ++++++++++++ .. hlist:: :columns: 1 * :ref:`Error ` Properties ********** .. _property_CloudOfThingsClient_clientId: .. _signal_CloudOfThingsClient_clientIdChanged: .. index:: single: clientId clientId ++++++++ This property holds the clientId of this device. Normally this is the MAC address of eth0. :**› Type**: String :**› Signal**: clientIdChanged() :**› Attributes**: Readonly .. _property_CloudOfThingsClient_error: .. _signal_CloudOfThingsClient_errorChanged: .. index:: single: error error +++++ This property holds the most recently occurred error or :ref:`CloudOfThingsClient.NoError ` if no error occurred. If the same error occurs multiple times this property does not change. Use the :ref:`errorOccurred() ` signal to detect multiple occurrences of the same error. :**› Type**: :ref:`Error ` :**› Signal**: errorChanged() :**› Attributes**: Readonly .. _property_CloudOfThingsClient_errorString: .. _signal_CloudOfThingsClient_errorStringChanged: .. index:: single: errorString errorString +++++++++++ This property holds the current human readable error string corresponding to the current value in the :ref:`error ` property. It may include additional information such as failure reasons or locations. :**› Type**: String :**› Signal**: errorStringChanged() :**› Attributes**: Readonly .. _property_CloudOfThingsClient_iccid: .. _signal_CloudOfThingsClient_iccidChanged: .. index:: single: iccid iccid +++++ This property holds the `ICCID `_ of the currently used SIM card. Every change of this property is transmitted to Cloud of Things. See :ref:`MobileNetworkInterface ` for more information. :**› Type**: String :**› Signal**: iccidChanged() :**› Attributes**: Writable .. _property_CloudOfThingsClient_imei: .. _signal_CloudOfThingsClient_imeiChanged: .. index:: single: imei imei ++++ This property holds the `IMEI `_ of the modem device. Every change of this property is transmitted to Cloud of Things. See :ref:`MobileNetworkInterface ` for more information. :**› Type**: String :**› Signal**: imeiChanged() :**› Attributes**: Writable .. _property_CloudOfThingsClient_imsi: .. _signal_CloudOfThingsClient_imsiChanged: .. index:: single: imsi imsi ++++ This property holds the `IMSI `_ of the currently used SIM card. Every change of this property is transmitted to Cloud of Things. See :ref:`MobileNetworkInterface ` for more information. :**› Type**: String :**› Signal**: imsiChanged() :**› Attributes**: Writable .. _property_CloudOfThingsClient_objects: .. _signal_CloudOfThingsClient_objectsChanged: .. index:: single: objects objects +++++++ This property holds a list of objects. This can be used for objects that require a CloudOfThingsClient as parent. :**› Type**: :ref:`List `\<:ref:`Object `> :**› Signal**: objectsChanged() :**› Attributes**: Readonly .. _property_CloudOfThingsClient_registrator: .. _signal_CloudOfThingsClient_registratorChanged: .. index:: single: registrator registrator +++++++++++ This property holds the device registrator used to either do the bootstrap or connect with given credentials. :**› Type**: :ref:`CloudOfThingsDeviceRegistrator ` :**› Signal**: registratorChanged() :**› Attributes**: Readonly .. _property_CloudOfThingsClient_remoteConnectionManager: .. _signal_CloudOfThingsClient_remoteConnectionManagerChanged: .. index:: single: remoteConnectionManager remoteConnectionManager +++++++++++++++++++++++ This property holds a remote connection manager. If its property :ref:`CloudOfThingsRemoteConnectionManager.enabled ` is ``true`` you can configure remote connections in the cloud. Restrict the trusted end points to :ref:`CloudOfThingsRemoteConnectionManager.allowedEndpoints `. This property was introduced in InCore 1.1. :**› Type**: :ref:`CloudOfThingsRemoteConnectionManager ` :**› Signal**: remoteConnectionManagerChanged() :**› Attributes**: Readonly .. _property_CloudOfThingsClient_tenant: .. index:: single: tenant tenant ++++++ This property holds the name of the tenant at the Cloud of Things. Currently it is only used to communicate with the cloud for remote access. It is identical to your cloud access via .ram.m2m.telekom.com. :**› Type**: String :**› Attributes**: Writable .. _property_CloudOfThingsClient_transport: .. _signal_CloudOfThingsClient_transportChanged: .. index:: single: transport transport +++++++++ This property holds the communication layer which decides which protocol is used to cummunicate with the Cloud of Things. This property was introduced in InCore 2.0. :**› Type**: :ref:`CloudOfThingsTransport ` :**› Signal**: transportChanged() :**› Attributes**: Readonly Signals ******* .. _signal_CloudOfThingsClient_errorOccurred: .. index:: single: errorOccurred errorOccurred() +++++++++++++++ This signal is emitted whenever an error has occurred, regardless of whether the :ref:`error ` property has changed or not. In contrast to the change notification signal of the :ref:`error ` property this signal is also emitted several times if a certain error occurs several times in succession. .. _signal_CloudOfThingsClient_objectsDataChanged: .. index:: single: objectsDataChanged objectsDataChanged(SignedInteger index) +++++++++++++++++++++++++++++++++++++++ This signal is emitted whenever the :ref:`List.dataChanged() ` signal is emitted, i.e. the item at ``index`` in the :ref:`objects ` list itself emitted the dataChanged() signal. Enumerations ************ .. _enum_CloudOfThingsClient_Error: .. index:: single: Error Error +++++ This enumeration describes all errors which can occur in CloudOfThingsClient objects. The most recently occurred error is stored in the :ref:`error ` property. .. index:: single: CloudOfThingsClient.NoError .. index:: single: CloudOfThingsClient.MissingTenant .. list-table:: :widths: auto :header-rows: 1 * - Name - Value - Description .. _enumitem_CloudOfThingsClient_NoError: * - ``CloudOfThingsClient.NoError`` - ``0`` - No error occurred or was detected. .. _enumitem_CloudOfThingsClient_MissingTenant: * - ``CloudOfThingsClient.MissingTenant`` - ``1`` - tenant is not set. .. _example_CloudOfThingsClient: Example ******* .. code-block:: qml import InCore.Foundation 2.5 import InCore.CloudOfThings 2.5 Application { //timer for manually reconnects Timer { id: timer repeat: false interval: 5000 onTriggered: transport.connectToHost() } CloudOfThingsClient { id: client tenant: "mustercloud" transport { id: transport protocol: CloudOfThingsTransport.MQTT tenantForMQTT: "nb-iot" cleanSessionMQTT: false //set high interval values to reduce traffic requestOperationsIntervalMQTT: 10 * 60 * 1000 autoConnect: false keepAlive: 2000 //log important state changes onConnected: console.log( "Cloud of Things client connected" ) onErrorChanged: console.log( "oh... error occurred", errorString ) onDisconnected: timer.restart() } remoteConnectionManager { enabled: true //default [ "*" ] allowedEndpoints: [ "localhost", "vnc.yourTestServ.er" ] } registrator { isRegistered: true password: "y0urAwes@meP4ssword" } //do your stuff here /* CloudOfThingsMeasurementWriter { ... } CloudOfThingsEventWriter { ... } */ } }