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

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "aitmqtt.h"


int
main(int argc, char **argv)
{
	mqtt_subscr_t *v, *p;
	u_char qoses[] = { 1, 0, 2, 6, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0 };

	if (argc < 2)
		return 1;

	v = mqtt_str2sub((const char**) argv, 0, qoses);
	for (p = v; p->sub_data; p++)
		printf("msb=%hhd lsb=%hhd val=%hd %s qos=%d\n", 
				p->sub_sb.sb.m, p->sub_sb.sb.l, p->sub_sb.val, p->sub_data, p->sub_qos);
	mqtt_freeSub(&v);

	return 0;
}

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