USBUART
A library for reading/wring data via USB-UART adapters
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Modules
Functions
capi.cpp File Reference

C-style API forwarders for USBUART Library. More...

Go to the source code of this file.

Functions

int usbuart_pipe_byaddr (struct device_addr ba, struct channel *ch, const struct eia_tia_232_info *pi)
 Create two pipes and attach their ends to the USB device using BUS/ADDR. More...
 
int usbuart_pipe_bydevid (struct device_addr id, struct channel *ch, const struct eia_tia_232_info *pi)
 
int usbuart_attach_byaddr (struct device_addr ba, struct channel ch, const struct eia_tia_232_info *pi)
 Attach pair of file descriptors to the USB device using BUS/ADDR. More...
 
int usbuart_attach_bydevid (struct device_addr id, struct channel ch, const struct eia_tia_232_info *pi)
 
void usbuart_close (struct channel ch)
 close pipes and USB device More...
 
int usbuart_reset (struct channel ch)
 resets USB device More...
 
int usbuart_break (struct channel ch)
 sends RS232 break signal to the USB device More...
 
int usbuart_loop (int timeout)
 run libusb and async I/O message loops More...
 
int usbuart_isgood (struct channel ch)
 

Function Documentation

int usbuart_attach_byaddr ( struct device_addr  ,
struct channel  ,
const struct eia_tia_232_info  
)
Parameters
ba- USB bus ID/device address
ch- pair of file descriptors
pi- protocol information
Returns
0 on success or error code

Definition at line 41 of file capi.cpp.

int usbuart_break ( struct channel  ch)

Send RS232 break signal to the USB device.

Definition at line 62 of file capi.cpp.

void usbuart_close ( struct channel  ch)

Close pipes and detach USB device.

Definition at line 52 of file capi.cpp.

int usbuart_loop ( int  timeout)

Run libusb and async I/O message loops.

Definition at line 66 of file capi.cpp.

int usbuart_pipe_byaddr ( struct device_addr  ba,
struct channel ch,
const struct eia_tia_232_info pi 
)
Parameters
ba- USB bus ID/device address
ch- destination that accepts pair of file descriptors
pi- protocol information
Returns
0 on success or error code

Definition at line 31 of file capi.cpp.

int usbuart_reset ( struct channel  ch)

Resets USB device.

Definition at line 57 of file capi.cpp.