result of success : 1 to 0, max msg size: 127B to 16383B, fixed existing bugs
Fork of MQTTClient by
Diff: MQTTClient.cpp
- Revision:
- 11:2a8c86bfdeca
- Parent:
- 10:6fa55ad359f0
--- a/MQTTClient.cpp Mon Jan 04 07:24:12 2016 +0000 +++ b/MQTTClient.cpp Mon Jan 04 07:50:26 2016 +0000 @@ -60,6 +60,17 @@ timer.start(); } +/** Alternative Constructor with parameters + * + * Allow object to be constructed with minimum parameters. + * + * @param server The IP address of the server to connect to + * @param port The TCP/IP port on the server to connect to + * @param id The client name shown on MQTT server. + * @param userName Pointer to username string, zero terminated. Null for not used + * @param password Pointer to password string, zero terminated. Null for not used + * @param callback Callback function to handle subscription to topics + */ MQTTClient::MQTTClient(IpAddr server, int port, char *id, char *userName, char *password, void (*callback)(char*, char*)) { this->port = port; callback_server = callback; @@ -228,6 +239,7 @@ * * @param pub_topic The topic name the massage will be publish on. * @param msg The massage to be published. + * @param retain Retain flag. * @returns -1: Failed to publish message. 0: Publish sucessed. */ int MQTTClient::publish(char* pub_topic, char* msg, bool retain) {