// data_publish.cpp // // This is a Paho MQTT C++ client, sample application. // // It's an example of how to collect and publish periodic data to MQTT, as // an MQTT publisher using the C++ asynchronous client interface. // // The sample demonstrates: // - Connecting to an MQTT server/broker // - Publishing messages // - Using a topic object to repeatedly publish to the same topic. // - Automatic reconnects // - Off-line buffering // - Default file-based persistence // // This just uses the steady clock to run a periodic loop. Each time // through, it generates a random number [0-100] as simulated data and // creates a text, CSV payload in the form: // ,