IBM Webcam 4J ユーザーズマニュアル

ページ / 98
Sending a Command to Sterling Connect:Direct Using
ndmapi_sendcmd() or ndmapi_sendcmd_c()
Use ndmapi_sendcmd() or ndmapi_sendcmd_c() to allow a command to be sent to
a Sterling Connect:Direct application. Following is the format of
ndmapi_sendcmd() or ndmapi_sendcmd_c():
int32
rc, resp_moreflag;
struct sendcmd_data ret_data;
rc=ndmapi_sendcmd (error,
"select process pnumber=2,",
&resp_moreflag,
&ret_data
);
Following are the parameters for ndmapi_sendcmd() or ndmapi_sendcmd_c():
Parameter
Description
Value
error
A pointer to a Sterling Connect:Direct-defined structure
that contains error information or status information.
Pointer
cmd_text
A pointer to the null-terminated text string that specifies
the command to send to Sterling Connect:Direct. The
command text must be followed by a semicolon and
terminated with a null.
When you use the submit=filename command from the
API, ensure that you allocate enough storage for the
Process text. The text of the Process submitted is
returned in the text string associated with this parameter
when the function completes. If you do not allocate
enough storage for the Process text, a core dump can
result.
Pointer to a text
string
resp_moreflag A pointer to the flag that indicates that more responses
are pending for the command just executed. Invoke
ndmapi_recvresp()
or ndmapi_recvresp_c() to retrieve
the extra responses.
Pointer to a flag
ret_data
A pointer to a structure containing internal response
information for a command. The structure is:
struct sendcmd_data
{
char
* cmd_name;
ulong cmd_id;
long data1;
long data2;
long data3;
};
Pointer to a
structure
sendcmd_data Provides the caller with some information about the user
request. Because parsing of command text occurs at the
CMGR, the End User Application (EUA) has no way to
identify the command that was submitted, unless it
generated the text.
Information
about the user
request
cmd_name
A pointer to a string with the name of the command
submitted. The CLI uses this pointer to display
completion messages. This field enables you to display
unique completion messages without any knowledge of
a specific command in the EUA.
Pointer to name
of command
68
Sterling Connect:Direct for UNIX: User Guide