OpenCommanderByIndex

Overview

Opens a device to a Commander core device by its device index string. Returns 1 if successful, 0 if unsuccessful.

Execute this for restart after disconnecting with the function, CloseCommander.

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 GetCommanderID.


Reply

Type: Int  


Value

Meaning

0

Send/Receive failed

1

Send/Receive success

Other (negative)

Host communication failed (see Communication Error Codes)


Examples

  • Visual C (VC)

int result;                                                //  Function result

HANDLE devHandle;                                        //  Device handle

char devName[16];                                        //  Serial number                                                  string

result = OpenCommanderByID(devHandle, devName);        //  Open                                                 device, Obtain handle


  • Visual Basic (VB)

Public devHandle As Integer                        ‘  Device handle

Public devName As New String(“”, 15)        ‘  Serial number                                                string

Dim result as Integer                                 ‘  Function result

result = OpenCommanderByID(devHandle, devName);        ‘  Open device,                                             Obtain handle


  • C/C++

example


  • Python

example


  • WPF (C#)

example


  • Winforms (C#)

example

REPOSITORY PLACEHOLDER LINK

< Previous | Topic Home | Home |  Next  >