Skip to content

Commit e05db58

Browse files
authored
Fix Sample Readme (#838)
* improve readme * update service sample * add content table * fix header layer * fix readme link
1 parent 83a6f9f commit e05db58

File tree

14 files changed

+348
-121
lines changed

14 files changed

+348
-121
lines changed

samples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This directory contains sample applications for [aws-iot-device-sdk-cpp-v2](../R
99
* [Others](#others)
1010
* [Instructions](#instructions)
1111
* [Sample Help](#sample-help)
12-
* [Enable Logging](#enable-logging)
12+
* [Enable Logging](#enable-logging-in-samples)
1313

1414

1515
## Samples

samples/mqtt/mqtt5_aws_websocket/README.md

Lines changed: 6 additions & 4 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, and run the cmake commands
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,10 +78,12 @@ 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-
.mqtt5_aws_websocket \
84+
# From samples/mqtt/mqtt5_aws_websocket/, go to the build directory
85+
cd build
86+
./mqtt5_aws_websocket \
8587
--endpoint <AWS IoT endpoint> \
8688
--signing_region <Signing region for websocket connection>
8789
```
@@ -111,4 +113,4 @@ optional arguments:
111113
The sample will not run without the required arguments and will notify you of missing arguments.
112114

113115
## Additional Information
114-
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: 5 additions & 4 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, and run the cmake commands
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,11 @@ 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
87+
cd build
8688
# For a signed custom authorizer
8789
./mqtt5_custom_auth_signed \
8890
--endpoint <AWS IoT endpoint> \
@@ -92,7 +94,6 @@ To Run this sample from the `samples\mqtt\mqtt5_custom_auth_signed` folder, use
9294
--auth_signature <Custom authorizer signature> \
9395
--auth_username <The name to send when connecting through the custom authorizer> \
9496
--auth_password <The password to send when connecting through a custom authorizer>
95-
9697
```
9798

9899
If you would like to see what optional arguments are available, use the `--help` argument:
@@ -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: 5 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, and run the cmake commands
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,11 @@ 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
87+
cd build
8688
./mqtt5_custom_auth_unsigned \
8789
--endpoint <AWS IoT endpoint> \
8890
--authorizer_name <custom authorizer name> \
@@ -115,4 +117,4 @@ optional arguments:
115117
The sample will not run without the required arguments and will notify you of missing arguments.
116118

117119
## Additional Information
118-
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: 5 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, and run the cmake commands
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,11 @@ 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
88+
cd build
8789
./mqtt5_pkcs11 \
8890
--endpoint <AWS IoT endpoint> \
8991
--cert <path to certificate file> \
@@ -179,4 +181,4 @@ The steps to use [SoftHSM2](https://www.opendnssec.org/softhsm/) as the PKCS#11
179181
```
180182

181183
## Additional Information
182-
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: 7 additions & 5 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, and run the cmake commands
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,10 +79,12 @@ cmake --build build --config "Debug"
7979

8080
## How to run
8181

82-
To Run this sample using a direct MQTT connection with a key and certificate, use the following command:
82+
To run this sample, navigate to the build directory where the executable was created:
8383

84-
``` sh
85-
./mqtt5_x509 --endpoint <endpoint> --cert <path to the certificate> --key <path to the private key>
84+
```sh
85+
# From samples/mqtt/mqtt5_x509/, go to the build directory
86+
cd build
87+
./mqtt5_x509 --endpoint <endpoint> --cert <path to the certificate> --key <path to the private key>
8688
```
8789

8890
If you would like to see what optional arguments are available, use the `--help` argument:
@@ -108,4 +110,4 @@ optional arguments:
108110
The sample will not run without the required arguments and will notify you of missing arguments.
109111

110112
## Additional Information
111-
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: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Device Defender
22

3-
[**Return to main sample list**](../../README.md)
3+
[**Return to main sample list**](../../../README.md)
44

55
This sample uses the AWS IoT [Device Defender](https://aws.amazon.com/iot-device-defender/) Service to send on device metrics to AWS. Device Defender is an AWS IoT Core service that allows you to monitor the health of your IoT device through sending periodic updates containing device data to AWS IoT Core.
66

@@ -63,9 +63,23 @@ This sample expects and requires the following custom metrics:
6363
* type `ip-list`
6464
* info: sends a predefined list of documentation IP addresses.
6565

66-
To run the Device Defender sample, use the following command:
66+
## How to build
6767

68-
``` sh
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.
69+
```sh
70+
cd samples/others/device_defender/mqtt5_basic_report/
71+
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
72+
cmake -B build -S . -DCMAKE_PREFIX_PATH="<absolute path sdk-workspace dir>" -DCMAKE_BUILD_TYPE="Debug" .
73+
cmake --build build --config "Debug"
74+
```
75+
76+
## How to run
77+
78+
To run this sample, navigate to the build directory where the executable was created:
79+
80+
```sh
81+
# From samples/others/device_defender/mqtt5_basic_report/, go to the build directory
82+
cd build
6983
./mqtt5-basic-report --endpoint <endpoint> --cert <path to the certificate> --key <path to the private key> --thing_name <thing name>
7084
```
7185

samples/others/secure_tunneling/secure_tunnel/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,30 @@
11
# Secure Tunnel
22

3-
[**Return to main sample list**](../../README.md)
3+
[**Return to main sample list**](../../../README.md)
44

55
This sample uses AWS IoT [Secure Tunneling](https://docs.aws.amazon.com/iot/latest/developerguide/secure-tunneling.html) Service to connect a destination or a source Secure Tunnel Client to an AWS Secure Tunnel endpoint using access tokens using the [V3WebSocketProtocol](https://github.com/aws-samples/aws-iot-securetunneling-localproxy/blob/main/V3WebSocketProtocolGuide.md). For more information, see the [Secure Tunnel Userguide](../../../documents/Secure_Tunnel_Userguide.md)
66

7+
## How to build
8+
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.
10+
```sh
11+
cd samples/others/secure_tunneling/secure_tunnel/
12+
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
13+
cmake -B build -S . -DCMAKE_PREFIX_PATH="<absolute path sdk-workspace dir>" -DCMAKE_BUILD_TYPE="Debug" .
14+
cmake --build build --config "Debug"
15+
```
16+
717
## How to run
818

919
Create a new secure tunnel in the AWS IoT console (https://console.aws.amazon.com/iot/) (AWS IoT/Manage/Tunnels/Create tunnel) and retrieve the destination and source access tokens. (https://docs.aws.amazon.com/iot/latest/developerguide/secure-tunneling-tutorial-open-tunnel.html). Once you have these tokens, you are ready to open a secure tunnel.
1020

1121
### Destination Mode
1222

13-
To run the sample with a destination access token in destination mode (default), you can 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:
1424

15-
``` sh
25+
```sh
26+
# From samples/others/secure_tunneling/secure_tunnel/, go to the build directory
27+
cd build
1628
./secure-tunnel --signing_region <signing_region> --access_token_file <path to destination access token>
1729
```
1830

@@ -22,7 +34,9 @@ The sample will create a Secure Tunnel connection and remain connected in `DESTI
2234

2335
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:
2436

25-
``` sh
37+
```sh
38+
# From samples/others/secure_tunneling/secure_tunnel/, go to the build directory
39+
cd build
2640
./secure-tunnel --signing_region <signing_region> --access_token_file <path to source access token> --local_proxy_mode_source
2741
```
2842

samples/others/secure_tunneling/tunnel_notification/README.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Secure Tunnel Notification
22

3-
[**Return to main sample list**](../../README.md)
3+
[**Return to main sample list**](../../../README.md)
44

55
This sample uses an MQTT Client and the AWS IoT [Secure Tunneling](https://docs.aws.amazon.com/iot/latest/developerguide/secure-tunneling.html) Service to receive a tunnel notification and then connects to the Secure Tunnel using a Secure Tunnel Client.
66

@@ -57,9 +57,23 @@ Note that in a real application, you may want to avoid the use of wildcards in y
5757

5858
</details>
5959

60+
## How to build
61+
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.
63+
```sh
64+
cd samples/others/secure_tunneling/tunnel_notification/
65+
# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here
66+
cmake -B build -S . -DCMAKE_PREFIX_PATH="<absolute path sdk-workspace dir>" -DCMAKE_BUILD_TYPE="Debug" .
67+
cmake --build build --config "Debug"
68+
```
69+
6070
## How to run
61-
To Run this sample, use the following command:
62-
``` sh
71+
72+
To run this sample, navigate to the build directory where the executable was created:
73+
74+
```sh
75+
# From samples/others/secure_tunneling/tunnel_notification/, go to the build directory
76+
cd build
6377
./tunnel-notification --endpoint <endpoint> --cert <path to the certificate> --key <path to the private key> --thing_name <thing name>
6478
```
6579
Once the MQTT Client is connected, create a new secure tunnel in the AWS IoT console (https://console.aws.amazon.com/iot/) (AWS IoT/Manage/Tunnels/Create tunnel) for the Thing.

0 commit comments

Comments
 (0)