Skip to content

Commit

Permalink
fix job sample, and add identity client demo
Browse files Browse the repository at this point in the history
  • Loading branch information
xiazhvera committed Sep 27, 2023
1 parent 18952e2 commit ac0f762
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 2 additions & 0 deletions identity/include/aws/iotidentity/IotIdentityClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <aws/crt/StlAllocator.h>
#include <aws/crt/Types.h>

#include <aws/crt/mqtt/Mqtt5Client.h>
#include <aws/crt/mqtt/MqttClient.h>

namespace Aws
Expand Down Expand Up @@ -60,6 +61,7 @@ namespace Aws
{
public:
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;
Expand Down
7 changes: 7 additions & 0 deletions identity/source/IotIdentityClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ namespace Aws
{
}


IotIdentityClient::IotIdentityClient(const std::shared_ptr<Aws::Crt::Mqtt5::Mqtt5Client> &mqtt5Client)
{
m_connection = Aws::Crt::Mqtt::MqttConnection::NewConnectionFromMqtt5Client(mqtt5Client);

}

IotIdentityClient::operator bool() const noexcept { return m_connection && *m_connection; }

int IotIdentityClient::GetLastError() const noexcept { return aws_last_error(); }
Expand Down
2 changes: 1 addition & 1 deletion jobs/include/aws/iotjobs/IotJobsClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#include <aws/crt/StlAllocator.h>
#include <aws/crt/Types.h>

#include <aws/crt/mqtt/MqttClient.h>
#include <aws/crt/mqtt/Mqtt5Client.h>
#include <aws/crt/mqtt/MqttClient.h>

namespace Aws
{
Expand Down
3 changes: 2 additions & 1 deletion samples/jobs/describe_job_execution/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
#include <aws/crt/UUID.h>
#include <aws/crt/io/HostResolver.h>

#include <aws/iot/MqttClient.h>
#include <aws/crt/mqtt/Mqtt5Client.h>
#include <aws/iot/Mqtt5Client.h>
#include <aws/iot/MqttClient.h>

#include <aws/iotjobs/DescribeJobExecutionRequest.h>
#include <aws/iotjobs/DescribeJobExecutionResponse.h>
Expand Down

0 comments on commit ac0f762

Please sign in to comment.