Upon creation and initialization of the HTTP Receiver, we should perform the following things:
- Instantiate a network access manager to perform HTTP requests
- Set up a timer to perform requests at regular intervals
- Connect the timer's timeout with the issuing of an HTTP request
- Connect the network access manager's finished signal, containing the reply, to the receiveReadings slot
- Start the timer
We decided to put the first four steps of the preceding list in the class constructor, and start the timer in the init method. The choice, of course, is up to you, depending on your specific requirements. The constructor for ReceiverHttp will thus look as follows:
// receiver_http.cpp#include "receiver_http.h" ...