Annotation of mqtt/example/cmds.c, revision 1.1.2.2

1.1.2.1   misho       1: #include <stdio.h>
                      2: #include <sys/types.h>
                      3: #include <aitmqtt.h>
                      4: 
                      5: 
                      6: int
                      7: main()
                      8: {
                      9:        mqtt_msg_t *m;
                     10:        int i;
                     11: 
                     12:        m = mqtt_msgAlloc(0);
                     13:        /* conn* */
                     14:        printf("connect=%d/%d\n", m->msg_len, mqtt_msgCONNECT(m, "MRYN", "aaaaa", NULL, "bbb", NULL, 0, 0, 0));
                     15:        for (i = 0; i < m->msg_len; i++)
                     16:                printf("%d\n", ((u_char*) m->msg_base)[i]);
                     17:        printf("connack=%d/%d\n", m->msg_len, mqtt_msgCONNACK(m, 1));
                     18:        for (i = 0; i < m->msg_len; i++)
                     19:                printf("%d\n", ((u_char*) m->msg_base)[i]);
                     20: 
                     21:        /* pub* */
1.1.2.2 ! misho      22:        printf("publish=%d/%d\n", m->msg_len, mqtt_msgPUBLISH(m, "AAA/bbb/CCC/ddd", 0, 0, 0));
1.1.2.1   misho      23:        for (i = 0; i < m->msg_len; i++)
                     24:                printf("%d\n", ((u_char*) m->msg_base)[i]);
                     25: 
                     26:        mqtt_msgFree(&m, 42);
                     27:        return 0;
                     28: }

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