AWS IoT Device SDK C++ v2
1.34.0
AWS IoT Device SDK C++ v2
|
#include <MqttClient.h>
Static Public Member Functions | |
static MqttClientConnectionConfigBuilder | NewDefaultBuilder () noexcept |
Represents configuration parameters for building a MqttClientConnectionConfig object. You can use a single instance of this class PER MqttClientConnectionConfig you want to generate. If you want to generate a config for a different endpoint or port etc... you need a new instance of this class.
Aws::Iot::MqttClientConnectionConfigBuilder::MqttClientConnectionConfigBuilder | ( | ) |
|
noexcept |
Sets the builder up for MTLS using certPath and pkeyPath. These are files on disk and must be in the PEM format.
certPath | path to the X509 certificate (pem file) to use |
pkeyPath | path to the private key (pem file) to use |
allocator | memory allocator to use |
|
noexcept |
Sets the builder up for MTLS using cert and pkey. These are in-memory buffers and must be in the PEM format.
cert | buffer containing the X509 certificate in a PEM format |
pkey | buffer containing the private key in a PEM format |
allocator | memory allocator to use |
|
noexcept |
Sets the builder up for MTLS, using a PKCS#11 library for private key operations.
NOTE: This only works on Unix devices.
pkcs11Options | PKCS#11 options |
allocator | memory allocator to use |
|
noexcept |
Sets the builder up for MTLS using a PKCS12 file and password. These are files on disk and must be in the PEM format.
NOTE: This only works on MacOS devices.
options | The PKCS12 options to use. Has to contain a PKCS12 filepath and password. |
allocator | memory allocator to use |
|
noexcept |
Sets the builder up for MTLS, using a certificate in a Windows certificate store.
NOTE: This only works on Windows.
windowsCertStorePath | Path to certificate in a Windows certificate store. The path must use backslashes and end with the certificate's thumbprint. Example: CurrentUser\MY\A11F8A9B5DF5B98BA3508FBCA575D09570E0D2C6 |
allocator | memory allocator to use |
|
noexcept |
Sets the builder up for Websocket connection.
config | websocket configuration information |
allocator | memory allocator to use |
|
noexcept |
Builds a client configuration object from the set options.
|
inlinenoexcept |
|
staticnoexcept |
Creates a new builder with default Tls options. This requires setting the connection details manually.
|
inlineexplicitnoexcept |
|
noexcept |
Sets the certificate authority for the endpoint you're connecting to. This is a path to a file on disk and must be in PEM format.
caPath | path to the CA file in PEM format |
|
noexcept |
Sets the certificate authority for the endpoint you're connecting to. This is an in-memory buffer and must be in PEM format.
cert | buffer containing the CA certificate in a PEM format |
|
noexcept |
Sets the custom authorizer settings. This function will modify the username, port, and TLS options.
username | The username to use with the custom authorizer. If an empty string is passed, it will check to see if a username has already been set (via WithUsername function). If no username is set then no username will be passed with the MQTT connection. |
authorizerName | The name of the custom authorizer. If an empty string is passed, then 'x-amz-customauthorizer-name' will not be added with the MQTT connection. |
authorizerSignature | The signature of the custom authorizer. NOTE: This will NOT work without the token key name and token value, which requires using the non-depreciated API. |
password | The password to use with the custom authorizer. If null is passed, then no password will be set. |
tokenKeyName
and tokenValue
. This version is left for backwards compatibility purposes.
|
noexcept |
Sets the custom authorizer settings. This function will modify the username, port, and TLS options.
username | The username to use with the custom authorizer. If an empty string is passed, it will check to see if a username has already been set (via WithUsername function). If no username is set then no username will be passed with the MQTT connection. |
authorizerName | The name of the custom authorizer. If an empty string is passed, then 'x-amz-customauthorizer-name' will not be added with the MQTT connection. |
authorizerSignature | The signature of the custom authorizer. If an empty string is passed, then 'x-amz-customauthorizer-signature' will not be added with the MQTT connection. The signature must be based on the private key associated with the custom authorizer. The signature must be base64 encoded. |
password | The password to use with the custom authorizer. If null is passed, then no password will be set. |
tokenKeyName | Used to extract the custom authorizer token from MQTT username query-string properties. Required if the custom authorizer has signing enabled. It is strongly suggested to URL encode this value; the SDK will not do so for you. |
tokenValue | An opaque token value. Required if the custom authorizer has signing enabled. This value must be signed by the private key associated with the custom authorizer and the result placed in the authorizerSignature argument. |
MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithEndpoint | ( | const Crt::String & | endpoint | ) |
Sets endpoint to connect to.
endpoint | endpoint to connect to |
MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithEndpoint | ( | Crt::String && | endpoint | ) |
Sets endpoint to connect to.
endpoint | endpoint to connect to |
|
noexcept |
Sets http proxy options.
proxyOptions | proxy configuration options for connection establishment |
MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithMetricsCollection | ( | bool | enabled | ) |
Whether to send the SDK name and version number in the MQTT CONNECT packet. Default is True.
enabled | true to send SDK version/name in the connect for metrics gathering purposes |
|
noexcept |
Sets the minimum tls version that is acceptable for connection establishment
minimumTlsVersion | minimum tls version allowed in client connections |
|
noexcept |
Sets password for the connection
password | the password that will be passed with the MQTT connection |
|
noexcept |
Overrides the default port. By default, if ALPN is supported, 443 will be used. Otherwise 8883 will be used. If you specify 443 and ALPN is not supported, we will still attempt to connect over 443 without ALPN.
port | port to connect to |
MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithSdkName | ( | const Crt::String & | sdkName | ) |
Overrides the default SDK Name to send as a metric in the MQTT CONNECT packet.
sdkName | string to use as the SDK name parameter in the connection string |
MqttClientConnectionConfigBuilder & Aws::Iot::MqttClientConnectionConfigBuilder::WithSdkVersion | ( | const Crt::String & | sdkVersion | ) |
Overrides the default SDK Version to send as a metric in the MQTT CONNECT packet.
sdkVersion | string to use as the SDK version parameter in the connection string |
|
noexcept |
TCP option: Sets the connect timeout. Defaults to 3 seconds.
connectTimeoutMs | socket connection timeout |
|
noexcept |
TCP option: Enables TCP keep alive. Defaults to off.
|
noexcept |
TCP option: Sets the frequency of sending keep alive probes in seconds once the keep alive timeout expires. Defaults to kernel defaults.
keepAliveIntervalSecs | the frequency of sending keep alive probes in seconds once the keep alive timeout expires |
|
noexcept |
TCP option: Sets the amount of keep alive probes allowed to fail before the connection is terminated. Defaults to kernel defaults.
maxProbes | the amount of keep alive probes allowed to fail before the connection is terminated |
|
noexcept |
TCP option: Sets time before keep alive probes are sent. Defaults to kernel defaults
keepAliveTimeoutSecs | time interval of no activity, in seconds, before keep alive probes get sent |
|
noexcept |
Sets username for the connection
username | the username that will be passed with the MQTT connection |