Diff for /libaitmqtt/example/cmds.c between versions 1.1.1.1.2.2 and 1.2.2.1

version 1.1.1.1.2.2, 2012/04/27 15:15:12 version 1.2.2.1, 2012/06/21 13:47:29
Line 14  main() Line 14  main()
         mqtthdr_connack_t cack;          mqtthdr_connack_t cack;
         u_short ka, msgID;          u_short ka, msgID;
         int i, len;          int i, len;
        char cid[BUFSIZ], user[BUFSIZ], pass[BUFSIZ], topic[BUFSIZ], message[BUFSIZ], *t, *msg;        char cid[BUFSIZ], user[BUFSIZ], pass[BUFSIZ], topic[BUFSIZ], *t, *msg, *pub;
         struct mqtthdr *hdr;          struct mqtthdr *hdr;
         u_char *qoses;          u_char *qoses;
   
Line 48  main() Line 48  main()
         printf("publish=%d/%d\n", m->msg_len, mqtt_msgPUBLISH(m, "AAA/bbb/CCC/ddd", 7, 0, 2, 0, "OLE!!!", 7));          printf("publish=%d/%d\n", m->msg_len, mqtt_msgPUBLISH(m, "AAA/bbb/CCC/ddd", 7, 0, 2, 0, "OLE!!!", 7));
         for (i = 0; i < m->msg_len; i++)          for (i = 0; i < m->msg_len; i++)
                 printf("%d\n", ((u_char*) m->msg_base)[i]);                  printf("%d\n", ((u_char*) m->msg_base)[i]);
        len = sizeof message;        if (!(len = mqtt_readPUBLISH(m, topic, sizeof topic, &msgID, (void**) &pub))) {
        if (!mqtt_readPUBLISH(m, topic, sizeof topic, &msgID, message, &len)) { 
                 printf("Error:: mqtt_readPUBLISH() #%d - %s\n", mqtt_GetErrno(), mqtt_GetError());                  printf("Error:: mqtt_readPUBLISH() #%d - %s\n", mqtt_GetErrno(), mqtt_GetError());
                 return 2;                  return 2;
        }        } else
                 hdr = (struct mqtthdr*) m->msg_base;
         printf("read publish: dup=%d qos=%d retain=%d\n", hdr->mqtt_msg.dup, hdr->mqtt_msg.qos, hdr->mqtt_msg.retain);          printf("read publish: dup=%d qos=%d retain=%d\n", hdr->mqtt_msg.dup, hdr->mqtt_msg.qos, hdr->mqtt_msg.retain);
        printf("++> topic=%s MessageID=%d DATA=(%d)%s\n", topic, msgID, len, message);        printf("++> topic=%s MessageID=%d DATA=(%d)%s\n", topic, msgID, len, pub);
         free(pub);
         printf("puback=%d/%d\n", m->msg_len, mqtt_msgPUBACK(m, 10));          printf("puback=%d/%d\n", m->msg_len, mqtt_msgPUBACK(m, 10));
         for (i = 0; i < m->msg_len; i++)          for (i = 0; i < m->msg_len; i++)
                 printf("%d\n", ((u_char*) m->msg_base)[i]);                  printf("%d\n", ((u_char*) m->msg_base)[i]);

Removed from v.1.1.1.1.2.2  
changed lines
  Added in v.1.2.2.1


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