3.1.8 SendReceiveCommander
SendReceiveCommander
Overview
Sends a command to the Commander core device through the open path device, 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.
Arguments
pHandle
Type: CommanderDeviceHandle*
Pointer to a device‑handle variable.
Receives the opened device handle if the function succeeds.
name
Type: char*
Device name string.
The device name string is obtained using GetCommanderName.
Reply
Type: Int
|
Value |
Meaning |
|
0 |
Send/Receive failed |
|
1 |
Send/Receive success |
|
Other (-value) |
Host communication failed (see Communication Error Codes) |
Examples
- Visual C (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 = SendReceiveCommander(devHandle, cmdStr, replyStr); // Execute the communication |
- Visual Basic (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 = SendReceiveCommander(devHandle, cmdStr, replyStr); ‘ Execute the communication |
- C/C++
|
example |
- Python
|
example |
- WPF (C#)
|
example |
- Winforms (C#)
|
example |
V 1.0 Function: SendReceiveCommanderHID(HANDLE* pHandle, char* command, char* reply)
REPOSITORY PLACEHOLDER LINK
< Previous | Topic Home | Home | Next >