AWS IoT Device SDK C++ v2  1.34.0
AWS IoT Device SDK C++ v2
Public Member Functions | List of all members
Aws::Iotidentity::IotIdentityClient Class Referencefinal

#include <IotIdentityClient.h>

Public Member Functions

 IotIdentityClient (const std::shared_ptr< Aws::Crt::Mqtt::MqttConnection > &connection)
 
 IotIdentityClient (const std::shared_ptr< Aws::Crt::Mqtt5::Mqtt5Client > &mqtt5Client)
 
 operator bool () const noexcept
 
int GetLastError () const noexcept
 
bool SubscribeToCreateCertificateFromCsrAccepted (const Aws::Iotidentity::CreateCertificateFromCsrSubscriptionRequest &request, Aws::Crt::Mqtt::QOS qos, const OnSubscribeToCreateCertificateFromCsrAcceptedResponse &handler, const OnSubscribeComplete &onSubAck)
 
bool SubscribeToCreateCertificateFromCsrRejected (const Aws::Iotidentity::CreateCertificateFromCsrSubscriptionRequest &request, Aws::Crt::Mqtt::QOS qos, const OnSubscribeToCreateCertificateFromCsrRejectedResponse &handler, const OnSubscribeComplete &onSubAck)
 
bool SubscribeToCreateKeysAndCertificateAccepted (const Aws::Iotidentity::CreateKeysAndCertificateSubscriptionRequest &request, Aws::Crt::Mqtt::QOS qos, const OnSubscribeToCreateKeysAndCertificateAcceptedResponse &handler, const OnSubscribeComplete &onSubAck)
 
bool SubscribeToCreateKeysAndCertificateRejected (const Aws::Iotidentity::CreateKeysAndCertificateSubscriptionRequest &request, Aws::Crt::Mqtt::QOS qos, const OnSubscribeToCreateKeysAndCertificateRejectedResponse &handler, const OnSubscribeComplete &onSubAck)
 
bool SubscribeToRegisterThingAccepted (const Aws::Iotidentity::RegisterThingSubscriptionRequest &request, Aws::Crt::Mqtt::QOS qos, const OnSubscribeToRegisterThingAcceptedResponse &handler, const OnSubscribeComplete &onSubAck)
 
bool SubscribeToRegisterThingRejected (const Aws::Iotidentity::RegisterThingSubscriptionRequest &request, Aws::Crt::Mqtt::QOS qos, const OnSubscribeToRegisterThingRejectedResponse &handler, const OnSubscribeComplete &onSubAck)
 
bool PublishCreateCertificateFromCsr (const Aws::Iotidentity::CreateCertificateFromCsrRequest &request, Aws::Crt::Mqtt::QOS qos, const OnPublishComplete &onPubAck)
 
bool PublishCreateKeysAndCertificate (const Aws::Iotidentity::CreateKeysAndCertificateRequest &request, Aws::Crt::Mqtt::QOS qos, const OnPublishComplete &onPubAck)
 
bool PublishRegisterThing (const Aws::Iotidentity::RegisterThingRequest &request, Aws::Crt::Mqtt::QOS qos, const OnPublishComplete &onPubAck)
 

Detailed Description

An AWS IoT service that assists with provisioning a device and installing unique client certificates on it

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html

Constructor & Destructor Documentation

◆ IotIdentityClient() [1/2]

Aws::Iotidentity::IotIdentityClient::IotIdentityClient ( const std::shared_ptr< Aws::Crt::Mqtt::MqttConnection > &  connection)

◆ IotIdentityClient() [2/2]

Aws::Iotidentity::IotIdentityClient::IotIdentityClient ( const std::shared_ptr< Aws::Crt::Mqtt5::Mqtt5Client > &  mqtt5Client)

Member Function Documentation

◆ GetLastError()

int Aws::Iotidentity::IotIdentityClient::GetLastError ( ) const
noexcept

◆ operator bool()

Aws::Iotidentity::IotIdentityClient::operator bool ( ) const
noexcept

◆ PublishCreateCertificateFromCsr()

bool Aws::Iotidentity::IotIdentityClient::PublishCreateCertificateFromCsr ( const Aws::Iotidentity::CreateCertificateFromCsrRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnPublishComplete onPubAck 
)

Creates a certificate from a certificate signing request (CSR). AWS IoT provides client certificates that are signed by the Amazon Root certificate authority (CA). The new certificate has a PENDING_ACTIVATION status. When you call RegisterThing to provision a thing with this certificate, the certificate status changes to ACTIVE or INACTIVE as described in the template.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Publish a CreateCertificateFromCsr message. If the device is offline, the PUBLISH packet will be sent once the connection resumes.

Parameters
requestMessage to be serialized and sent
qosQuality of Service for delivering this message
onPubAckcallback when the publish "completes" (see below)
Returns
true if the message was successfully queued for publication, false if there was an error
  • For QoS 0, completes as soon as the packet is sent.
  • For QoS 1, completes when PUBACK is received.
  • QoS 2 is not supported by AWS IoT.

◆ PublishCreateKeysAndCertificate()

bool Aws::Iotidentity::IotIdentityClient::PublishCreateKeysAndCertificate ( const Aws::Iotidentity::CreateKeysAndCertificateRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnPublishComplete onPubAck 
)

Creates new keys and a certificate. AWS IoT provides client certificates that are signed by the Amazon Root certificate authority (CA). The new certificate has a PENDING_ACTIVATION status. When you call RegisterThing to provision a thing with this certificate, the certificate status changes to ACTIVE or INACTIVE as described in the template.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Publish a CreateKeysAndCertificate message. If the device is offline, the PUBLISH packet will be sent once the connection resumes.

Parameters
requestMessage to be serialized and sent
qosQuality of Service for delivering this message
onPubAckcallback when the publish "completes" (see below)
Returns
true if the message was successfully queued for publication, false if there was an error
  • For QoS 0, completes as soon as the packet is sent.
  • For QoS 1, completes when PUBACK is received.
  • QoS 2 is not supported by AWS IoT.

◆ PublishRegisterThing()

bool Aws::Iotidentity::IotIdentityClient::PublishRegisterThing ( const Aws::Iotidentity::RegisterThingRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnPublishComplete onPubAck 
)

Provisions an AWS IoT thing using a pre-defined template.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Publish a RegisterThing message. If the device is offline, the PUBLISH packet will be sent once the connection resumes.

Parameters
requestMessage to be serialized and sent
qosQuality of Service for delivering this message
onPubAckcallback when the publish "completes" (see below)
Returns
true if the message was successfully queued for publication, false if there was an error
  • For QoS 0, completes as soon as the packet is sent.
  • For QoS 1, completes when PUBACK is received.
  • QoS 2 is not supported by AWS IoT.

◆ SubscribeToCreateCertificateFromCsrAccepted()

bool Aws::Iotidentity::IotIdentityClient::SubscribeToCreateCertificateFromCsrAccepted ( const Aws::Iotidentity::CreateCertificateFromCsrSubscriptionRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnSubscribeToCreateCertificateFromCsrAcceptedResponse handler,
const OnSubscribeComplete onSubAck 
)

Subscribes to the accepted topic of the CreateCertificateFromCsr operation.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Subscribe to CreateCertificateFromCsrAccepted messages

Once subscribed, handler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

Parameters
requestSubscription request configuration
qosMaximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK
handlercallback function to invoke with messages received on the subscription topic
onSubAckcallback function invoked on receipt of the SUBACK from the server
Returns
true if the subscribe was successfully queued, false if there was an error doing so

◆ SubscribeToCreateCertificateFromCsrRejected()

bool Aws::Iotidentity::IotIdentityClient::SubscribeToCreateCertificateFromCsrRejected ( const Aws::Iotidentity::CreateCertificateFromCsrSubscriptionRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnSubscribeToCreateCertificateFromCsrRejectedResponse handler,
const OnSubscribeComplete onSubAck 
)

Subscribes to the rejected topic of the CreateCertificateFromCsr operation.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Subscribe to CreateCertificateFromCsrRejected messages

Once subscribed, handler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

Parameters
requestSubscription request configuration
qosMaximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK
handlercallback function to invoke with messages received on the subscription topic
onSubAckcallback function invoked on receipt of the SUBACK from the server
Returns
true if the subscribe was successfully queued, false if there was an error doing so

◆ SubscribeToCreateKeysAndCertificateAccepted()

bool Aws::Iotidentity::IotIdentityClient::SubscribeToCreateKeysAndCertificateAccepted ( const Aws::Iotidentity::CreateKeysAndCertificateSubscriptionRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnSubscribeToCreateKeysAndCertificateAcceptedResponse handler,
const OnSubscribeComplete onSubAck 
)

Subscribes to the accepted topic of the CreateKeysAndCertificate operation.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Subscribe to CreateKeysAndCertificateAccepted messages

Once subscribed, handler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

Parameters
requestSubscription request configuration
qosMaximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK
handlercallback function to invoke with messages received on the subscription topic
onSubAckcallback function invoked on receipt of the SUBACK from the server
Returns
true if the subscribe was successfully queued, false if there was an error doing so

◆ SubscribeToCreateKeysAndCertificateRejected()

bool Aws::Iotidentity::IotIdentityClient::SubscribeToCreateKeysAndCertificateRejected ( const Aws::Iotidentity::CreateKeysAndCertificateSubscriptionRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnSubscribeToCreateKeysAndCertificateRejectedResponse handler,
const OnSubscribeComplete onSubAck 
)

Subscribes to the rejected topic of the CreateKeysAndCertificate operation.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Subscribe to CreateKeysAndCertificateRejected messages

Once subscribed, handler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

Parameters
requestSubscription request configuration
qosMaximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK
handlercallback function to invoke with messages received on the subscription topic
onSubAckcallback function invoked on receipt of the SUBACK from the server
Returns
true if the subscribe was successfully queued, false if there was an error doing so

◆ SubscribeToRegisterThingAccepted()

bool Aws::Iotidentity::IotIdentityClient::SubscribeToRegisterThingAccepted ( const Aws::Iotidentity::RegisterThingSubscriptionRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnSubscribeToRegisterThingAcceptedResponse handler,
const OnSubscribeComplete onSubAck 
)

Subscribes to the accepted topic of the RegisterThing operation.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Subscribe to RegisterThingAccepted messages

Once subscribed, handler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

Parameters
requestSubscription request configuration
qosMaximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK
handlercallback function to invoke with messages received on the subscription topic
onSubAckcallback function invoked on receipt of the SUBACK from the server
Returns
true if the subscribe was successfully queued, false if there was an error doing so

◆ SubscribeToRegisterThingRejected()

bool Aws::Iotidentity::IotIdentityClient::SubscribeToRegisterThingRejected ( const Aws::Iotidentity::RegisterThingSubscriptionRequest request,
Aws::Crt::Mqtt::QOS  qos,
const OnSubscribeToRegisterThingRejectedResponse handler,
const OnSubscribeComplete onSubAck 
)

Subscribes to the rejected topic of the RegisterThing operation.

https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#fleet-provision-api

Subscribe to RegisterThingRejected messages

Once subscribed, handler is invoked each time a message matching the topic is received. It is possible for such messages to arrive before the SUBACK is received.

Parameters
requestSubscription request configuration
qosMaximum requested QoS that server may use when sending messages to the client. The server may grant a lower QoS in the SUBACK
handlercallback function to invoke with messages received on the subscription topic
onSubAckcallback function invoked on receipt of the SUBACK from the server
Returns
true if the subscribe was successfully queued, false if there was an error doing so

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