Skip to content

Commit 72d9188

Browse files
committed
Updating_sample_docs
1 parent 249cf06 commit 72d9188

5 files changed

Lines changed: 12 additions & 10 deletions

File tree

documents/MQTT5_Userguide.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
* [Direct MQTT with X509-based mutual TLS](#direct-mqtt-with-x509-based-mutual-tls)
2020
* [MQTT over Websockets with Sigv4 authentication](#mqtt-over-websockets-with-sigv4-authentication)
2121
* [Direct MQTT with Custom Authentication](#direct-mqtt-with-custom-authentication)
22-
* [Direct MQTT with PKCS11](#direct-mqtt-with-pkcs11-method)
23-
* [Direct MQTT with PKCS12](#direct-mqtt-with-pkcs12-method)
22+
* [Direct MQTT with PKCS11 (Unix Only)](#direct-mqtt-with-pkcs11-method-unix-only)
23+
* [Direct MQTT with PKCS12 (macOS Only)](#direct-mqtt-with-pkcs12-method-macos-only)
2424
* [Direct MQTT with Windows Certificate Store Method](#direct-mqtt-with-windows-certificate-store-method)
2525
* [HTTP Proxy](#http-proxy)
2626
* [Browser](#browser)
@@ -263,7 +263,7 @@ token-signing fields to the value of the username that you assign within the cus
263263
add any custom authentication related values to the username in the CONNECT configuration optionally attached to the client configuration.
264264
The builder will do everything for you.
265265

266-
#### Direct MQTT with PKCS11 Method
266+
#### Direct MQTT with PKCS11 Method (Unix Only)
267267

268268
A MQTT5 direct connection can be made using a PKCS11 device rather than using a PEM encoded private key, the private key for mutual TLS is stored on a PKCS#11 compatible smart card or Hardware Security Module (HSM). To create a MQTT5 builder configured for this connection, see the following code:
269269

@@ -286,7 +286,7 @@ A MQTT5 direct connection can be made using a PKCS11 device rather than using a
286286

287287
Note: Currently, TLS integration with PKCS#11 is only available on Unix devices.
288288

289-
#### Direct MQTT with PKCS12 Method
289+
#### Direct MQTT with PKCS12 Method (macOS only)
290290

291291
A MQTT5 direct connection can be made using a PKCS12 file rather than using a PEM encoded private key. To create a MQTT5 builder configured for this connection, see the following code:
292292

samples/browser/pub_sub_mqtt5/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ function createClient(provider: AWSCognitoCredentialsProvider) : mqtt5.Mqtt5Clie
7979
)
8080

8181
builder.withConnectProperties({
82-
clientId: "test-" + Math.floor(Math.random() * 100000000)
82+
clientId: "test-" + Math.floor(Math.random() * 100000000),
83+
keepAliveIntervalSeconds: 1200
8384
});
8485

8586
let client : mqtt5.Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());

samples/browser/react_sample/src/PubSub5.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function createClient(provider: AWSCognitoCredentialsProvider) : mqtt5.Mqtt5Clie
8080
);
8181
builder.withConnectProperties({
8282
clientId: "test-" + Math.floor(Math.random() * 100000000),
83-
keepAliveIntervalSeconds: 30 // Mandatory field added
83+
keepAliveIntervalSeconds: 1200
8484
});
8585

8686
let client : mqtt5.Mqtt5Client = new mqtt5.Mqtt5Client(builder.build());
@@ -190,12 +190,12 @@ function Mqtt5() {
190190
async function PublishMessage()
191191
{
192192
const msg = `BUTTON CLICKED {${user_msg_count}}`;
193-
const publishResult = await client.publish({
193+
await client.publish({
194194
qos: mqtt5.QoS.AtLeastOnce,
195195
topicName: qos1Topic,
196196
payload: msg
197197
})
198-
.then (() =>
198+
.then ((publishResult) =>
199199
{
200200
log('Button Clicked, Publish result: ' + JSON.stringify(publishResult));
201201
})

samples/browser/react_sample/webpack.config.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ module.exports = {
1313
fallback:
1414
{
1515
"url": require.resolve("url/"),
16-
"util": require.resolve("util/")
16+
"util": require.resolve("util/"),
17+
"events": require.resolve("events/")
1718
}
1819
},
1920
module: {

samples/node/mqtt/mqtt5_aws_websocket/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ Note that in a real application, you may want to avoid the use of wildcards in y
6767

6868
## How to run
6969

70-
To Run this sample from the `samples/node/mqtt/aws_websocket` folder, use the following command:
70+
To Run this sample from the `samples/node/mqtt/mqtt5_aws_websocket` folder, use the following command:
7171

7272
```sh
7373
npm install

0 commit comments

Comments
 (0)