![]() |
ThingsBoard Client SDK 0.16.0
Client SDK to connect with ThingsBoard IoT Platform from IoT devices (Arduino, Espressif, etc.)
|
Provisioning callback wrapper. More...
#include <Provision_Callback.h>
Public Member Functions | |
| Provision_Callback ()=default | |
| Constructs empty callback, will result in never being called. Internals are simply default constructed as nullptr. More... | |
| Provision_Callback (Access_Token, function callback, char const *provision_device_key, char const *provision_device_secret, char const *device_name=nullptr, uint64_t const &timeout_microseconds=0U, Callback_Watchdog::function timeout_callback=nullptr) | |
| Constructs callback that will be called upon a provision request arrival, where the requested credentials were sent by the cloud and received by the client. More... | |
| Provision_Callback (Device_Access_Token, function callback, char const *provision_device_key, char const *provision_device_secret, char const *access_token, char const *device_name=nullptr, uint64_t const &timeout_microseconds=0U, Callback_Watchdog::function timeout_callback=nullptr) | |
| @copydetail Provision_Callback(Access_Token, function, char const *, char const *, char const *, uint64_t const &, Callback_Watchdog::function) More... | |
| Provision_Callback (Basic_MQTT_Credentials, function callback, char const *provision_device_key, char const *provision_device_secret, char const *username, char const *password, char const *client_id, char const *device_name=nullptr, uint64_t const &timeout_microseconds=0U, Callback_Watchdog::function timeout_callback=nullptr) | |
| @copydetail Provision_Callback(Access_Token, function, char const *, char const *, char const *, uint64_t const &, Callback_Watchdog::function) More... | |
| Provision_Callback (X509_Certificate, function callback, char const *provision_device_key, char const *provision_device_secret, char const *hash, char const *device_name=nullptr, uint64_t const &timeout_microseconds=0U, Callback_Watchdog::function timeout_callback=nullptr) | |
| @copydetail Provision_Callback(Access_Token, function, char const *, char const *, char const *, uint64_t const &, Callback_Watchdog::function) More... | |
| ~Provision_Callback () override=default | |
| char const * | Get_Device_Key () const |
| Gets the provisioning key of the Device Profile, that should be used to create the device under. More... | |
| void | Set_Device_Key (char const *provision_device_key) |
| Sets the provisioning key of the Device Profile, that should be used to create the device under. More... | |
| char const * | Get_Device_Secret () const |
| Gets the provisioning secret of the Device Profile that should be used to create the device under. More... | |
| void | Set_Device_Secret (char const *provision_device_secret) |
| Sets the provisioning secret of the Device Profile that should be used to create the device under. More... | |
| char const * | Get_Device_Name () const |
| Gets the name the created device should have on the cloud. More... | |
| void | Set_Device_Name (char const *device_name) |
| Sets the name the created device should have on the cloud, pass nullptr or an empty string if a random string generated by the server should be used as the name. More... | |
| char const * | Get_Device_Access_Token () const |
| Gets the access token generated by the device, that will be used by the provisioned device. More... | |
| void | Set_Device_Access_Token (char const *access_token) |
| Sets the access token generated by the device, that will be used by the provisioned device. More... | |
| char const * | Get_Credentials_Username () const |
| Gets the basic MQTT credentials username, that will be used by the provisioned device. More... | |
| void | Set_Credentials_Username (char const *username) |
| Sets the basic MQTT credentials username, that will be used by the provisioned device. More... | |
| char const * | Get_Credentials_Password () const |
| Gets the basic MQTT credentials password, that will be used by the provisioned device. More... | |
| void | Set_Credentials_Password (char const *password) |
| Sets the basic MQTT credentials password, that will be used by the provisioned device. More... | |
| char const * | Get_Credentials_Client_ID () const |
| Gets the basic MQTT credentials client ID, that will be used by the provisioned device. More... | |
| void | Set_Credentials_Client_ID (char const *client_id) |
| Sets the basic MQTT credentials client ID, that will be used by the provisioned device. More... | |
| char const * | Get_Certificate_Hash () const |
| Gets the public X.509 certificate hash, that will be used by the provisioned device. More... | |
| void | Set_Certificate_Hash (char const *hash) |
| Sets the public X.509 certificate hash, that will be used by the provisioned device. More... | |
| char const * | Get_Credentials_Type () const |
| Gets the string containing the used credentials type that decides which provisioning method is actually used, by the Provision_Callback and therefore decides what response we will receive from the server. More... | |
| Timeoutable_Request & | Get_Request_Timeout () |
| Gets the request timeout callback. More... | |
Public Member Functions inherited from Callback< void, JsonDocument const & > | |
| Callback ()=default | |
| Constructs empty callback, will result in never being called. Internals are simply default constructed as nullptr. More... | |
| Callback (function callback) | |
| Constructor. More... | |
| virtual | ~Callback ()=default |
| Virtual default destructor, created to ensure that if a pointer to this class is used and deleted, we will also call the derived base class destructor. More... | |
| void | Call_Callback (argument_types const &... arguments) const |
| Calls the callback that was subscribed, when this class instance was initally created. More... | |
| void | Set_Callback (function callback) |
| Sets the callback method that will be called upon data arrival with the given data that was received. If nullptr is passed the callback will never be called and instead return with a defaulted instance of the requested return variable. More... | |
Additional Inherited Members | |
Public Types inherited from Callback< void, JsonDocument const & > | |
| using | function = std::function< void(argument_types... arguments)> |
| Callback signature. More... | |
Provisioning callback wrapper.
|
default |
Constructs empty callback, will result in never being called. Internals are simply default constructed as nullptr.
| Provision_Callback::Provision_Callback | ( | Access_Token | , |
| function | callback, | ||
| char const * | provision_device_key, | ||
| char const * | provision_device_secret, | ||
| char const * | device_name = nullptr, |
||
| uint64_t const & | timeout_microseconds = 0U, |
||
| Callback_Watchdog::function | timeout_callback = nullptr |
||
| ) |
Constructs callback that will be called upon a provision request arrival, where the requested credentials were sent by the cloud and received by the client.
| callback | Callback method that will be called upon provisioning response arrival |
| provision_device_key | Non owning pointer to the provisioning key of the Device Profile that should be used to create the device under. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| provision_device_secret | Non owning pointer to the provisioning secret of the Device Profile that should be used to create the device under. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| username | Non owning pointer to the basic MQTT credentials username, that will be used by the provisioned device. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| password | Non owning pointer to the basic MQTT credentials password, that will be used by the provisioned device. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| client_id | Non owning pointer to the basic MQTT credentials client ID, that will be used by the provisioned device. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| access_token | Non owning pointer to the access token generated by the device, that will be used by the provisioned device. Alternative to letting the access token be generated by the cloud instead. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| hash | Non owning pointer to the public X.509 certificate hash, that will be used by the provisioned device. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| device_name | Non owning pointer to the name the created device should have on the cloud, pass nullptr or an empty string if a random string generated by the server should be used as the name. Needs to be unique, therefore using the Mac Address of the device is recommended if an actual name is passed. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| timeout_microseconds | Optional amount of microseconds until a response should have been received from the server, counted from the moment the request is sent. If a response is not received in the timeout time, the timeout callback method will be called to inform the user that the request has failed. If the value is 0 the timer will not be started and therefore never call the timeout callback method, default = 0 |
| timeout_callback | Optional callback method that will be called upon request timeout (did not receive a response in the given timeout time). Can happen if the requested method does not exist on the cloud, or if the connection could not be established. A nullptr means even if a timeout occured the callback is simply ignored and the user not informed, default = nullptr |
| Provision_Callback::Provision_Callback | ( | Device_Access_Token | , |
| function | callback, | ||
| char const * | provision_device_key, | ||
| char const * | provision_device_secret, | ||
| char const * | access_token, | ||
| char const * | device_name = nullptr, |
||
| uint64_t const & | timeout_microseconds = 0U, |
||
| Callback_Watchdog::function | timeout_callback = nullptr |
||
| ) |
| Provision_Callback::Provision_Callback | ( | Basic_MQTT_Credentials | , |
| function | callback, | ||
| char const * | provision_device_key, | ||
| char const * | provision_device_secret, | ||
| char const * | username, | ||
| char const * | password, | ||
| char const * | client_id, | ||
| char const * | device_name = nullptr, |
||
| uint64_t const & | timeout_microseconds = 0U, |
||
| Callback_Watchdog::function | timeout_callback = nullptr |
||
| ) |
| Provision_Callback::Provision_Callback | ( | X509_Certificate | , |
| function | callback, | ||
| char const * | provision_device_key, | ||
| char const * | provision_device_secret, | ||
| char const * | hash, | ||
| char const * | device_name = nullptr, |
||
| uint64_t const & | timeout_microseconds = 0U, |
||
| Callback_Watchdog::function | timeout_callback = nullptr |
||
| ) |
|
overridedefault |
| const char * Provision_Callback::Get_Certificate_Hash | ( | ) | const |
Gets the public X.509 certificate hash, that will be used by the provisioned device.
| const char * Provision_Callback::Get_Credentials_Client_ID | ( | ) | const |
Gets the basic MQTT credentials client ID, that will be used by the provisioned device.
| const char * Provision_Callback::Get_Credentials_Password | ( | ) | const |
Gets the basic MQTT credentials password, that will be used by the provisioned device.
| const char * Provision_Callback::Get_Credentials_Type | ( | ) | const |
Gets the string containing the used credentials type that decides which provisioning method is actually used, by the Provision_Callback and therefore decides what response we will receive from the server.
| const char * Provision_Callback::Get_Credentials_Username | ( | ) | const |
Gets the basic MQTT credentials username, that will be used by the provisioned device.
| const char * Provision_Callback::Get_Device_Access_Token | ( | ) | const |
Gets the access token generated by the device, that will be used by the provisioned device.
| const char * Provision_Callback::Get_Device_Key | ( | ) | const |
Gets the provisioning key of the Device Profile, that should be used to create the device under.
| const char * Provision_Callback::Get_Device_Name | ( | ) | const |
Gets the name the created device should have on the cloud.
| const char * Provision_Callback::Get_Device_Secret | ( | ) | const |
Gets the provisioning secret of the Device Profile that should be used to create the device under.
| Timeoutable_Request & Provision_Callback::Get_Request_Timeout | ( | ) |
Gets the request timeout callback.
| void Provision_Callback::Set_Certificate_Hash | ( | char const * | hash | ) |
Sets the public X.509 certificate hash, that will be used by the provisioned device.
| hash | Non owning pointer to the public X.509 certificate hash. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| void Provision_Callback::Set_Credentials_Client_ID | ( | char const * | client_id | ) |
Sets the basic MQTT credentials client ID, that will be used by the provisioned device.
| client_id | Non owning pointer to the basic MQTT credentials client ID. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| void Provision_Callback::Set_Credentials_Password | ( | char const * | password | ) |
Sets the basic MQTT credentials password, that will be used by the provisioned device.
| password | Non owning pointer to the basic MQTT credentials password. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| void Provision_Callback::Set_Credentials_Username | ( | char const * | username | ) |
Sets the basic MQTT credentials username, that will be used by the provisioned device.
| username | Non owning pointer to the basic MQTT credentials username. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| void Provision_Callback::Set_Device_Access_Token | ( | char const * | access_token | ) |
Sets the access token generated by the device, that will be used by the provisioned device.
| access_token | Non owning pointer to the access token generated by the device. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| void Provision_Callback::Set_Device_Key | ( | char const * | provision_device_key | ) |
Sets the provisioning key of the Device Profile, that should be used to create the device under.
| provision_device_key | Non owning pointer to the provisioning key of the Device Profile. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| void Provision_Callback::Set_Device_Name | ( | char const * | device_name | ) |
Sets the name the created device should have on the cloud, pass nullptr or an empty string if a random string generated by the server should be used as the name.
| device_name | Non owning pointer to the name the created device should have on the cloud. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |
| void Provision_Callback::Set_Device_Secret | ( | char const * | provision_device_secret | ) |
Sets the provisioning secret of the Device Profile that should be used to create the device under.
| provision_device_secret | Non owning pointer to the provisioning secret of the Device Profile. Additionally it has to be kept alive by the user until the Provision_Request method has been called with this instance as the argument, because that method copies the data into the outgoing MQTT buffer to create the provision request |