Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
subscribe_publish_cpp_sample.cpp File Reference
simple MQTT publish and subscribe on the same topic in C++ More...
Go to the source code of this file.
Variables | |
| char | cPayload [100] |
| Default cert location. | |
| uint32_t | publishCount = 0 |
| This parameter will avoid infinite loop of publish and exit the program after certain number of publishes. | |
Detailed Description
simple MQTT publish and subscribe on the same topic in C++
This example takes the parameters from the aws_iot_config.h file and establishes a connection to the AWS IoT MQTT Platform. It subscribes and publishes to the same topic - "sdkTest/sub"
If all the certs are correct, you should see the messages received by the application in a loop.
The application takes in the certificate path, host name , port and the number of times the publish should happen.
Definition in file subscribe_publish_cpp_sample.cpp.
Variable Documentation
| char cPayload[100] |
Default cert location.
Definition at line 31 of file subscribe_publish_cpp_sample.cpp.
| uint32_t publishCount = 0 |
This parameter will avoid infinite loop of publish and exit the program after certain number of publishes.
Definition at line 39 of file subscribe_publish_cpp_sample.cpp.
Generated on Tue Jul 12 2022 19:02:38 by
1.7.2