--- libaitmqtt/inc/aitmqtt.h 2012/01/27 15:12:27 1.1.1.1.2.3 +++ libaitmqtt/inc/aitmqtt.h 2012/04/25 13:49:15 1.1.1.1.2.7 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitmqtt.h,v 1.1.1.1.2.3 2012/01/27 15:12:27 misho Exp $ +* $Id: aitmqtt.h,v 1.1.1.1.2.7 2012/04/25 13:49:15 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 +Copyright 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -50,7 +50,12 @@ SUCH DAMAGE. #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 { @@ -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