--- libaitmqtt/inc/defs.h 2022/09/14 14:32:48 1.4.2.3 +++ libaitmqtt/inc/defs.h 2022/09/15 15:04:44 1.4.2.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: defs.h,v 1.4.2.3 2022/09/14 14:32:48 misho Exp $ +* $Id: defs.h,v 1.4.2.4 2022/09/15 15:04:44 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -88,6 +88,25 @@ void mqtt_SetErr(int, char *, ...); //struct mqtthdr *_mqtt_readHEADER(mqtt_msg_t * __restrict, u_char, int *, int *); int mqtt_wait4data(int, u_short, short); +/* + * mqtt_KeepAlive() - Keep Alive check routine + * + * @sock = connected socket + * @ka = keep alive timeout + * @tries = tries for receive correct ping response, usually ==1 + * return: -1 error, 0 host is alive, 1 timeout session or 2 broken session + */ +int mqtt_KeepAlive(int sock, unsigned short ka, unsigned char tries); +/* + * mqtt_WillMessage() - Publish WILL message + * + * @sock = connected socket + * @ka = keep alive timeout + * @topic = will topic + * @data = will message + * return: -1 error, 1 timeout, 2 not ack or 0 ok + */ +int mqtt_WillMessage(int sock, unsigned short ka, const char *topic, const char *data); #endif