File:  [ELWIX - Embedded LightWeight unIX -] / libaitmqtt / example / test_enclen.c
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Thu Jan 26 13:07:33 2012 UTC (12 years, 4 months ago) by misho
CVS tags: MAIN, HEAD
Initial revision

#include <stdio.h>
#include <stdlib.h>
#include <netinet/in.h>
#include "aitmqtt.h"

int
main(int argc, char **argv)
{
	unsigned int x;
	unsigned char *p = (unsigned char*) &x;

	if (argc < 2)
		return 1;
	else
		x = strtol(argv[1], NULL, 0);

	x = mqtt_encodeLen(x);
	printf("encode:: %u (wire)-> %02x %02x %02x %02x\n", x, p[0], p[1], p[2], p[3]);

	printf("sizeof len=%d\n", mqtt_sizeLen(x));

	return 0;
}

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