The documentation for IrIAS_Query states that it returns IR_STATUS_FAILED
only under certain conditions.

However, the code listed below ALWAYS returns IR_STATUS_FAILED, and the
checks succeed, indicating "No bloody reason for failure". To be specific,
they check for every eventuality listed in the documentation except 'a query
is already in progress' which I can assure you is not the case, since this
is definitively the first point in the program where IrIAS_Query is
encountered.

    IrIAS_StartResult(&query);
    query.result = buf;
    query.resultBufSize = sizeof(buf);
    query.callBack = IrDADriverIASCallback;
    query.queryBuf = Query;
    query.queryLen = sizeof(Query);
    while (retry) {
        sai("Initiating query");
        stat = IrIAS_Query(refNum,&query);
        switch(stat) {
            case IR_STATUS_SUCCESS:
                sai("Query Initiated");
                retry = false;
                break;
            case IR_STATUS_FAILED:
                sai("Query failed");
                if ((query.queryLen < IR_MAX_QUERY_LEN) &&
                    (query.result != 0) &&
                    (query.resultBufSize != 0) &&
                    (query.callBack != 0)) {
                        sai("No bloody reason for failure");
                } else {sai("I screwed up");}
                break;
            case IR_STATUS_NO_IRLAP:
                sai("Query failed due to IRLAP failure");
                retry = false;
                break;
        }

Any advice would be appreciated.


Reply via email to