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_library_sample.c File Reference
simple MQTT publish and subscribe on the same topic using the SDK as a library More...
Go to the source code of this file.
Variables | |
| char | certDirectory [PATH_MAX+1] = "../../../certs" |
| Default cert location. | |
| char | HostAddress [HOST_ADDRESS_SIZE] = AWS_IOT_MQTT_HOST |
| Default MQTT HOST URL is pulled from the aws_iot_config.h. | |
| uint32_t | port = AWS_IOT_MQTT_PORT |
| Default MQTT port is pulled from the aws_iot_config.h. | |
| 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 using the SDK as a library
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_library_sample.c.
Variable Documentation
| char certDirectory[PATH_MAX+1] = "../../../certs" |
Default cert location.
Definition at line 45 of file subscribe_publish_library_sample.c.
| char HostAddress[HOST_ADDRESS_SIZE] = AWS_IOT_MQTT_HOST |
Default MQTT HOST URL is pulled from the aws_iot_config.h.
Definition at line 50 of file subscribe_publish_library_sample.c.
| uint32_t port = AWS_IOT_MQTT_PORT |
Default MQTT port is pulled from the aws_iot_config.h.
Definition at line 55 of file subscribe_publish_library_sample.c.
| uint32_t publishCount = 0 |
This parameter will avoid infinite loop of publish and exit the program after certain number of publishes.
Definition at line 60 of file subscribe_publish_library_sample.c.
Generated on Tue Jul 12 2022 19:02:38 by
1.7.2