File:  [ELWIX - Embedded LightWeight unIX -] / mqtt / src / Attic / mqtt.c
Revision 1.1.1.1.2.3: download - view: text, annotated - select for diffs - revision graph
Mon Nov 21 12:47:15 2011 UTC (12 years, 7 months ago) by misho
Branches: mqtt1_0
Diff to: branchpoint 1.1.1.1: preferred, unified
add connack

    1: #include "global.h"
    2: 
    3: 
    4: int
    5: main(int argc, char **argv)
    6: {
    7: 	mqtt_msg_t *m;
    8: 	int i;
    9: 
   10: 	m = mqtt_msgAlloc(0);
   11: 	printf("connect=%d/%d\n", m->msg_len, mqtt_msgCONNECT(m, "MRYN", "aaaaa", NULL, "bbb", NULL, 0, 0, 0));
   12: 	for (i = 0; i < m->msg_len; i++)
   13: 		printf("%d\n", ((u_char*) m->msg_base)[i]);
   14: 	printf("connack=%d/%d\n", m->msg_len, mqtt_msgCONNACK(m, 1));
   15: 	for (i = 0; i < m->msg_len; i++)
   16: 		printf("%d\n", ((u_char*) m->msg_base)[i]);
   17: 	mqtt_msgFree(&m, 42);
   18: 	return 0;
   19: }

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>