--- mqtt/example/Attic/cmds.c 2011/12/09 09:53:54 1.1.2.17 +++ mqtt/example/Attic/cmds.c 2011/12/09 11:46:48 1.1.2.18 @@ -11,6 +11,7 @@ main() mqtt_msg_t *m; mqtt_subscr_t s[4], *ss; mqtthdr_connflgs_t flg; + mqtthdr_connack_t cack; u_short ka, msgID; int i, len; char cid[BUFSIZ], user[BUFSIZ], pass[BUFSIZ], topic[BUFSIZ], message[BUFSIZ], *t, *msg; @@ -23,8 +24,9 @@ main() for (i = 0; i < m->msg_len; i++) printf("%d\n", ((u_char*) m->msg_base)[i]); t = msg = NULL; - flg = mqtt_readCONNECT(m, &ka, cid, sizeof cid, user, sizeof user, pass, sizeof pass, &t, &msg); - printf("read connect flags:: clean=%d will=%d qos=%d retain=%d pass=%d user=%d\n", + cack = mqtt_readCONNECT(m, &ka, cid, sizeof cid, user, sizeof user, pass, sizeof pass, &t, &msg); + flg.flags = cack.reserved; + printf("read connect %d flags:: clean=%d will=%d qos=%d retain=%d pass=%d user=%d\n", cack.retcode, flg.clean_sess, flg.will_flg, flg.will_qos, flg.will_retain, flg.password, flg.username); if (flg.reserved) { printf("Error:: mqtt_readCONNECT() #%d - %s\n", mqtt_GetErrno(), mqtt_GetError());