version 1.2, 2012/06/20 15:02:23
|
version 1.2.2.1, 2012/06/21 13:47:29
|
Line 51 main()
|
Line 51 main()
|
if (!(len = mqtt_readPUBLISH(m, topic, sizeof topic, &msgID, (void**) &pub))) { |
if (!(len = mqtt_readPUBLISH(m, topic, sizeof topic, &msgID, (void**) &pub))) { |
printf("Error:: mqtt_readPUBLISH() #%d - %s\n", mqtt_GetErrno(), mqtt_GetError()); |
printf("Error:: mqtt_readPUBLISH() #%d - %s\n", mqtt_GetErrno(), mqtt_GetError()); |
return 2; |
return 2; |
} | } else |
| hdr = (struct mqtthdr*) m->msg_base; |
printf("read publish: dup=%d qos=%d retain=%d\n", hdr->mqtt_msg.dup, hdr->mqtt_msg.qos, hdr->mqtt_msg.retain); |
printf("read publish: dup=%d qos=%d retain=%d\n", hdr->mqtt_msg.dup, hdr->mqtt_msg.qos, hdr->mqtt_msg.retain); |
printf("++> topic=%s MessageID=%d DATA=(%d)%s\n", topic, msgID, len, pub); |
printf("++> topic=%s MessageID=%d DATA=(%d)%s\n", topic, msgID, len, pub); |
free(pub); |
free(pub); |