Add qos0 pub sample

This commit is contained in:
Ian Craggs
2014-03-21 16:03:33 +00:00
parent d6831bb7a7
commit 87d51a560b
6 changed files with 160 additions and 6 deletions

View File

@@ -57,7 +57,7 @@ int MQTTSNDeserialize_publish(int* dup, int* qos, int* retained, int* packetid,
*retained = flags.bits.retain;
topic->type = flags.bits.topicIdType;
if (topic.type == MQTTSN_TOPIC_TYPE_NORMAL && qos == 3)
if (topic->type == MQTTSN_TOPIC_TYPE_NORMAL && *qos == 3)
{
/* special arrangement for long topic names in QoS -1 publishes. The length of the topic is in the topicid field */
topic->data.qos3.longlen = readInt(&curdata);
@@ -71,9 +71,9 @@ int MQTTSNDeserialize_publish(int* dup, int* qos, int* retained, int* packetid,
}
*packetid = readInt(&curdata);
if (topic.type == MQTTSN_TOPIC_TYPE_NORMAL && qos == 3)
if (topic->type == MQTTSN_TOPIC_TYPE_NORMAL && *qos == 3)
{
topic->data.qos3.longname = curdata;
topic->data.qos3.longname = (char*)curdata;
curdata += topic->data.qos3.longlen;
}