File:  [ELWIX - Embedded LightWeight unIX -] / mqtt / example / Attic / test.c
Revision 1.1.2.2: download - view: text, annotated - select for diffs - revision graph
Mon Nov 21 16:42:43 2011 UTC (12 years, 7 months ago) by misho
Branches: mqtt1_0
fixed freeSub & ut

    1: #include <stdio.h>
    2: #include <stdlib.h>
    3: #include <string.h>
    4: #include <sys/types.h>
    5: #include "aitmqtt.h"
    6: 
    7: 
    8: int
    9: main(int argc, char **argv)
   10: {
   11: 	mqtt_subscr_t *v, *p;
   12: 	u_char qoses[] = { 1, 0, 2, 6, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 };
   13: 
   14: 	if (argc < 2)
   15: 		return 1;
   16: 
   17: 	v = mqtt_str2sub((const char**) argv, 0, qoses);
   18: 	for (p = v; p->sub_data; p++)
   19: 		printf("msb=%hhd lsb=%hhd val=%hd %s qos=%d\n", 
   20: 				p->sub_sb.sb.m, p->sub_sb.sb.l, p->sub_sb.val, p->sub_data, p->sub_qos);
   21: 	mqtt_freeSub(&v);
   22: 
   23: 	return 0;
   24: }

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