Description

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 buffer must be smaller than 64 bytes in length.

The reply buffer must be at least 63 bytes in length.

Arguments

pHandle

Type: CommanderDeviceHandle*  

Pointer to a device‑handle variable.

command

Type: char*  

ASCII command string to be sent to the Commander.

reply

Type: char*  

Buffer to receive the response from the Commander.

Return Value

Type: Int  

Value

Meaning

0

Failure

1

Success

Other (negative)

Host communication failed (see Communication Error Codes)

Examples

  • Python

api = DLLInterface()

# Send and Receive Commander

command = 'VER'

reply = ctypes.create_string_buffer(64)  # Allocate buffer for the reply

return = api.dll.SendReceiveCommander(handle, command.encode('utf-8'), reply)

if return:

   print(f"Sent: {command}, Received: {reply}")


V 1.0 Function: SendReceiveCommanderHID(HANDLE* pHandle, char* command, char* reply)


REPOSITORY PLACEHOLDER LINK



< Previous | Topic Home | Home |  Next  >