Commit 8f3a48db8eb604c9907f3c8cb77bcf1b9f42c2e9
1 parent
31eece9b
fixed minor typos and changed the parameters to be more clear
Showing
4 changed files
with
5 additions
and
5 deletions
examples/pub/publisher.cpp
| @@ -29,9 +29,9 @@ Publisher::Publisher() | @@ -29,9 +29,9 @@ Publisher::Publisher() | ||
| 29 | 29 | ||
| 30 | } | 30 | } |
| 31 | 31 | ||
| 32 | -void Publisher::connect(const std::string &hostname, int portnumber, const std::string &username, const std::string &password, const std::string &topic, const std::string &message) | 32 | +void Publisher::connect(const std::string &hostname, int portnumber, const std::string &username, const std::string &password, const std::string &lwt_topic, const std::string &lwt_message) |
| 33 | { | 33 | { |
| 34 | - m_mqtt_client.connect( hostname, portnumber, osdev::components::mqtt::Credentials( username, password ), osdev::components::mqtt::mqtt_LWT( topic, message ) ); | 34 | + m_mqtt_client.connect( hostname, portnumber, osdev::components::mqtt::Credentials( username, password ), osdev::components::mqtt::mqtt_LWT( lwt_topic, lwt_message ) ); |
| 35 | std::cout << "Client state : " << m_mqtt_client.state() << std::endl; | 35 | std::cout << "Client state : " << m_mqtt_client.state() << std::endl; |
| 36 | } | 36 | } |
| 37 | 37 |
examples/pub/publisher.h
| @@ -37,7 +37,7 @@ public: | @@ -37,7 +37,7 @@ public: | ||
| 37 | virtual ~Publisher() {} | 37 | virtual ~Publisher() {} |
| 38 | 38 | ||
| 39 | void connect( const std::string &hostname, int portnumber = 1883, const std::string &username = std::string(), const std::string &password = std::string() | 39 | void connect( const std::string &hostname, int portnumber = 1883, const std::string &username = std::string(), const std::string &password = std::string() |
| 40 | - , const std::string &topic = std::string(), const std::string &message = std::string() ); | 40 | + , const std::string &lwt_topic = std::string(), const std::string &lwt_message = std::string() ); |
| 41 | 41 | ||
| 42 | void publish( const std::string &message_topic, const std::string &message_payload ); | 42 | void publish( const std::string &message_topic, const std::string &message_payload ); |
| 43 | 43 |
include/imqttclient.h
| @@ -60,7 +60,7 @@ public: | @@ -60,7 +60,7 @@ public: | ||
| 60 | * @param port The port to use. | 60 | * @param port The port to use. |
| 61 | * @param credentials The credentials to use. | 61 | * @param credentials The credentials to use. |
| 62 | */ | 62 | */ |
| 63 | - virtual void connect(const std::string& host, int port, const Credentials& credentials, const mqtt_LWT &lvt = mqtt_LWT() ) = 0; | 63 | + virtual void connect(const std::string& host, int port, const Credentials& credentials, const mqtt_LWT &lwt = mqtt_LWT() ) = 0; |
| 64 | 64 | ||
| 65 | /** | 65 | /** |
| 66 | * @brief Connect to the endpoint | 66 | * @brief Connect to the endpoint |
include/mqttclient.h
| @@ -92,7 +92,7 @@ public: | @@ -92,7 +92,7 @@ public: | ||
| 92 | /** | 92 | /** |
| 93 | * @see IMqttClient | 93 | * @see IMqttClient |
| 94 | */ | 94 | */ |
| 95 | - virtual void connect( const std::string& host, int port, const Credentials &credentials, const mqtt_LWT &lvt = mqtt_LWT() ) override; | 95 | + virtual void connect( const std::string& host, int port, const Credentials &credentials, const mqtt_LWT &lwt = mqtt_LWT() ) override; |
| 96 | 96 | ||
| 97 | /** | 97 | /** |
| 98 | * @see IMqttClient | 98 | * @see IMqttClient |