Overview

Sends a command to the Commander core HID device through the open path handle, which is specified in the parameter “pHandle” and reads the response from the device. The command to be sent must be passed as a string in parameter "command." The response string received from the device is stored in "reply." Returns 1 if successful, 0 if unsuccessful.

The command and reply parameters must be 63 bytes in length.

Argument

HANDLE* pHandle        Device handle

The device handle is acquired by the function, OpenCommanderHID

char* command                Command

Requires the storage capacity for 63 bytes

char* reply                Reply data

Requires the storage capacity for 63 bytes

Reply

Int type

0                Send Receive failed

1                Send Receive success

Other (-value)        Host communication failed (3.1.2.7 Communication Error Codes)

Example

  1. VC

int result;                                                                //  Function result

HANDLE devHandle;                                                        //  Device handle

char cmdStr[64];                                                                //  Command string

char replyStr[64];                                                        //  Reply string


strcpy(cmdStr, “PX”);                                                        //  Specify a command string

result = SendReceiveCommanderHID(devHandle, cmdStr, replyStr);        //  Execute the communication

  1. VB

Public devHandle As Integer                                                ‘  Device handle

Dim result as Integer                                                        ‘  Function result

Dim cmdStr As New String(””, 63)                                                ‘  Command string

Dim replyStr As New String(””, 63)                                                ‘  Reply string

       

cmdStr = PX                                                                ‘  Specify a command string

result = SendReceiveCommanderHID(devHandle, cmdStr, replyStr);        ‘  Execute the communication


< Previous SubSection | Topic Home | Home | Next SubSection >