--- libaitmqtt/inc/aitmqtt.h 2012/04/26 11:49:12 1.1.1.1.2.8 +++ libaitmqtt/inc/aitmqtt.h 2012/04/26 15:26:37 1.1.1.1.2.10 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitmqtt.h,v 1.1.1.1.2.8 2012/04/26 11:49:12 misho Exp $ +* $Id: aitmqtt.h,v 1.1.1.1.2.10 2012/04/26 15:26:37 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -104,6 +104,9 @@ struct mqtthdr { #define MQTT_QOS_EXACTLY 2 /* Exactly once, Assured delivery, =1 */ #define MQTT_QOS_RESERVED 3 /* reserved */ +#define MQTT_QOS_DENY 0 /* Not granted QoS for SUBACK */ +#define MQTT_QOS_PASS 2 /* Granted QoS for SUBACK */ + #define MQTT_FLAG_RETAIN 1 /* This flag is only used on PUBLISH messages. When a client sends a PUBLISH to a server, @@ -267,15 +270,16 @@ inline unsigned int mqtt_decodeLen(void * __restrict l */ inline char mqtt_sizeLen(unsigned int len); /* - * mqtt_str2sub Create MQTT subscribe variable from string(s) + * mqtt_str2subs Create MQTT subscribe variable from string(s) * - * @csStr = strings - * @strnum = number of strings elements + * @csStr = null terminated string array + * @strnum = copy at most number of strings elements * @qoses = QoS elements applied to subscribe variable, * count of elements must be equal with csStr elements * return: NULL error or != subscribe variables array, must be free after use with mqtt_freeSub() */ -inline mqtt_subscr_t *mqtt_str2sub(const char **csStr, unsigned short strnum, unsigned char *qoses); +inline mqtt_subscr_t *mqtt_str2subs(const char **csStr, unsigned short strnum, + unsigned char *qoses); /* * mqtt_subFree() Free array from subscribe variables *