17 #ifndef ROVERAPI_ROVER_MQTTCOMMAND_HPP_ 18 #define ROVERAPI_ROVER_MQTTCOMMAND_HPP_ 27 #define topicPrefix "rover/" 28 #define drivingSubTopic "/RoverDriving/control" 29 #define telemetrySubTopic "/telemetry" 30 #define telemetryTopic "telemetry" 33 #define MQTT_BUFSIZE 256 91 RoverMQTTCommand (
char * host,
const int port,
const int roverID,
const int qos,
char * username,
char * password,
char * clientID);
96 RoverMQTTCommand (
char * host,
const int port,
const int roverID,
const int qos,
char * clientID);
int data_ready
Definition: rover_mqttcommand.hpp:71
RoverDrivingMode_t
Data type to indicate rover's driving mode.
Definition: rover_mqttcommand.hpp:61
float ultrasonic_rear
Definition: rover_mqttcommand.hpp:44
Definition: rover_mqttcommand.hpp:61
int getRoverID(void)
Retrieves Rover ID.
Definition: rover_mqttcommand.cpp:302
int unsubscribeToDrivingTopic(void)
Unsubscribes to rover's driving topic.
Definition: rover_mqttcommand.cpp:220
int8_t gy521_accel_z
Definition: rover_mqttcommand.hpp:54
int connectRover(void)
connectRover connects to the MQTT broker. Each rover ideally should have only one client...
Definition: rover_mqttcommand.cpp:95
Definition: rover_mqttcommand.hpp:61
Definition: rover_mqttcommand.hpp:61
float gy521_angle_x
Definition: rover_mqttcommand.hpp:49
int8_t gy521_gyro_z
Definition: rover_mqttcommand.hpp:48
RoverPahoMQTT contains member functions to use rover as a client and to publish / subscribe to Eclips...
Definition: rover_pahomqtt.hpp:83
Definition: rover_mqttcommand.hpp:61
Definition: rover_mqttcommand.hpp:61
char command
Definition: rover_mqttcommand.hpp:70
void setRoverID(const int rover_id)
Sets Rover ID.
Definition: rover_mqttcommand.cpp:307
int ROVER_ID
Given rover identification for multi-agent MQTT communication with a single cloud.
Definition: rover_mqttcommand.hpp:85
float gy521_angle_y
Definition: rover_mqttcommand.hpp:50
int8_t gy521_gyro_y
Definition: rover_mqttcommand.hpp:47
Definition: rover_mqttcommand.hpp:61
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
float gy521_angle_z
Definition: rover_mqttcommand.hpp:51
int8_t gy521_accel_y
Definition: rover_mqttcommand.hpp:53
int8_t gy521_accel_x
Definition: rover_mqttcommand.hpp:52
int subscribeToDrivingTopic(void)
Subscribes to rover's driving topic.
Definition: rover_mqttcommand.cpp:211
int speed
Definition: rover_mqttcommand.hpp:69
int getRoverConnected(void)
Returns rover connected flag.
Definition: rover_mqttcommand.cpp:100
Data type to store rover's sensor data.
Definition: rover_mqttcommand.hpp:40
Definition: rover_mqttcommand.hpp:61
float ultrasonic_front
Definition: rover_mqttcommand.hpp:43
Data type to store rover's control data.
Definition: rover_mqttcommand.hpp:66
RoverMQTTCommand(char *host, const int port, const int roverID, const int qos, char *username, char *password, char *clientID)
Copy constructor for RoverMQTTCommand class that uses username and password.
Definition: rover_mqttcommand.cpp:34
int8_t gy521_gyro_x
Definition: rover_mqttcommand.hpp:46
float hmc5883l_bearing
Definition: rover_mqttcommand.hpp:45
int publishToTelemetryTopicNonRedirected(RoverSensorData_t sensor_data)
Publishes a message to rover's telemetry topic (using unredirected topic method)
Definition: rover_mqttcommand.cpp:153
RoverMQTTCommand class is an implementation class extending RoverPahoMQTT for rover-specific topic su...
Definition: rover_mqttcommand.hpp:79
int publishToTelemetryTopic(RoverSensorData_t sensor_data)
Publishes a message to rover's telemetry topic (using redirected topic method)
Definition: rover_mqttcommand.cpp:105
RoverDrivingMode_t driving_mode
Definition: rover_mqttcommand.hpp:68
RoverControlData_t readFromDrivingTopic(void)
Returns the retrieved driving information.
Definition: rover_mqttcommand.cpp:226
~RoverMQTTCommand()
Destructor for RoverMQTTCommand class.
Definition: rover_mqttcommand.cpp:93
char * getTopicName(void)
Retrieves topic name.
Definition: rover_mqttcommand.cpp:297