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 padded with NullChar to make they 63 bytes in length, and must be NULL terminated. Therefore the real max size is 62 chars with the added NULL.


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 (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 >