| Entry Points

### ticables_library_init

int TICALL ticables_library_init(void)

This function must be the first one to call. It inits library internals.

Return value : | the instance count.

### ticables_library_exit

int TICALL ticables_library_exit(void)

This function must be the last one to call. Used to release internal resources.

Return value : | the instance count.

### ticables_version_get

const char *TICALL ticables_version_get(void)

This function returns the library version like "X.Y.Z".

Return value : | a string.

### ticables_supported_cables

uint32_t TICALL ticables_supported_cables(void)

This function returns the cables built into the current binary.

Return value : | an integer containing a binary OR of (1 << CABLE_*) values, where CABLE_* values are defined in enum CableModel.

### ticables_max_ports

uint32_t TICALL ticables_max_ports(void)

This function returns the maximum number of ports supported for any given cable.

Return value : | the PORT_MAX value against which the library was built.

### ticables_handle_new

CableHandle* TICALL ticables_handle_new(CableModel model, CablePort port)

Create a new handle associated with the given cable on the given port. Must be freed with ticables_handle_del when no longer needed. Note: the handle is a pointer on an opaque structure and should not be modified.

model : | a cable model
port : | the generic port on which cable is attached.
Return value : | NULL if error, an handle otherwise.

### ticables_handle_del

int TICALL ticables_handle_del(CableHandle* handle)

Release the cable and free the associated resources.

handle : | the handle
Return value : | always 0.

### ticables_options_set_timeout

unsigned int TICALL ticables_options_set_timeout(CableHandle* handle, unsigned int timeout)

Set timeout for any cable.

handle : | the handle
timeout : | timeout value in tenth of seconds
Return value : | the previous timeout.

### ticables_options_set_delay

unsigned int TICALL ticables_options_set_delay(CableHandle* handle, unsigned int delay)

Set inter-bit delay for parallel or BlackLink cable.

handle : | the handle
delay : | delay in micro-seconds
Return value : | the previous delay.

### ticables_get_model

CableModel TICALL ticables_get_model(CableHandle* handle)

Retrieve link cable model.

handle : | the handle
Return value : | the previous #CableModel value.

### ticables_get_port

CablePort TICALL ticables_get_port(CableHandle* handle)

Retrieve link port.

handle : | the handle
Return value : | a #CablePort value.

### ticables_get_device

const char * TICALL ticables_get_device(CableHandle* handle)

Retrieve device port.

handle : | the handle
Return value : | a char pointer.

### ticables_get_timeout

unsigned int TICALL ticables_get_timeout(CableHandle *handle)

Retrieve timeout.

handle : | the handle
Return value : | an unsigned integer;

### ticables_get_delay

unsigned int TICALL ticables_get_delay(CableHandle *handle)

Retrieve timeout.

handle : | the handle
Return value : | an unsigned integer;

### ticables_handle_show

int TICALL ticables_handle_show(CableHandle* handle)

Show information stored in the handle.

handle : | the handle
Return value : | always 0.

### Return to the main index