--- mqtt/example/Attic/test_enclen.c 2011/11/07 13:34:06 1.1 +++ mqtt/example/Attic/test_enclen.c 2011/11/07 13:34:06 1.1.2.1 @@ -0,0 +1,21 @@ +#include +#include +#include +#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]); + + return 0; +}