Skip to content

Commit

Permalink
Update samples for API changes and fix deprecated compile failures
Browse files Browse the repository at this point in the history
  • Loading branch information
Bret Ambrose committed Nov 18, 2024
1 parent 4a69b8a commit 00b1609
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions samples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ project(aws-iot-device-sdk-cpp-v2-samples)

add_subdirectory(device_defender/basic_report)
add_subdirectory(device_defender/mqtt5_basic_report)
add_subdirectory(fleet_provisioning/provision_basic)
add_subdirectory(fleet_provisioning/provision_csr)
add_subdirectory(fleet_provisioning/provision-basic)
add_subdirectory(fleet_provisioning/provision-csr)
add_subdirectory(greengrass/ipc)
add_subdirectory(greengrass/basic_discovery)
add_subdirectory(jobs/jobs-sandbox)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

#include <fstream>

#include "../../utils/CommandLineUtils.h"
#include "../../../utils/CommandLineUtils.h"

using namespace Aws::Crt;
using namespace Aws::Iotidentity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

#include <fstream>

#include "../../utils/CommandLineUtils.h"
#include "../../../utils/CommandLineUtils.h"

using namespace Aws::Crt;
using namespace Aws::Iotidentity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ make && make install
Now build the sample:

``` sh
cd samples/fleet_provisioning/provision_basic
cd samples/fleet_provisioning/provision-basic
mkdir _build
cd _build
cmake -DCMAKE_PREFIX_PATH=<sdk_install_path> ..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <aws/iotidentity/IotIdentityClientV2.h>
#include <aws/iotidentity/RegisterThingRequest.h>
#include <aws/iotidentity/RegisterThingResponse.h>
#include <aws/iotidentity/V2ServiceError.h>
#include <aws/iotidentity/V2ErrorResponse.h>

#include <fstream>

Expand All @@ -27,7 +27,7 @@
using namespace Aws::Crt;
using namespace Aws::Iotidentity;

static void s_onServiceError(const ServiceErrorV2<V2ServiceError> &serviceError, String operationName)
static void s_onServiceError(const ServiceErrorV2<V2ErrorResponse> &serviceError, String operationName)
{
fprintf(
stdout,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ make && make install
Now build the sample:

``` sh
cd samples/fleet_provisioning/provision_csr
cd samples/fleet_provisioning/provision-csr
mkdir _build
cd _build
cmake -DCMAKE_PREFIX_PATH=<sdk_install_path> ..
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <aws/iotidentity/IotIdentityClientV2.h>
#include <aws/iotidentity/RegisterThingRequest.h>
#include <aws/iotidentity/RegisterThingResponse.h>
#include <aws/iotidentity/V2ServiceError.h>
#include <aws/iotidentity/V2ErrorResponse.h>

#include <fstream>

Expand All @@ -27,7 +27,7 @@
using namespace Aws::Crt;
using namespace Aws::Iotidentity;

static void s_onServiceError(const ServiceErrorV2<V2ServiceError> &serviceError, String operationName)
static void s_onServiceError(const ServiceErrorV2<V2ErrorResponse> &serviceError, String operationName)
{
fprintf(
stdout,
Expand Down
4 changes: 2 additions & 2 deletions samples/jobs/jobs-sandbox/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#include <aws/iotjobs/StartNextPendingJobExecutionRequest.h>
#include <aws/iotjobs/UpdateJobExecutionRequest.h>
#include <aws/iotjobs/UpdateJobExecutionResponse.h>
#include <aws/iotjobs/V2ServiceError.h>
#include <aws/iotjobs/V2ErrorResponse.h>

#include <algorithm>
#include <condition_variable>
Expand Down Expand Up @@ -80,7 +80,7 @@ static String s_nibbleNextToken(String &input)
return token;
}

static void s_onServiceError(const ServiceErrorV2<V2ServiceError> &serviceError, String operationName)
static void s_onServiceError(const ServiceErrorV2<V2ErrorResponse> &serviceError, String operationName)
{
fprintf(
stdout,
Expand Down
4 changes: 2 additions & 2 deletions samples/shadow/shadow-sandbox/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <aws/iotshadow/ShadowUpdatedEvent.h>
#include <aws/iotshadow/UpdateShadowRequest.h>
#include <aws/iotshadow/UpdateShadowResponse.h>
#include <aws/iotshadow/V2ServiceError.h>
#include <aws/iotshadow/V2ErrorResponse.h>

#include <algorithm>
#include <condition_variable>
Expand Down Expand Up @@ -77,7 +77,7 @@ static void s_printHelp() {
fprintf(stdout, " update-reported <reported-state-as-JSON> -- updates the reported state of the IoT thing's shadow. If the shadow does not exist, it will be created.\n\n");
}

static void s_onServiceError(const ServiceErrorV2<V2ServiceError> &serviceError, String operationName) {
static void s_onServiceError(const ServiceErrorV2<V2ErrorResponse> &serviceError, String operationName) {
fprintf(stdout, "%s failed with error code: %s\n", operationName.c_str(), aws_error_debug_str(serviceError.GetErrorCode()));
if (serviceError.HasModeledError()) {
const auto &modeledError = serviceError.GetModeledError();
Expand Down

0 comments on commit 00b1609

Please sign in to comment.