--- mqtt/inc/mqttd.h 2011/12/09 13:43:55 1.1.2.4 +++ mqtt/inc/mqttd.h 2012/06/01 10:39:48 1.2.2.12 @@ -2,8 +2,11 @@ #define __MQTTD_H +#define API_SERVER_SIDE +#include + + struct tagStore { - char st_qos; u_short st_msgid; mqtt_subscr_t st_subscr; @@ -11,9 +14,15 @@ struct tagStore { SLIST_ENTRY(tagStore) st_node; }; +struct tagPkt { + ait_val_t *pkt_data; + + SLIST_ENTRY(tagPkt) pkt_node; +}; + struct tagSession { - /* client session thread id */ - pthread_t sess_tid; + /* server dispatcher */ + mqtt_srv_t *sess_srv; /* client network settings */ int sess_sock; @@ -39,18 +48,22 @@ struct tagSession { char *msg; } sess_will; - /* Data Storage by QoS class */ - SLIST_HEAD(qosStore, tagStore) sess_store[MQTT_QOS_RESERVED]; + /* session subscriptions & send pubs */ + SLIST_HEAD(tStore, tagStore) sess_subscr; + SLIST_HEAD(tPkt, tagPkt) sess_sndpkt; TAILQ_ENTRY(tagSession) sess_node; }; - typedef TAILQ_HEAD(, tagSession) sessions_t; extern sessions_t Sessions; extern sched_root_task_t *root; -extern sl_config cfg; +extern cfg_root_t cfg; + + +/* function prototypes */ +void *startSession(sched_task_t *task); #endif