--- mqtt/inc/Attic/aitmqtt.h 2011/11/21 12:47:15 1.1.1.1.2.7 +++ mqtt/inc/Attic/aitmqtt.h 2011/11/21 14:40:56 1.1.1.1.2.8 @@ -201,7 +201,7 @@ inline mqtthdr_var_t *mqtt_str2var(const unsigned char int mqtt_msgCONNECT(mqtt_msg_t * __restrict buf, const char *csConnID, const char *csUser, const char *csPass, 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 * @@ -209,7 +209,52 @@ int mqtt_msgCONNECT(mqtt_msg_t * __restrict buf, const * @retcode = Return code * return: -1 error or >-1 message size for send */ -int mqtt_msgCONNACK(mqtt_msg_t * __restrict buf, u_char retcode); +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