--- mqtt/inc/Attic/aitmqtt.h 2011/11/22 14:19:48 1.1.1.1.2.19 +++ mqtt/inc/Attic/aitmqtt.h 2011/11/22 14:48:25 1.1.1.1.2.20 @@ -114,7 +114,11 @@ typedef struct { unsigned short msg_len; } mqtt_msg_t; +/* MQTT dispatcher callbacks */ +typedef int (*mqtt_cb_t)(void *); + + // ------------------------------------------------------- // mqtt_GetErrno() Get error code of last operation inline int mqtt_GetErrno(); @@ -194,6 +198,9 @@ inline void mqtt_subFree(mqtt_subscr_t ** __restrict s */ inline mqtt_subscr_t *mqtt_subAlloc(unsigned short num); + +/*** SENDER FUNCTIONS ***/ + /* * mqtt_msgCONNECT() Create CONNECT message * @@ -335,6 +342,23 @@ mqtt_msgUNSUBSCRIBE(mqtt_msg_t * __restrict buf, mqtt_ * return: -1 error or >-1 message size for send */ int mqtt_msgUNSUBACK(mqtt_msg_t * __restrict buf, unsigned short msgID); + + +/*** RECEIVER FUNCTIONS ***/ + +/* + * mqttInitCallbacks() Init callback array for dispatcher + * + * return: NULL error or !=NULL allocated callback array, after use free with mqttFiniCallbacks() + */ +mqtt_cb_t *mqttInitCallbacks(void); +/* + * mqttFiniCallbacks() Free callback array + * + * @cb = Callback array + * return: none + */ +void mqttFiniCallbacks(mqtt_cb_t ** __restrict cb); #endif