libroboint
Functions
libroboint.c File Reference
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <semaphore.h>
#include <termios.h>
#include <fcntl.h>
#include <usb.h>
#include <sys/timerfd.h>
#include "crc.h"
#include "roboint.h"

Functions

long int GetLibVersion ()
 Returns lib version. More...
 
char * GetLibVersionStrg ()
 Returns lib version. More...
 
long int InitFtLib ()
 Library initialization (dummy) More...
 
long int InitFtUsbDeviceList ()
 Initiates and scans the USB bus. More...
 
unsigned int GetNumFtUsbDevice ()
 Get the count of found ft Interfaces over USB. More...
 
FT_HANDLE GetFtUsbDeviceHandle (unsigned char Num)
 Gets the handle to a ft USB device. More...
 
FT_HANDLE GetFtUsbDeviceHandleSerialNr (long int dwSN, long int dwTyp)
 Gets the handle to a ft USB device with a specific serial number. More...
 
FT_HANDLE OpenFtCommDevice (char *sDevice, long int dwTyp, long int dwZyklus)
 Gets the handle to a ft serial device. More...
 
long int GetFtDeviceTyp (FT_HANDLE hFt)
 Returns type of the interface. More...
 
long int GetFtDeviceTypeString (FT_HANDLE hFt, char *dest, int len)
 Returns a string that identifies the interface with human words. More...
 
long int OpenFtUsbDevice (FT_HANDLE hFt)
 Opens this USB device. More...
 
long int CloseFtDevice (FT_HANDLE hFt)
 Close the ft Device. More...
 
long int CloseFtLib ()
 Library deinitialization (dummy) More...
 
long int IsFtLibInit ()
 Check for Library initialization (dummy) More...
 
long int ResetFtTransfer (FT_HANDLE hFt)
 reset outputs More...
 
long int StartFtTransferArea (FT_HANDLE hFt, NOTIFICATION_EVENTS *ignored)
 Starts the communication thread. More...
 
long int StartFtTransferAreaWithCommunication (FT_HANDLE hFt, NOTIFICATION_EVENTS *ignored)
 Starts the communication thread. More...
 
FT_TRANSFER_AREAGetFtTransferAreaAddress (FT_HANDLE hFt)
 Get the transfer area. More...
 
long int StopFtTransferArea (FT_HANDLE hFt)
 Stops the communication thread. More...
 
long int IsFtTransferActiv (FT_HANDLE hFt)
 check if transfer is active. More...
 
long int DownloadFtProgram (FT_HANDLE hFt, long int dwMemBlock, unsigned char *pbArray, long int dwSize, long int dwParameter, unsigned char *pbName, long int dwNameLen)
 Upload a program to the interface. More...
 
long int StartFtProgram (FT_HANDLE hFt, long int dwMemBlock)
 Start a program. More...
 
long int StopFtProgram (FT_HANDLE hFt)
 Stop a program. More...
 
long int DeleteFtProgram (FT_HANDLE hFt, long int dwMemBlock)
 Delete a program. More...
 
long int SetFtProgramActiv (FT_HANDLE hFt, long int dwMemBlock)
 Activate a program. More...
 
long int GetFtProgramName (FT_HANDLE hFt, long int dwMemBlock, long int dwSize, void *pName)
 Get the name of a program. More...
 
int GetFtStatus (FT_HANDLE hFt, int *num)
 Checks if a program is running. More...
 
long int GetFtFirmware (FT_HANDLE hFt)
 Get the firmware number of this interface. More...
 
char * GetFtFirmwareStrg (FT_HANDLE hFt)
 Get the firmware number of this interface. More...
 
long int GetFtSerialNr (FT_HANDLE hFt)
 Get the serial number of this interface. More...
 
char * GetFtSerialNrStrg (FT_HANDLE hFt)
 Get the serial number of this interface. More...
 
long int CloseAllFtDevices ()
 Close all ft devices. More...
 
long int SetFtDistanceSensorMode (FT_HANDLE hFt, long int dwMode, long int dwTol1, long int dwTol2, long int dwLevel1, long int dwLevel2, long int dwRepeat1, long int dwRepeat2)
 Set the inputs D1 and D2 to distance oder voltage measuring. More...
 
long int SetRFMode (FT_HANDLE hFt, long int frequency, long int callSign)
 Sets the frequency and call sign for a Robo Interface or RF Data Link. More...
 
long int GetRFMode (FT_HANDLE hFt, long int *frequency, long int *callSign)
 Gets the frequency and call sign of a Robo Interface or RF Data Link. More...
 
long int SetRealSerial (FT_HANDLE hFt, unsigned char bOn)
 Switches between the real serial and 0001 of a device. More...
 
char * GetFtManufacturerStrg (FT_HANDLE hFt)
 Gets the Manufacturer of the Interface. More...
 
char * GetFtShortNameStrg (FT_HANDLE hFt)
 Gets the short name of the Interface. More...
 
char * GetFtLongNameStrg (FT_HANDLE hFt)
 Gets the long name of the Interface. More...
 
char IsFtInterfaceConnected (FT_HANDLE hFt)
 Tells if we successfuly got a connection to the Interface. More...
 
char * GetFtLibErrorString (long int dwErrorCode, long int dwTyp)
 Gets the description of an error. More...
 

Detailed Description

Copyright (C) 2013 Erik Andresen erik@.nosp@m.vont.nosp@m.aene..nosp@m.de

Open Source version of the fischertechnik ROBO Interface Library for Unix like systems

Communication is done through a "transfer area" this is constantly updated.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Function Documentation

◆ CloseAllFtDevices()

long int CloseAllFtDevices ( )

Close all ft devices.

Dummy. Can't be supported. Only used in original library.

Returns
Always FTLIB_ERR_NOT_SUPPORTED

◆ CloseFtDevice()

long int CloseFtDevice ( FT_HANDLE  hFt)

Close the ft Device.

This function will close the ft Device and free its memory. Warning: CloseFtDevice() will also free() the allocated memory for this device! Meaning, that you should not call OpenFtUsbDevice() after CloseFtDevice().

Parameters
hFtHandle of the Device to close.
Returns
A number < 0 on error.

References ft_handle_devices::device, ft_handle_devices::saveioset, ft_handle_devices::sdev, ft_handle_devices::transfer_area, _FT_TRANSFER_AREA::TransferAktiv, and ft_handle_devices::type.

Referenced by GetFtUsbDeviceHandleSerialNr().

◆ CloseFtLib()

long int CloseFtLib ( )

Library deinitialization (dummy)

Dummy for compatibility. Only used in original library.

Returns
Always FTLIB_ERR_SUCCESS

◆ DeleteFtProgram()

long int DeleteFtProgram ( FT_HANDLE  hFt,
long int  dwMemBlock 
)

Delete a program.

Will delete a program that has been uploaded to the interface.

Parameters
hFtHandle of the Interface
dwMemBlockDestination 0 (Flash 1), 1 (Flash 2) or 2 (Ram)
Returns
FTLIB_ERR_SUCCESS or FTLIB_ERR_IF_NO_PROGRAM

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ DownloadFtProgram()

long int DownloadFtProgram ( FT_HANDLE  hFt,
long int  dwMemBlock,
unsigned char *  pbArray,
long int  dwSize,
long int  dwParameter,
unsigned char *  pbName,
long int  dwNameLen 
)

Upload a program to the interface.

Upload (download from the perspective of the interface) a program to the interface.

Parameters
hFtHandle of the Interface
dwMemBlockDestination 0 (Flash 1), 1 (Flash 2) or 2 (Ram)
pbArrayPointer to the program to upload
dwSizeSize of the program to upload
dwParameter1 to Autostart this program, else 0.
pbNameName of the program to upload
dwNameLenLength of the name
Returns
FTLIB_ERR_SUCCESS if you got lucky

References ft_handle_devices::device, and ft_handle_devices::type.

◆ GetFtDeviceTyp()

long int GetFtDeviceTyp ( FT_HANDLE  hFt)

Returns type of the interface.

This function will return the type of the interface that is behind the handle.

Parameters
hFtHandle of the device
Returns
NO_FT_DEVICE, FT_INTELLIGENT_IF, FT_INTELLIGENT_IF_SLAVE, FT_ROBO_IF_COM, FT_ROBO_IF_USB, FT_ROBO_IF_IIM, FT_ROBO_IF_OVER_RF, FT_ROBO_IO_EXTENSION or FT_ROBO_RF_DATA_LINK

References ft_handle_devices::type.

Referenced by GetFtDeviceTypeString().

◆ GetFtDeviceTypeString()

long int GetFtDeviceTypeString ( FT_HANDLE  hFt,
char *  dest,
int  len 
)

Returns a string that identifies the interface with human words.

This function will give you a human readable string like "Robo Interface" you can work with.

Parameters
hFtHandle of the device
destBuffer we can write the string to
lenMaximum length of this buffer
Returns
FTLIB_ERR_SUCCESS or a failure

References GetFtDeviceTyp().

◆ GetFtFirmware()

long int GetFtFirmware ( FT_HANDLE  hFt)

Get the firmware number of this interface.

Returns the firmware number of the interface squashed into a single int.

Parameters
hFtHandle of the Interface
Returns
Firmware number as int byte4 | byte3 | byte2 | byte1, 0 on error.

References ft_handle_devices::device, _FT_TRANSFER_AREA::RfModulNr, ft_handle_devices::sdev, ft_handle_devices::transfer_area, and ft_handle_devices::type.

Referenced by GetFtFirmwareStrg().

◆ GetFtFirmwareStrg()

char* GetFtFirmwareStrg ( FT_HANDLE  hFt)

Get the firmware number of this interface.

Returns the firmware number of the interface with this handle. The allocated space should be freed with free() later.

Parameters
hFtHandle of the Interface
Returns
Pointer to a string with the firmware

References GetFtFirmware().

◆ GetFtLibErrorString()

char* GetFtLibErrorString ( long int  dwErrorCode,
long int  dwTyp 
)

Gets the description of an error.

Will return a description of an error. The allocated space should be freed with free() later.

The return value is the constant as string if parameter dwTyp is 0, else a verbose description of the error.

Parameters
dwErrorCodeError Code
dwTypType of the return value (see description)
Returns
Pointer to a string (see description)

◆ GetFtLongNameStrg()

char* GetFtLongNameStrg ( FT_HANDLE  hFt)

Gets the long name of the Interface.

Will return the long name of a fischertechnik USB device. The allocated space should be freed with free() later.

Parameters
hFtHandle of the Interface
Returns
Pointer to the string with the name

References ft_handle_devices::device, and ft_handle_devices::type.

◆ GetFtManufacturerStrg()

char* GetFtManufacturerStrg ( FT_HANDLE  hFt)

Gets the Manufacturer of the Interface.

Will return the Manufacturer of a fischertechnik USB device. The allocated space should be freed with free() later.

Parameters
hFtHandle of the Interface
Returns
Pointer to the string with the name

References ft_handle_devices::device, and ft_handle_devices::type.

◆ GetFtProgramName()

long int GetFtProgramName ( FT_HANDLE  hFt,
long int  dwMemBlock,
long int  dwSize,
void *  pName 
)

Get the name of a program.

Will write the name of a program that has been uploaded to the interface to a given area.

Parameters
hFtHandle of the Interface
dwMemBlockDestination 0 (Flash 1), 1 (Flash 2) or 2 (Ram)
pNamePointer to the area where we can store the name
dwSizeSize of the area to store the name to
Returns
FTLIB_ERR_SUCCESS or FTLIB_ERR_IF_NO_PROGRAM

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ GetFtSerialNr()

long int GetFtSerialNr ( FT_HANDLE  hFt)

Get the serial number of this interface.

Returns the serial number of the interface squashed into a single int.

Parameters
hFtHandle of the Interface
Returns
Serial number as int byte4 | byte3 | byte2 | byte1, 0 on error.

References ft_handle_devices::device, _FT_TRANSFER_AREA::RfModulNr, ft_handle_devices::sdev, ft_handle_devices::transfer_area, and ft_handle_devices::type.

Referenced by GetFtSerialNrStrg(), and GetFtUsbDeviceHandleSerialNr().

◆ GetFtSerialNrStrg()

char* GetFtSerialNrStrg ( FT_HANDLE  hFt)

Get the serial number of this interface.

Returns the serial number of the interface with this handle. The allocated space should be freed with free() later.

Parameters
hFtHandle of the Interface
Returns
Pointer to a string with the serial

References GetFtSerialNr().

◆ GetFtShortNameStrg()

char* GetFtShortNameStrg ( FT_HANDLE  hFt)

Gets the short name of the Interface.

Will return the short name of a fischertechnik USB device. The allocated space should be freed with free() later.

Parameters
hFtHandle of the Interface
Returns
Pointer to the string with the name

References ft_handle_devices::device, and ft_handle_devices::type.

◆ GetFtStatus()

int GetFtStatus ( FT_HANDLE  hFt,
int *  num 
)

Checks if a program is running.

Checks if a program is currently running.

Parameters
hFtHandle of the Interface
numArea where we can store the number of the running program.
Returns
1 if a program is running, else 0

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ GetFtTransferAreaAddress()

FT_TRANSFER_AREA* GetFtTransferAreaAddress ( FT_HANDLE  hFt)

Get the transfer area.

This function will return a pointer to the transfer area of the given handle.

Parameters
hFtHandle of the device.
Returns
transfer area or NULL on error.

References ft_handle_devices::transfer_area.

◆ GetFtUsbDeviceHandle()

FT_HANDLE GetFtUsbDeviceHandle ( unsigned char  Num)

Gets the handle to a ft USB device.

doxygen ignore end

Get the handle for the ft USB device with this number. Passing just 0 as argument will use the first device found.

Count the interfaces with GetNumFtUsbDevice()

See also
GetNumFtUsbDevice()
Parameters
Numselected Interface. If unsure try 0.
Returns
The ft device or NULL if error

References ft_handle_devices::dev, ft_handle_devices::device, ft_handle_devices::interface_connected, ft_handle_devices::lock, ft_handle_devices::query_time, _FT_TRANSFER_AREA::RfModulNr, ft_handle_devices::sdev, ft_handle_devices::transfer_area, _FT_TRANSFER_AREA::TransferAktiv, and ft_handle_devices::type.

Referenced by GetFtUsbDeviceHandleSerialNr().

◆ GetFtUsbDeviceHandleSerialNr()

FT_HANDLE GetFtUsbDeviceHandleSerialNr ( long int  dwSN,
long int  dwTyp 
)

Gets the handle to a ft USB device with a specific serial number.

Get the handle for the ft USB device with this number. Serial is 1 for most devices, unless explicitly changed in the device. Second argument can be FT_AUTO_TYPE.

Parameters
dwSNSerial of the USB Device
dwTypType of the USB Device: FT_AUTO_TYPE, FT_ROBO_IF_USB, FT_ROBO_IO_EXTENSION, FT_ROBO_IF_OVER_RF or FT_ROBO_RF_DATA_LINK
Returns
The ft device or NULL on error

References CloseFtDevice(), GetFtSerialNr(), GetFtUsbDeviceHandle(), GetNumFtUsbDevice(), OpenFtUsbDevice(), and ft_handle_devices::type.

◆ GetLibVersion()

long int GetLibVersion ( )

Returns lib version.

doxygen ignore end

Returns the library version.

Returns
version as Major Minor Patch

Referenced by GetLibVersionStrg().

◆ GetLibVersionStrg()

char* GetLibVersionStrg ( )

Returns lib version.

Returns the library version. The allocated space should be freed with free() later.

Returns
Pointer to a string with the serial

References GetLibVersion().

◆ GetNumFtUsbDevice()

unsigned int GetNumFtUsbDevice ( )

Get the count of found ft Interfaces over USB.

doxygen ignore end

If we find a Robo RF Data Link we will count the devices attached to it instead

Returns
Number of ft Interface devices on the USB bus found.

Referenced by GetFtUsbDeviceHandleSerialNr().

◆ GetRFMode()

long int GetRFMode ( FT_HANDLE  hFt,
long int *  frequency,
long int *  callSign 
)

Gets the frequency and call sign of a Robo Interface or RF Data Link.

Sets the frequency and call sign which allows to control multiple Interfaces at one RF Data Link.

Parameters
hFtHandle of the Interface
frequencyPoints to a place to store the frequency.
callSignPoints to a place to store the callSign. (Value will be 0 for the RF Data Link)
Returns
FTLIB_ERR_SUCCESS on success

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ InitFtLib()

long int InitFtLib ( )

Library initialization (dummy)

Dummy for compatibility. Only used in original library.

Returns
Always FTLIB_ERR_SUCCESS

◆ InitFtUsbDeviceList()

long int InitFtUsbDeviceList ( )

Initiates and scans the USB bus.

This function has to be called before any other USB action. It will set up USB basic variables and then scan the USB bus.

Returns
Always FTLIB_ERR_SUCCESS. Not able to fail.

◆ IsFtInterfaceConnected()

char IsFtInterfaceConnected ( FT_HANDLE  hFt)

Tells if we successfuly got a connection to the Interface.

Parameters
hFtHandle of the Interface
Returns
0 if the Interface is not connected

References ft_handle_devices::interface_connected.

◆ IsFtLibInit()

long int IsFtLibInit ( )

Check for Library initialization (dummy)

Dummy for compatibility. Only used in original library.

Returns
Always FTLIB_ERR_LIB_IS_INITIALIZED since initialization is ignored in this version

◆ IsFtTransferActiv()

long int IsFtTransferActiv ( FT_HANDLE  hFt)

check if transfer is active.

Check if we are currently communicating with the device.

Parameters
hFtHandle of the Interface.
Returns
FTLIB_ERR_THREAD_IS_RUNNING or FTLIB_ERR_THREAD_NOT_RUNNING

References ft_handle_devices::transfer_area, and _FT_TRANSFER_AREA::TransferAktiv.

◆ OpenFtCommDevice()

FT_HANDLE OpenFtCommDevice ( char *  sDevice,
long int  dwTyp,
long int  dwZyklus 
)

Gets the handle to a ft serial device.

Get the handle for the ft Serial device at the selected serial port.

Parameters
sDevicefilename of your serial device, like /dev/ttyS0.
dwTypInterface type. FT_INTELLIGENT_IF, FT_INTELLIGENT_IF_SLAVE or FT_ROBO_IF_COM.
dwZyklusCycle to retrieve analog values (only II). Try 10.
Returns
The ft device or NULL if error.

References ft_handle_devices::analogcycle, _FT_TRANSFER_AREA::BusModules, ft_handle_devices::dev, ft_handle_devices::device, ft_handle_devices::interface_connected, ft_handle_devices::lock, ft_handle_devices::newioset, ft_handle_devices::query_time, _FT_TRANSFER_AREA::RfModulNr, ft_handle_devices::saveioset, ft_handle_devices::sdev, ft_handle_devices::transfer_area, _FT_TRANSFER_AREA::TransferAktiv, and ft_handle_devices::type.

◆ OpenFtUsbDevice()

long int OpenFtUsbDevice ( FT_HANDLE  hFt)

Opens this USB device.

This function will try to open the ft USB device that belongs to the ft handle hFt. You can get the ft handle with GetFtUsbDeviceHandle() or GetFtUsbDeviceHandleSerialNr().

See also
GetFtUsbDeviceHandle()
GetFtUsbDeviceHandleSerialNr()
Parameters
hFtft USB Device to open
Returns
Number >= 0 on success, < 0 on error

References ft_handle_devices::dev, and ft_handle_devices::device.

Referenced by GetFtUsbDeviceHandleSerialNr().

◆ ResetFtTransfer()

long int ResetFtTransfer ( FT_HANDLE  hFt)

reset outputs

doxygen ignore end

Will clear all outputs.

Returns
Always FTLIB_ERR_SUCCESS

References _FT_TRANSFER_AREA::M_Main, _FT_TRANSFER_AREA::M_Sub1, _FT_TRANSFER_AREA::M_Sub2, _FT_TRANSFER_AREA::M_Sub3, and ft_handle_devices::transfer_area.

◆ SetFtDistanceSensorMode()

long int SetFtDistanceSensorMode ( FT_HANDLE  hFt,
long int  dwMode,
long int  dwTol1,
long int  dwTol2,
long int  dwLevel1,
long int  dwLevel2,
long int  dwRepeat1,
long int  dwRepeat2 
)

Set the inputs D1 and D2 to distance oder voltage measuring.

This function allows to enable the inputs D1 and D2 to measure distances. Must be called before StartFtTransferArea()

Note by Hardware Vendor: "Since the operating mode of the D1 / D2 inputs can be set by means of software, we recommend that no voltage be supplied 'directly' to these connections in order to avoid damage to the interface during software errors. Since the inputs are highly resistive, a resistance of approximately 200 Ohm - 470 Ohm should be directly connected to the D1 / D2 socket (series connection). We recommend to connect the voltage range to be measured 'behind' it."

Parameters
hFtHandle of the Interface
dwModeSet mode to IF_DS_INPUT_VOLTAGE (measure voltage) or IF_DS_INPUT_DISTANCE (measure distance)
dwTol1Range of tolerance for D1. Try IF_DS_INPUT_TOL_STD (20).
dwTol2Range of tolerance for D2. Try IF_DS_INPUT_TOL_STD (20).
dwLevel1Threshold for D1. Try 100.
dwLevel2Threshold for D2. Try 100.
dwRepeat1Repition value for D1. Try IF_DS_INPUT_REP_STD (3).
dwRepeat2Repition value for D2. Try IF_DS_INPUT_REP_STD (3).
Returns
FTLIB_ERR_SUCCESS on success

References ft_handle_devices::device, _FT_TRANSFER_AREA::RfModulNr, ft_handle_devices::sdev, ft_handle_devices::transfer_area, and ft_handle_devices::type.

◆ SetFtProgramActiv()

long int SetFtProgramActiv ( FT_HANDLE  hFt,
long int  dwMemBlock 
)

Activate a program.

Will activate a program that has been uploaded to the interface.

Parameters
hFtHandle of the Interface
dwMemBlockDestination 0 (Flash 1) or 1 (Flash 2)
Returns
FTLIB_ERR_SUCCESS or FTLIB_ERR_IF_NO_PROGRAM

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ SetRealSerial()

long int SetRealSerial ( FT_HANDLE  hFt,
unsigned char  bOn 
)

Switches between the real serial and 0001 of a device.

Every ft Interface is shipped with 0001 as serial. Nevertheless each has its own serial which can be activated.

Parameters
hFtHandle of the Interface
bOn0 to use 0001, else the real serial
Returns
FTLIB_ERR_SUCCESS on success

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ SetRFMode()

long int SetRFMode ( FT_HANDLE  hFt,
long int  frequency,
long int  callSign 
)

Sets the frequency and call sign for a Robo Interface or RF Data Link.

Sets the frequency and call sign which allows to control multiple Interfaces at one RF Data Link. The value won't be lost on power failure.

Parameters
hFtHandle of the Interface
frequencyto use. May be between 2 and 80.
callSigncall sign for this Interface. May be between 1 and 8. (ignored for the RF Data Link)
Returns
FTLIB_ERR_SUCCESS on success

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ StartFtProgram()

long int StartFtProgram ( FT_HANDLE  hFt,
long int  dwMemBlock 
)

Start a program.

Will start a program that has been Successfully uploaded to the interface.

Parameters
hFtHandle of the Interface
dwMemBlockDestination 0 (Flash 1), 1 (Flash 2) or 2 (Ram)
Returns
FTLIB_ERR_SUCCESS or FTLIB_ERR_IF_NO_PROGRAM

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ StartFtTransferArea()

long int StartFtTransferArea ( FT_HANDLE  hFt,
NOTIFICATION_EVENTS *  ignored 
)

Starts the communication thread.

This function is needed to start the communication with the interface in passive mode. Get the handle with GetFtUsbDeviceHandle(), GetFtUsbDeviceHandleSerialNr() or OpenFtCommDevice().

See also
GetFtUsbDeviceHandle()
GetFtUsbDeviceHandleSerialNr()
OpenFtCommDevice()
Parameters
hFtHandle of the interface.
ignoredThe second argument is ignored in this version.
Returns
Everything except FTLIB_ERR_SUCCESS indicates an error.

References ft_handle_devices::t.

Referenced by StartFtTransferAreaWithCommunication().

◆ StartFtTransferAreaWithCommunication()

long int StartFtTransferAreaWithCommunication ( FT_HANDLE  hFt,
NOTIFICATION_EVENTS *  ignored 
)

Starts the communication thread.

Since notification are ignored in this version, will just call StartFtTransferArea().

See also
StartFtTransferArea()

References StartFtTransferArea().

◆ StopFtProgram()

long int StopFtProgram ( FT_HANDLE  hFt)

Stop a program.

Will stop the current running program that has been uploaded to the interface.

Parameters
hFtHandle of the Interface
Returns
FTLIB_ERR_SUCCESS or FTLIB_ERR_IF_NO_PROGRAM

References ft_handle_devices::device, ft_handle_devices::sdev, and ft_handle_devices::type.

◆ StopFtTransferArea()

long int StopFtTransferArea ( FT_HANDLE  hFt)

Stops the communication thread.

Warning
Will block a few microseconds until thread stopped.

This function will stop the communication thread.

See also
StartFtTransferArea()
Parameters
hFtHandle of the Interface.
Returns
Everything except FTLIB_ERR_SUCCESS indicates an error.

References ft_handle_devices::t, ft_handle_devices::transfer_area, and _FT_TRANSFER_AREA::TransferAktiv.