Jim Flynn / Mbed OS aws-iot-device-sdk-mbed-c
Embed: (wiki syntax)

« Back to documentation index

subscribe_publish_cpp_sample.cpp File Reference

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.