TBApiSendData API Call

 

Description

Sends data to the controller associated with the specified device.

Parameters

Device handle, length of data and delay period in milliseconds.

Returns

0 = fail, 1 = OK.

Notes

Before using this API call, you should be aware of the capabilities of your particular device. Some devices support command sets which this API can be used to invoke. Typically, this might involve operations such as backlighting control, EEPROM updates, enabling/disabling functionality etc. You should check your device’s technical specification before attempting to send commands using this call.

 

Visual C++ Declaration/example

 

BOOL TBAPI TBApiSendData(HTBDEVICE aDeviceHandle, void* data, DWORD length, DWORD aDelay);

 

// Sends data to the controller associated with the specified device

// The following example sends the (fictitious) command "BIN" with a 1 millisecond delay between characters

HTBDEVICE device = TBApiGetRelativeDevice(0);

char msg[]="BIN";

TBApiSendData(device, msg, _tcslen(msg), 1);

 

Visual Basic Declaration/example

 

Public Declare Function TBApiSendData Lib "TBapi" Alias "_DLL_TBApiSendData@16" (ByVal aDeviceHandle As Long, ByVal Data As String, ByVal length As Long, ByVal aDelay As Long) As Long

 

‘ Sends data to the controller associated with the specified device

 ‘ The following example sends the  (fictitious)  command "BIN" with a 1 millisecond delay between characters

Dim device As Byte

device = TBApiGetRelativeDevice(0)

Dim msg As String

msg = "BIN"

TBApiSendData device, msg, Len(msg), 1