#include <stdio.h>
#include <sys/types.h>
#include <aitmqtt.h>
int
main()
{
mqtt_msg_t *m;
int i;
m = mqtt_msgAlloc(0);
/* conn* */
printf("connect=%d/%d\n", m->msg_len, mqtt_msgCONNECT(m, "MRYN", "aaaaa", NULL, "bbb", NULL, 0, 0, 0));
for (i = 0; i < m->msg_len; i++)
printf("%d\n", ((u_char*) m->msg_base)[i]);
printf("connack=%d/%d\n", m->msg_len, mqtt_msgCONNACK(m, 1));
for (i = 0; i < m->msg_len; i++)
printf("%d\n", ((u_char*) m->msg_base)[i]);
/* pub* */
printf("publish=%d/%d\n", m->msg_len, mqtt_msgPUBLISH(m, "AAA/bbb/CCC/ddd", 0, 0, 0));
for (i = 0; i < m->msg_len; i++)
printf("%d\n", ((u_char*) m->msg_base)[i]);
mqtt_msgFree(&m, 42);
return 0;
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>