TDCBase
Functions
tdcmultidev.h File Reference

Multi Device Handling for TDC devices. More...

#include "tdcdecl.h"

Go to the source code of this file.

Functions

TDC_API int TDC_CC TDC_discover (unsigned int *devCount)
 Find Devices. More...
 
TDC_API int TDC_CC TDC_getDeviceInfo (unsigned int devNo, TDC_DevType *type, int *id, char *serialNo, Bln32 *connected)
 Inspect a Device. More...
 
TDC_API int TDC_CC TDC_connect (unsigned int devNo)
 Connect to a Device. More...
 
TDC_API int TDC_CC TDC_disconnect (unsigned int devNo)
 Disconnect from a Device. More...
 
TDC_API int TDC_CC TDC_addressDevice (unsigned int devNo)
 Address a Device. More...
 
TDC_API int TDC_CC TDC_getCurrentAddress (unsigned int *devNo)
 Current Device Address. More...
 

Detailed Description

Multi Device Handling for TDC devices.

These functions allow to access multiple TDC devices at the same time from one program. The functions are alternatives to TDC_init and TDC_deInit.

Use TDC_discover to find the connected devices and TDC_getDeviceInfo inspect them. A control connection to a device can be established with TDC_connect. Use TDC_addressDevice to address the following commands to a specific connected device. To terminate the session, disconnect all devices using TDC_disconnect (TDC_deInit does that job also).

Definition in file tdcmultidev.h.

Function Documentation

TDC_API int TDC_CC TDC_addressDevice ( unsigned int  devNo)

Address a Device.

Selects a device as the target of the following function calls. All functions are affected that don't have a device number as input parameter.

Parameters
devNoNumber of the device to address, 0 ≤ devNo < devCount.
Returns
Error code
TDC_API int TDC_CC TDC_connect ( unsigned int  devNo)

Connect to a Device.

Establishes a connection to the selected device. This is a precondition for all function calls that affect that specific device, in particular for TDC_addressDevice. The call implicitly addresses the device.

Parameters
devNoNumber of the device to connect to, 0 ≤ devNo < devCount.
Returns
Error code
TDC_API int TDC_CC TDC_disconnect ( unsigned int  devNo)

Disconnect from a Device.

Closes the connection to the selected device. If the device was adressed, a new address has to be set (TDC_addressDevice). To disconnect from all devices at the same time, TDC_deInit can be used.

Parameters
devNoNumber of the device to disconnect from, 0 ≤ devNo < devCount.
Returns
Error code
TDC_API int TDC_CC TDC_discover ( unsigned int *  devCount)

Find Devices.

Initializes the library and searches for connected TDC devices. All existing device connections are closed.

The function is a precondition for all other function calls. Found devices can be inspected with TDC_getDeviceInfo and connected by TDC_connect. This procedure it is meant as an alternative to TDC_init.

Parameters
devCountOutput: Number of devices found
Returns
Error code
TDC_API int TDC_CC TDC_getCurrentAddress ( unsigned int *  devNo)

Current Device Address.

Retrieves the number of the currently addressed device. Returns error if no device is connected.

Parameters
devNoOutput: Number of the addressed device
Returns
Error code
TDC_API int TDC_CC TDC_getDeviceInfo ( unsigned int  devNo,
TDC_DevType type,
int *  id,
char *  serialNo,
Bln32 connected 
)

Inspect a Device.

Returns some informations about a device that has been found by TDC_discover. The device doesn't have to be connected. The pointers to the output variables may be NULL to ignore the value.

Parameters
devNoNumber of the device to inspect, 0 ≤ devNo < devCount.
typeOutput: Type of the device
idOutput: Device ID as programmed by the user
serialNoOutput: Serial number of the device. The string buffer must be at least 16 bytes long.
connectedOutput: If the device is connected by TDC_connect
Returns
Error code