version 1.1.1.1.2.6, 2011/11/21 12:16:11
|
version 1.1.1.1.2.8, 2011/11/21 14:40:56
|
Line 114 typedef struct {
|
Line 114 typedef struct {
|
username:1; |
username:1; |
} __packed mqtthdr_connflgs_t; |
} __packed mqtthdr_connflgs_t; |
|
|
|
typedef struct { |
|
unsigned char reserved; |
|
unsigned char retcode; |
|
} __packed mqtthdr_connack_t; |
|
|
|
|
/* MQTT Message buffer */ |
/* MQTT Message buffer */ |
|
|
typedef struct { |
typedef struct { |
Line 196 inline mqtthdr_var_t *mqtt_str2var(const unsigned char
|
Line 201 inline mqtthdr_var_t *mqtt_str2var(const unsigned char
|
int mqtt_msgCONNECT(mqtt_msg_t * __restrict buf, const char *csConnID, |
int mqtt_msgCONNECT(mqtt_msg_t * __restrict buf, const char *csConnID, |
const char *csUser, const char *csPass, |
const char *csUser, const char *csPass, |
const char *csWillTopic, const char *csWillMessage, |
const char *csWillTopic, const char *csWillMessage, |
char ClrSess, char WillQOS, char WillRetain); | unsigned char ClrSess, unsigned char WillQOS, unsigned char WillRetain); |
| /* |
| * mqtt_msgCONNACK() Create CONNACK message |
| * |
| * @buf = Message buffer |
| * @retcode = Return code |
| * return: -1 error or >-1 message size for send |
| */ |
| int mqtt_msgCONNACK(mqtt_msg_t * __restrict buf, unsigned char retcode); |
| /* |
| * mqtt_msgPUBLISH() Create PUBLISH message |
| * |
| * @buf = Message buffer |
| * @csTopic = Publish topic |
| * @msgID = MessageID >0, if QOS != MQTT_QOS_ONCE |
| * @Dup = Duplicate message |
| * @QOS = QoS |
| * @Retain = Retain message |
| * return: -1 error or >-1 message size for send |
| */ |
| int mqtt_msgPUBLISH(mqtt_msg_t * __restrict buf, const char *csTopic, unsigned short msgID, |
| unsigned char Dup, unsigned char QOS, unsigned char Retain); |
| /* |
| * mqtt_msgPUBACK() Create PUBACK message |
| * |
| * @buf = Message buffer |
| * @msgID = MessageID |
| * return: -1 error or >-1 message size for send |
| */ |
| inline int mqtt_msgPUBACK(mqtt_msg_t * __restrict buf, unsigned short msgID); |
| /* |
| * mqtt_msgPUBREC() Create PUBREC message |
| * |
| * @buf = Message buffer |
| * @msgID = MessageID |
| * return: -1 error or >-1 message size for send |
| */ |
| inline int mqtt_msgPUBREC(mqtt_msg_t * __restrict buf, unsigned short msgID); |
| /* |
| * mqtt_msgPUBREL() Create PUBREL message |
| * |
| * @buf = Message buffer |
| * @msgID = MessageID |
| * return: -1 error or >-1 message size for send |
| */ |
| inline int mqtt_msgPUBREL(mqtt_msg_t * __restrict buf, unsigned short msgID); |
| /* |
| * mqtt_msgPUBCOMP() Create PUBCOMP message |
| * |
| * @buf = Message buffer |
| * @msgID = MessageID |
| * return: -1 error or >-1 message size for send |
| */ |
| inline int mqtt_msgPUBCOMP(mqtt_msg_t * __restrict buf, unsigned short msgID); |
|
|
|
|
#endif |
#endif |