--- libaitmqtt/inc/aitmqtt.h 2012/01/26 14:57:57 1.1.1.1.2.2 +++ libaitmqtt/inc/aitmqtt.h 2012/02/04 10:40:01 1.1.1.1.2.6 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitmqtt.h,v 1.1.1.1.2.2 2012/01/26 14:57:57 misho Exp $ +* $Id: aitmqtt.h,v 1.1.1.1.2.6 2012/02/04 10:40:01 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -47,6 +47,15 @@ SUCH DAMAGE. #define __AITMQTT_H +#define MAX_CONNID 24 +#define MAX_CRED 13 +#define MQTTMSG_MAX 65529 +#define MQTT_DATA_MAX 268435455 + +#define MQTT_PROTO_VER 3 +#define MQTT_KEEPALIVE 10 +#define MQTT_DEFAULT_MSGID 0xDEBA + /* FIXED HEADER */ struct mqtthdr { @@ -138,10 +147,6 @@ typedef struct { unsigned short msg_len; } mqtt_msg_t; -/* MQTT hooks callback */ - -typedef void *(*mqtt_cb_t)(void *); - /* MQTT structures */ typedef union { @@ -229,6 +234,15 @@ inline int mqtt_msgRealloc(mqtt_msg_t * __restrict msg */ int mqtt_expandTopic(const char *csInput, char * __restrict psRegEx, int regexLen, unsigned char BOL, unsigned char EOL); +/* + * mqtt_sqlTopic() - Expanding topic to SQL search string + * + * @csInput = Input topic + * @psSQL = Output to SQL search string + * @sqlLen = Length of psSQL + * return: -1 error, 0 changed bytes + */ +int mqtt_sqlTopic(const char *csInput, char * __restrict psSQL, int sqlLen); /* * mqtt_encodeLen() Encode number to MQTT length field