|
1 | | -# MQTT5 X509 |
| 1 | +# MQTT5 X509 PubSub |
2 | 2 |
|
3 | 3 | [**Return to main sample list**](../../README.md) |
4 | 4 |
|
| 5 | +*__Jump To:__* |
| 6 | +* [Introduction](#introduction) |
| 7 | +* [Requirements](#requirements) |
| 8 | +* [How To Build](#how-to-build) |
| 9 | +* [How To Run](#how-to-run) |
| 10 | +* [Additional Information](#additional-information) |
| 11 | + |
| 12 | +## Introduction |
5 | 13 | This sample uses the |
6 | 14 | [Message Broker](https://docs.aws.amazon.com/iot/latest/developerguide/iot-message-broker.html) |
7 | 15 | for AWS IoT to send and receive messages through an MQTT connection using MQTT5. |
8 | 16 |
|
9 | | -MQTT5 introduces additional features and enhancements that improve the development experience with MQTT. You can read more about MQTT5 in the C++ V2 SDK by checking out the [MQTT5 user guide](../../../documents/MQTT5_Userguide.md). |
| 17 | +You can read more about MQTT5 for the CPP IoT Device SDK V2 in the [MQTT5 user guide](../../../documents/MQTT5_Userguide.md). |
| 18 | + |
| 19 | +## Requirements |
| 20 | +This sample assumes you have the required AWS IoT resources available. Information about AWS IoT can be found [HERE](https://docs.aws.amazon.com/iot/latest/developerguide/what-is-aws-iot.html) and instructions on creating AWS IoT resources (AWS IoT Policy, Device Certificate, Private Key) can be found [HERE](https://docs.aws.amazon.com/iot/latest/developerguide/create-iot-resources.html). |
10 | 21 |
|
11 | 22 | 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. Below is a sample policy that can be used on your IoT Core Thing that will allow this sample to run as intended. |
12 | 23 |
|
@@ -52,21 +63,16 @@ Replace with the following with the data from your AWS account: |
52 | 63 | * `<region>`: The AWS IoT Core region where you created your AWS IoT Core thing you wish to use with this sample. For example `us-east-1`. |
53 | 64 | * `<account>`: Your AWS IoT Core account ID. This is the set of numbers in the top right next to your AWS account name when using the AWS IoT Core website. |
54 | 65 |
|
55 | | -Note that in a real application, you may want to avoid the use of wildcards in your ClientID or use them selectively. Please follow best practices when working with AWS on production applications using the SDK. Also, for the purposes of this sample, please make sure your policy allows a client ID of `test-*` to connect or use `--client_id <client ID here>` to send the client ID your policy supports. |
| 66 | +Note that in a real application, you may want to avoid the use of wildcards in your ClientID or use them selectively. Please follow best practices when working with AWS on production applications using the SDK. Also, for the purposes of this sample, please make sure your policy allows a client ID of `mqtt5-sample-*` to connect or use `--client_id <client ID here>` to send the client ID your policy supports. |
56 | 67 |
|
57 | 68 | </details> |
58 | 69 |
|
59 | 70 | ## How to build |
60 | | -**Build the SDK** |
61 | | - |
62 | | -Follow the instruction on https://github.com/aws/aws-iot-device-sdk-cpp-v2/blob/main/README.md#installation |
63 | | - |
64 | | -**Build the sample** |
65 | 71 |
|
66 | | -Change directory into the samples, and build the sample |
| 72 | +To build the sample, change directory into the samples, and run the cmake commands |
67 | 73 | ```sh |
68 | | -# If you followed the build instruction above, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` |
69 | 74 | cd samples/mqtt/mqtt5_x509/ |
| 75 | +# If you followed the SDK build instruction, you would use the path to `sdk-workspace` folder for `CMAKE_PREFIX_PATH` here |
70 | 76 | cmake -B build -S . -DCMAKE_PREFIX_PATH="<absolute path sdk-workspace dir>" -DCMAKE_BUILD_TYPE="Debug" . |
71 | 77 | cmake --build build --config "Debug" |
72 | 78 | ``` |
@@ -102,4 +108,4 @@ optional arguments: |
102 | 108 | The sample will not run without the required arguments and will notify you of missing arguments. |
103 | 109 |
|
104 | 110 | ## Additional Information |
105 | | -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. |
| 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. |
0 commit comments