Skip to content

Commit 4a62a87

Browse files
committed
update service sample
1 parent 2a4452b commit 4a62a87

File tree

13 files changed

+193
-96
lines changed

13 files changed

+193
-96
lines changed

samples/mqtt/mqtt5_aws_websocket/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Note that in a real application, you may want to avoid the use of wildcards in y
6868

6969
## How to build
7070

71-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/mqtt/mqtt5_aws_websocket/build` folder.
71+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/mqtt/mqtt5_aws_websocket/build` folder.
7272
```sh
7373
cd samples/mqtt/mqtt5_aws_websocket/
7474
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
@@ -78,9 +78,10 @@ cmake --build build --config "Debug"
7878

7979
## How to run
8080

81-
To run this sample from the `samples/mqtt/mqtt5_aws_websocket` folder, use the following command:
81+
To run this sample, navigate to the build directory where the executable was created:
8282

8383
```sh
84+
# From samples/mqtt/mqtt5_aws_websocket/, go to the build directory
8485
cd build
8586
./mqtt5_aws_websocket \
8687
--endpoint <AWS IoT endpoint> \
@@ -112,4 +113,4 @@ optional arguments:
112113
The sample will not run without the required arguments and will notify you of missing arguments.
113114

114115
## Additional Information
115-
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.
116+
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.

samples/mqtt/mqtt5_custom_auth_signed/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Note that in a real application, you may want to avoid the use of wildcards in y
7070

7171
## How to build
7272

73-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/mqtt/mqtt5_custom_auth_signed/build` folder.
73+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/mqtt/mqtt5_custom_auth_signed/build` folder.
7474
```sh
7575
cd samples/mqtt/mqtt5_custom_auth_signed/
7676
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
@@ -80,9 +80,10 @@ cmake --build build --config "Debug"
8080

8181
## How to run
8282

83-
To run this sample from the `samples/mqtt/mqtt5_custom_auth_signed` folder, use the following command:
83+
To run this sample, navigate to the build directory where the executable was created:
8484

8585
```sh
86+
# From samples/mqtt/mqtt5_custom_auth_signed/, go to the build directory
8687
cd build
8788
# For a signed custom authorizer
8889
./mqtt5_custom_auth_signed \
@@ -122,4 +123,4 @@ optional arguments:
122123
The sample will not run without the required arguments and will notify you of missing arguments.
123124

124125
## Additional Information
125-
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.
126+
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.

samples/mqtt/mqtt5_custom_auth_unsigned/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Note that in a real application, you may want to avoid the use of wildcards in y
7070

7171
## How to build
7272

73-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/mqtt/mqtt5_custom_auth_unsigned/build` folder.
73+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/mqtt/mqtt5_custom_auth_unsigned/build` folder.
7474
```sh
7575
cd samples/mqtt/mqtt5_custom_auth_unsigned/
7676
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
@@ -80,9 +80,10 @@ cmake --build build --config "Debug"
8080

8181
## How to run
8282

83-
To run this sample from the `samples/mqtt/mqtt5_custom_auth_unsigned` folder, use the following command:
83+
To run this sample, navigate to the build directory where the executable was created:
8484

8585
```sh
86+
# From samples/mqtt/mqtt5_custom_auth_unsigned/, go to the build directory
8687
cd build
8788
./mqtt5_custom_auth_unsigned \
8889
--endpoint <AWS IoT endpoint> \
@@ -116,4 +117,4 @@ optional arguments:
116117
The sample will not run without the required arguments and will notify you of missing arguments.
117118

118119
## Additional Information
119-
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.
120+
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.

samples/mqtt/mqtt5_pkcs11/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ Note that in a real application, you may want to avoid the use of wildcards in y
7171

7272
## How to build
7373

74-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/mqtt/mqtt5_pkcs11/build` folder.
74+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/mqtt/mqtt5_pkcs11/build` folder.
7575
```sh
7676
cd samples/mqtt/mqtt5_pkcs11/
7777
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
@@ -81,9 +81,10 @@ cmake --build build --config "Debug"
8181

8282
## How to run
8383

84-
To run this sample from the `samples/mqtt/mqtt5_pkcs11` folder, use the following command:
84+
To run this sample, navigate to the build directory where the executable was created:
8585

8686
```sh
87+
# From samples/mqtt/mqtt5_pkcs11/, go to the build directory
8788
cd build
8889
./mqtt5_pkcs11 \
8990
--endpoint <AWS IoT endpoint> \
@@ -180,4 +181,4 @@ The steps to use [SoftHSM2](https://www.opendnssec.org/softhsm/) as the PKCS#11
180181
```
181182

182183
## Additional Information
183-
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.
184+
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.

samples/mqtt/mqtt5_x509/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Note that in a real application, you may want to avoid the use of wildcards in y
6969

7070
## How to build
7171

72-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/mqtt/mqtt5_x509/build` folder.
72+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/mqtt/mqtt5_x509/build` folder.
7373
```sh
7474
cd samples/mqtt/mqtt5_x509/
7575
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
@@ -79,9 +79,10 @@ cmake --build build --config "Debug"
7979

8080
## How to run
8181

82-
To run this sample from the `samples/mqtt/mqtt5_x509` folder, use the following command:
82+
To run this sample, navigate to the build directory where the executable was created:
8383

8484
```sh
85+
# From samples/mqtt/mqtt5_x509/, go to the build directory
8586
cd build
8687
./mqtt5_x509 --endpoint <endpoint> --cert <path to the certificate> --key <path to the private key>
8788
```
@@ -109,4 +110,4 @@ optional arguments:
109110
The sample will not run without the required arguments and will notify you of missing arguments.
110111

111112
## Additional Information
112-
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.
113+
Additional help with the MQTT5 Client can be found in the [MQTT5 Userguide](../../../documents/MQTT5_Userguide.md). This guide will provide more details on MQTT5 [operations](../../../documents/MQTT5_Userguide.md#client-operations), [lifecycle events](../../../documents/MQTT5_Userguide.md#client-lifecycle-management), [connection methods](../../../documents/MQTT5_Userguide.md#connecting-to-aws-iot-core), and other useful information.

samples/others/device_defender/mqtt5_basic_report/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This sample expects and requires the following custom metrics:
6565

6666
## How to build
6767

68-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/others/device_defender/mqtt5_basic_report/build` folder.
68+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/others/device_defender/mqtt5_basic_report/build` folder.
6969
```sh
7070
cd samples/others/device_defender/mqtt5_basic_report/
7171
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
@@ -75,9 +75,10 @@ cmake --build build --config "Debug"
7575

7676
## How to run
7777

78-
To run this sample from the `samples/others/device_defender/mqtt5_basic_report` folder, use the following command:
78+
To run this sample, navigate to the build directory where the executable was created:
7979

8080
```sh
81+
# From samples/others/device_defender/mqtt5_basic_report/, go to the build directory
8182
cd build
8283
./mqtt5-basic-report --endpoint <endpoint> --cert <path to the certificate> --key <path to the private key> --thing_name <thing name>
8384
```

samples/others/secure_tunneling/secure_tunnel/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This sample uses AWS IoT [Secure Tunneling](https://docs.aws.amazon.com/iot/late
66

77
## How to build
88

9-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/others/secure_tunneling/secure_tunnel/build` folder.
9+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/others/secure_tunneling/secure_tunnel/build` folder.
1010
```sh
1111
cd samples/others/secure_tunneling/secure_tunnel/
1212
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
@@ -20,9 +20,10 @@ Create a new secure tunnel in the AWS IoT console (https://console.aws.amazon.co
2020

2121
### Destination Mode
2222

23-
To run the sample with a destination access token in destination mode (default) from the `samples/others/secure_tunneling/secure_tunnel` folder, use the following command:
23+
To run the sample with a destination access token in destination mode (default), navigate to the build directory where the executable was created:
2424

2525
```sh
26+
# From samples/others/secure_tunneling/secure_tunnel/, go to the build directory
2627
cd build
2728
./secure-tunnel --signing_region <signing_region> --access_token_file <path to destination access token>
2829
```
@@ -34,6 +35,7 @@ The sample will create a Secure Tunnel connection and remain connected in `DESTI
3435
While the focus of the Secure Tunnel Client for the IoT Device SDK is to connect with Secure Tunnels in `DESTINATION MODE` we also support connecting in `SOURCE MODE`. The token file should be the Source Token in this instance and you must add the `--local_proxy_mode_source` flag:
3536

3637
```sh
38+
# From samples/others/secure_tunneling/secure_tunnel/, go to the build directory
3739
cd build
3840
./secure-tunnel --signing_region <signing_region> --access_token_file <path to source access token> --local_proxy_mode_source
3941
```

samples/others/secure_tunneling/tunnel_notification/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Note that in a real application, you may want to avoid the use of wildcards in y
5959

6060
## How to build
6161

62-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/others/secure_tunneling/tunnel_notification/build` folder.
62+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/others/secure_tunneling/tunnel_notification/build` folder.
6363
```sh
6464
cd samples/others/secure_tunneling/tunnel_notification/
6565
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
@@ -69,9 +69,10 @@ cmake --build build --config "Debug"
6969

7070
## How to run
7171

72-
To run this sample from the `samples/others/secure_tunneling/tunnel_notification` folder, use the following command:
72+
To run this sample, navigate to the build directory where the executable was created:
7373

7474
```sh
75+
# From samples/others/secure_tunneling/tunnel_notification/, go to the build directory
7576
cd build
7677
./tunnel-notification --endpoint <endpoint> --cert <path to the certificate> --key <path to the private key> --thing_name <thing name>
7778
```

samples/service_clients/commands/commands-sandbox/README.md

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[**Return to main sample list**](../../README.md)
44

5+
## Introduction
56
This is a semi-interactive sample that allows you to use the AWS IoT [Commands](https://docs.aws.amazon.com/iot/latest/developerguide/iot-remote-command.html)
67
service to receive and process remote instructions.
78

@@ -57,7 +58,7 @@ Miscellaneous
5758
* close-stream <stream-id> - close a specified stream; <stream-id> is internal ID that can be found with 'list-streams'
5859
* quit - quit the sample application
5960

60-
### Prerequisites
61+
## Prerequisites
6162
Your IoT Core Thing's [Policy](https://docs.aws.amazon.com/iot/latest/developerguide/iot-policies.html) must provide privileges for this sample to connect, subscribe, publish, and receive
6263
in order to perform its data plane operations. Below is a sample policy that can be used on your IoT Core Thing that will
6364
allow this sample to run as intended.
@@ -141,9 +142,10 @@ Replace with the following with the data from your AWS account:
141142

142143
</details>
143144

144-
## Building and Running the Sample
145+
## Walkthrough
145146

146-
### Install the SDK
147+
### Run the sample
148+
#### Install the SDK
147149
Before building and running the sample, you must first build and install the SDK:
148150

149151
```shell
@@ -152,20 +154,21 @@ cmake -S . -B build/ -DCMAKE_INSTALL_PREFIX=<sdk_install_path>
152154
cmake --build build/ --target install
153155
```
154156

155-
### How to build
157+
#### How to build
156158

157-
To build the sample, change directory into the samples folder and run the cmake commands. The sample executable will be built under `samples/service_clients/commands/commands-sandbox/build` folder.
159+
To build the sample, change directory into the sample's folder and run the cmake commands. The sample executable will be built into the `samples/service_clients/commands/commands-sandbox/build` folder.
158160
```sh
159161
cd samples/service_clients/commands/commands-sandbox/
160162
cmake -S . -B build/ -DCMAKE_PREFIX_PATH=<sdk_install_path>
161163
cmake --build build/
162164
```
163165

164-
### How to run
166+
#### How to run
165167

166-
To run this sample from the `samples/service_clients/commands/commands-sandbox` folder, use the following command:
168+
To run this sample, navigate to the build directory where the executable was created:
167169

168170
```sh
171+
# From samples/service_clients/commands/commands-sandbox/, go to the build directory
169172
cd build
170173
./commands-sandbox \
171174
--endpoint <endpoint> \
@@ -527,3 +530,13 @@ distinguishes only JSON and CBOR, all other payload format will be routed to th
527530
separate thread(s).
528531
3. If your application is expected to receive a lot of AWS IoT commands, monitor the number of them enqueued for processing.
529532
Consider introducing priorities based on AWS IoT command timeouts or some internal value.
533+
534+
## ⚠️ Usage disclaimer
535+
536+
These code examples interact with services that may incur charges to your AWS account. For more information, see [AWS Pricing](https://aws.amazon.com/pricing/).
537+
538+
Additionally, example code might theoretically modify or delete existing AWS resources. As a matter of due diligence, do the following:
539+
540+
- Be aware of the resources that these examples create or delete.
541+
- Be aware of the costs that might be charged to your account as a result.
542+
- Back up your important data.

0 commit comments

Comments
 (0)