|
|
| version 1.1.2.5, 2011/11/21 15:27:26 | version 1.1.2.6, 2011/11/22 14:00:09 |
|---|---|
| Line 45 mqtt_msgPUBLISH(mqtt_msg_t * __restrict buf, const cha | Line 45 mqtt_msgPUBLISH(mqtt_msg_t * __restrict buf, const cha |
| } | } |
| /* variable header */ | /* variable header */ |
| topic = (mqtthdr_var_t*) (buf->msg_base + siz); | topic = (mqtthdr_var_t*) (buf->msg_base + siz); |
| topic->var_sb.val = htons(strlen(csTopic)); | topic->var_sb.val = htons(strlen(csTopic)); |
| memcpy(topic->var_data, csTopic, ntohs(topic->var_sb.val)); | memcpy(topic->var_data, csTopic, ntohs(topic->var_sb.val)); |
| Line 56 mqtt_msgPUBLISH(mqtt_msg_t * __restrict buf, const cha | Line 55 mqtt_msgPUBLISH(mqtt_msg_t * __restrict buf, const cha |
| siz += sizeof(mqtt_v_t); | siz += sizeof(mqtt_v_t); |
| /* load with data */ | /* load with data */ |
| if (pData && datlen) { | if (pData && datlen) { |
| data = buf->msg_base + siz; | data = buf->msg_base + siz; |
| memcpy(data, pData, datlen); | memcpy(data, pData, datlen); |
| Line 64 mqtt_msgPUBLISH(mqtt_msg_t * __restrict buf, const cha | Line 62 mqtt_msgPUBLISH(mqtt_msg_t * __restrict buf, const cha |
| } | } |
| /* fixed header */ | /* fixed header */ |
| MQTTHDR_MSGINIT(hdr); | |
| hdr->mqtt_msg.type = MQTT_TYPE_PUBLISH; | hdr->mqtt_msg.type = MQTT_TYPE_PUBLISH; |
| hdr->mqtt_msg.qos = QOS; | hdr->mqtt_msg.qos = QOS; |
| hdr->mqtt_msg.dup = Dup ? 1 : 0; | hdr->mqtt_msg.dup = Dup ? 1 : 0; |
| Line 95 _mqtt_msgPUB_(mqtt_msg_t * __restrict buf, u_char cmd, | Line 93 _mqtt_msgPUB_(mqtt_msg_t * __restrict buf, u_char cmd, |
| } | } |
| /* fixed header */ | /* fixed header */ |
| MQTTHDR_MSGINIT(hdr); | |
| hdr->mqtt_msg.type = cmd; | hdr->mqtt_msg.type = cmd; |
| *hdr->mqtt_len = sizeof(mqtt_v_t); | *hdr->mqtt_len = sizeof(mqtt_v_t); |