IBM 4J Webcam User Manual


 
Parameter Description Value
cmd_id A four-byte identifier of the command that was found in
the command text. Following are the four-byte
identifiers:
/**************Command IDs*******************/
#define CHANGE_PROCESS 0x43484750 /* "CHGP" */
#define DELETE_PROCESS 0x44454c50 /* "DELP"*/
#define FLUSH_PROCESS 0x464c5350 /* "FLSP" */
#define SELECT_PROCESS 0x53454c50 /* "SELP"*/
#define SELECT_STATISTICS 0x53454c53 /* "SELS" */
#define SUBMIT 0x5355424d /* "SUBM" */
#define TRACE_API 0x41504920 /* "API " */
#define TRACE_CMGR 0x434d4752 /* "CMGR" */
#define TRACE_SMGR 0x534d4752 /* "SMGR" */
#define TRACE_PMGR 0x504d4752 /* "PMGR" */
#define TRACE_COM 0x434f4d4d /* "COMM"*/
#define TRACE 0x54524143 /* "TRAC" */
#define STOPNDM 0x53544F50 /* "STOP" */
The CLI uses these identifiers to ensure that rules are
being followed. For instance, if an ndmapi_sendcmd
returns with the resp_moreflag set and the cmd_id is not
SELECT_STATISTICS or SELECT_PROCESS, the CLI
generates an error.
Four-byte
identifier
data1, data2,
and data3
For future expansion. data1 is used with the submit
command to return the Process number. data2 is used
with the submit command to return the result of the
Process (0, 4, 8, or 16)
The ndmapi_sendcmd_c() function call has the following return codes:
Return Code Description
NDM_NO_ERROR or Process Number The function completed successfully.
NDM_ERROR An error occurred. Consult the error
structure for detailed error status.
Following is a sample ndmapi_sendcmd() function:
int32 rc, resp_moreflag;
struct sendcmd_data ret_data;
rc=ndmapi_sendcmd (error,
"select process pnumber=2 ;",
&resp_moreflag,
&ret_data
);
Writing Custom C++ Programs
If you write a custom program using C++ API calls, you must include the class
called ConnectDirectSession. The calling program must instantiate
ConnectDirectSession and call the send and receive functions. A sample program
called sdksample.C is provided. To write a custom C++ program, create a
ConnectDirectSession class. The class contains the ConnectDirectSession interface
and a constructor and destructor call to allocate and release the storage associated
with the class. This class is the interface to the Sterling Connect:Direct methods
and provides connection, command, data retrieval, and error services. Each method
returns either CD_SUCCESS or CD_FAILURE.
Chapter 4. Writing Custom Programs 69