Skip to content

Commit

Permalink
update example.
Browse files Browse the repository at this point in the history
  • Loading branch information
hirotakaster committed Oct 10, 2016
1 parent 0f5e318 commit 91b00fc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions firmware/examples/mqttqostest.ino
Original file line number Diff line number Diff line change
Expand Up @@ -52,18 +52,18 @@ void setup() {
// connect to the server
client.connect("sparkclient");

// add qos callback
// add qos callback. If don't add qoscallback, ACK message from MQTT server is ignored.
client.addQosCallback(qoscallback);

// publish/subscribe
if (client.isConnected()) {
// get messageid parameter at 4.

// can use messageid parameter at 4.
uint16_t messageid;
client.publish("/outTopic", "hello world QOS1(message is NULL)", MQTT::QOS1);
client.publish("/outTopic", "hello world QOS1", MQTT::QOS1, &messageid);
Serial.println(messageid);

client.publish("/outTopic", "hello world QOS1(message is NULL)", MQTT::QOS1);

client.publish("/outTopic", "hello world QOS2", MQTT::QOS2, &messageid);
Serial.println(messageid);

Expand Down

0 comments on commit 91b00fc

Please sign in to comment.