Wiicom API Lib
 Tutto Strutture dati File Funzioni Variabili Ridefinizioni di tipo (typedef) Tipi enumerati (enum) Valori del tipo enumerato Definizioni Gruppi
Riferimenti per il file C:/WIICOM-SVN/Sviluppo/Software/library/wiicom_lib/trunk/wiicom_libvcp.c

Wiicom virtual com port library. Continua...

#include "wiicom_libvcp.h"

Definizioni

#define VCP_NUM_MAX_TIME_WRITE   5
 
#define MAX_NUM_VCP   25
 

Funzioni

uint8_t wiicom_libvcp_open (t_wiicom_libvcp_handle *fd, char *device, uint32_t vcp_baudrate, uint8_t vcp_parity, uint8_t vcp_stop2bit, uint8_t vcp_data_bits_size)
 Function that open a VCP and returns a VCP handle. Continua...
 
void wiicom_libvcp_close (t_wiicom_libvcp_handle fd)
 Function that close a VCP handle. Continua...
 
long wiicom_libvcp_read (t_wiicom_libvcp_handle fd, uint8_t *buffer, uint32_t buffer_size)
 Function that read data from a VCP handle. Continua...
 
long wiicom_libvcp_write (t_wiicom_libvcp_handle fd, uint8_t *buffer, uint32_t buffer_size)
 Function that write data to a VCP handle. Continua...
 
void wiicom_libvcp_deinit ()
 Function that de-initialize the vitual com port library
Warning! This function is called when not used any more a VCP or, in general, before the close of the program. Continua...
 
void wiicom_libvcp_init ()
 Function that initializes the vitual com port library
Warning! This function should be called before using the virtual com port. Continua...
 
long wiicom_libvcp_write_string (t_wiicom_libvcp_handle fd, char *string_to_write)
 Function that write a string to a VCP handle. Continua...
 
int wiicom_libvcp_getcomports (char ports[][15])
 Function that get all system VCP
Warning! This function works only on windows and linux system. Continua...
 

Descrizione dettagliata

Wiicom virtual com port library.

Generic library for managing a virtual com port

Autore
Marco Malano
WIICOM s.r.l
Versione
1.0.0
Data
2012
Attenzione
This library depends on wiicom_libutil
Every function that expects a result, in case of an error, set the Wiicom errno and print to stderr the error occurred.
Nota
None.

Documentazione delle definizioni

#define MAX_NUM_VCP   25
#define VCP_NUM_MAX_TIME_WRITE   5

Documentazione delle funzioni

void wiicom_libvcp_close ( t_wiicom_libvcp_handle  fd)

Function that close a VCP handle.

Parametri
[in]fdVCP handle
Restituisce
void
void wiicom_libvcp_deinit ( )

Function that de-initialize the vitual com port library
Warning! This function is called when not used any more a VCP or, in general, before the close of the program.

Restituisce
void
int wiicom_libvcp_getcomports ( char  ports[][15])

Function that get all system VCP
Warning! This function works only on windows and linux system.

Parametri
[out]portsarray width discoverd ports
Restituisce
number of discoverd ports
void wiicom_libvcp_init ( )

Function that initializes the vitual com port library
Warning! This function should be called before using the virtual com port.

Restituisce
void
uint8_t wiicom_libvcp_open ( t_wiicom_libvcp_handle fd,
char *  device,
uint32_t  vcp_baudrate,
uint8_t  vcp_parity,
uint8_t  vcp_stop2bit,
uint8_t  vcp_data_bits_size 
)

Function that open a VCP and returns a VCP handle.

Parametri
[out]fdVCP handle
[in]devicea virtual serial port device (Ex. /dev/stty0 on Unix like, \\\\.\\COM5 on Windows)
[in]vcp_baudratespecifies a Baud rate speeds
[in]vcp_parityspecifies a parity type
[in]vcp_stop2bitspecifies if there is a 2 bits stop, otherwise there is 1 bit stop
[in]vcp_data_bits_sizeit is a data bits size
Restituisce
On success, TRUE is returned, On error, FALSE is returned
long wiicom_libvcp_read ( t_wiicom_libvcp_handle  fd,
uint8_t *  buffer,
uint32_t  buffer_size 
)

Function that read data from a VCP handle.

Parametri
[in]fdVCP handle
[out]bufferbuffer in which datas are loaded
[in]buffer_sizesize of the buffer containing the data read
Restituisce
On success, number of bytes received. On error, -1 is returned
long wiicom_libvcp_write ( t_wiicom_libvcp_handle  fd,
uint8_t *  buffer,
uint32_t  buffer_size 
)

Function that write data to a VCP handle.

Parametri
[in]fdVCP handle
[in]bufferit contains data to send
[in]buffer_sizesize of the buffer to send
Restituisce
On success, number of bytes transmitted. On error, -1 is returned
long wiicom_libvcp_write_string ( t_wiicom_libvcp_handle  fd,
char *  string_to_write 
)

Function that write a string to a VCP handle.

Parametri
[in]fdVCP handle
[in]string_to_writeit contains a string to send
Restituisce
On success, number of bytes transmitted. On error, -1 is returned

Documentazione delle variabili

struct termios attributes
int vcp_handle