IBM Webcam 4J User Manual

Page of 98
Receiving Responses Using ndmapi_recvresp() or
ndmapi_recvresp_c()
Use ndmapi_recvresp() or ndmapi_recvresp_c() to receive responses that are
associated with a previous command sent from the application. Following is the
format for ndmapi_recvresp() or ndmapi_recvresp_c():
int32 ndmapi_recvresp ERROR_H
error int32 *
resp_length, char *
resp_buffer,
int32 * resp_moreflag
Following are the parameters for ndmapi_recvresp() or ndmapi_recvresp_c():
Parameter
Description
Value
error
A pointer to a Sterling
Connect:Direct-defined structure that
contains error information or status
information.
Pointer
resp_length
A pointer to the length, in bytes, of the
application buffer to receive the
response. The API sets this parameter to
the number of bytes returned.
Pointer to number of bytes
returned or 0 if you no longer
want to receive responses.
Setting this field to zero purges
all queued responses.
resp_buffer
A pointer to the application buffer that
receives the command or submit
response. This buffer should allocate
4096 bytes.
The format of resp_buffer is a free-form
text record structure. Field names are
four characters long and all uppercase.
The data can be any length and can
include blanks. The structure is:
field name=data | field name=data |...
For example:
SUBM = username | PNUM = 12 |
PNAM = proc1 |...
A local buffer, with a size greater
than or equal to that set by
r
esp_length and filled in by
ndmapi_recvresp()
or
ndmapi_recvresp_c()
.
The CLI passes the resp_buffer to
AWK for parsing. Valid values
include:
ADMN—Sterling Connect:Direct
administrator name
ADPH—Sterling Connect:Direct
administrator phone number
CCOD—Completion code
CKPT—Checkpoint
CLAS—Class
DBYW—Bytes written
DBYX—Bytes received
DCOD—Destination completion
code
DDAY—Submit date
64
Sterling Connect:Direct for UNIX: User Guide