Skip to content

Commit

Permalink
bug fixed for #64.
Browse files Browse the repository at this point in the history
update connect() method(only 3 pattern).
  • Loading branch information
hirotakaster committed Jun 26, 2017
1 parent a820dd9 commit c469b35
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MQTT for Photon, Spark Core
<a href="http://mqtt.org/" target=_blank>MQTT</a> publish/subscribe library for Photon, Spark Core version 0.4.20.
<a href="http://mqtt.org/" target=_blank>MQTT</a> publish/subscribe library for Photon, Spark Core version 0.4.21.

## Source Code
This lightweight library source code are only 2 files. firmware -> MQTT.cpp, MQTT.h.
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=MQTT
version=0.4.20
version=0.4.21
license=MIT
author=hirotakaster
url=https://github.com/hirotakaster/MQTT/
Expand Down
13 changes: 3 additions & 10 deletions src/MQTT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,13 @@ void MQTT::addQosCallback(void (*qoscallback)(unsigned int)) {
this->qoscallback = qoscallback;
}


bool MQTT::connect(const char *id) {
return connect(id,NULL,NULL,0,QOS0,0,0);
return connect(id, NULL, NULL, 0, QOS0, 0, 0, true);
}

bool MQTT::connect(const char *id, const char *user, const char *pass) {
return connect(id,user,pass,0,QOS0,0,0);
}

bool MQTT::connect(const char *id, const char* willTopic, EMQTT_QOS willQos, uint8_t willRetain, const char* willMessage) {
return connect(id,NULL,NULL,willTopic,willQos,willRetain,willMessage);
}

bool MQTT::connect(const char *id, const char *user, const char *pass, const char* willTopic, EMQTT_QOS willQos, uint8_t willRetain, const char* willMessage) {
return connect(id,NULL,NULL,willTopic,willQos,willRetain,willMessage,true);
return connect(id, user, pass, 0, QOS0, 0, 0, true);
}

bool MQTT::connect(const char *id, const char *user, const char *pass, const char* willTopic, EMQTT_QOS willQos, uint8_t willRetain, const char* willMessage, bool cleanSession) {
Expand Down
2 changes: 0 additions & 2 deletions src/MQTT.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ typedef enum {

bool connect(const char *id);
bool connect(const char *id, const char *user, const char *pass);
bool connect(const char *id, const char *user, EMQTT_QOS, uint8_t, const char *pass);
bool connect(const char *id, const char *user, const char *pass, const char* willTopic, EMQTT_QOS willQos, uint8_t willRetain, const char* willMessage);
bool connect(const char *id, const char *user, const char *pass, const char* willTopic, EMQTT_QOS willQos, uint8_t willRetain, const char* willMessage, bool cleanSession);
void disconnect();

Expand Down

0 comments on commit c469b35

Please sign in to comment.