Yield function call with timeout works, there was an issue with blockant socket.
Fork of HelloMQTT by
Revision 9:5beb8609e9f7, committed 2014-05-22
- Comitter:
- icraggs
- Date:
- Thu May 22 23:58:34 2014 +0000
- Parent:
- 8:a3e3113054a1
- Child:
- 10:ce3321d8ea90
- Child:
- 12:086a9314e8a5
- Commit message:
- Latest version
Changed in this revision
MQTT.lib | Show annotated file Show diff for this revision Revisions of this file |
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/MQTT.lib Tue May 20 15:08:05 2014 +0000 +++ b/MQTT.lib Thu May 22 23:58:34 2014 +0000 @@ -1,1 +1,1 @@ -http://mbed.org/teams/mqtt/code/MQTT/#a4e3a97dabe3 +http://mbed.org/teams/mqtt/code/MQTT/#a51dd239b78e
--- a/main.cpp Tue May 20 15:08:05 2014 +0000 +++ b/main.cpp Thu May 22 23:58:34 2014 +0000 @@ -34,21 +34,22 @@ int arrivedcount = 0; -void messageArrived(MQTT::Message* message) +void messageArrived(MQTT::MessageData& md) { + MQTT::Message &message = md.message; lcd.cls(); lcd.locate(0,3); - printf("Message arrived: qos %d, retained %d, dup %d, packetid %d\n", message->qos, message->retained, message->dup, message->id); - printf("Payload %.*s\n", message->payloadlen, (char*)message->payload); + printf("Message arrived: qos %d, retained %d, dup %d, packetid %d\n", message.qos, message.retained, message.dup, message.id); + printf("Payload %.*s\n", message.payloadlen, (char*)message.payload); ++arrivedcount; - lcd.puts((char*)message->payload); + lcd.puts((char*)message.payload); } int main(int argc, char* argv[]) { MQTTEthernet ipstack = MQTTEthernet(); - float version = 0.46; + float version = 0.47; char* topic = "mbed-sample"; lcd.printf("Version is %f\n", version);