vrpn 07.35
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
vrpn_Serial.h
Go to the documentation of this file.
1#ifndef VRPN_SERIAL_H
2#define VRPN_SERIAL_H
3
4#include "vrpn_Configure.h" // for VRPN_API
5#include <stddef.h> // For size_t
6
14
15typedef enum {
22
31extern VRPN_API int
32vrpn_open_commport(const char *portname, long baud, int charsize = 8,
34 bool rts_flow = false);
35
42extern VRPN_API int vrpn_set_rts(int comm);
43extern VRPN_API int vrpn_clear_rts(int comm);
45
46extern VRPN_API int vrpn_close_commport(int comm);
47
50extern VRPN_API int vrpn_flush_input_buffer(int comm);
51
54extern VRPN_API int vrpn_flush_output_buffer(int comm);
55
60extern VRPN_API int vrpn_drain_output_buffer(int comm);
61
70extern VRPN_API int
71vrpn_read_available_characters(int comm, unsigned char *buffer, size_t count);
73 unsigned char *buffer,
74 size_t count,
75 struct timeval *timeout);
77
86extern VRPN_API int vrpn_write_characters(int comm, const unsigned char *buffer,
87 size_t bytes);
88extern VRPN_API int vrpn_write_slowly(int comm, const unsigned char *buffer,
89 size_t bytes, int millisec_delay);
90
91#endif
#define VRPN_API
vrpn_SER_PARITY
Definition vrpn_Serial.h:15
@ vrpn_SER_PARITY_SPACE
Definition vrpn_Serial.h:20
@ vrpn_SER_PARITY_MARK
Definition vrpn_Serial.h:19
@ vrpn_SER_PARITY_ODD
Definition vrpn_Serial.h:17
@ vrpn_SER_PARITY_EVEN
Definition vrpn_Serial.h:18
@ vrpn_SER_PARITY_NONE
Definition vrpn_Serial.h:16
VRPN_API int vrpn_clear_rts(int comm)
VRPN_API int vrpn_read_available_characters(int comm, unsigned char *buffer, size_t count)
VRPN_API int vrpn_set_rts(int comm)
VRPN_API int vrpn_close_commport(int comm)
VRPN_API int vrpn_flush_input_buffer(int comm)
Throw out any characters within the input buffer.
VRPN_API int vrpn_open_commport(const char *portname, long baud, int charsize=8, vrpn_SER_PARITY parity=vrpn_SER_PARITY_NONE, bool rts_flow=false)
Open a serial port, given its name and baud rate.
Definition vrpn_Serial.C:54
VRPN_API int vrpn_flush_output_buffer(int comm)
Throw out any characters (do not send) within the output buffer.
VRPN_API int vrpn_write_characters(int comm, const unsigned char *buffer, size_t bytes)
Write the buffer to the serial port.
VRPN_API int vrpn_write_slowly(int comm, const unsigned char *buffer, size_t bytes, int millisec_delay)
VRPN_API int vrpn_drain_output_buffer(int comm)
Wait until all of the characters in the output buffer are sent, then return.