vrpn
07.35
Virtual Reality Peripheral Network
Toggle main menu visibility
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
15
typedef
enum
{
16
vrpn_SER_PARITY_NONE
,
17
vrpn_SER_PARITY_ODD
,
18
vrpn_SER_PARITY_EVEN
,
19
vrpn_SER_PARITY_MARK
,
20
vrpn_SER_PARITY_SPACE
21
}
vrpn_SER_PARITY
;
22
31
extern
VRPN_API
int
32
vrpn_open_commport
(
const
char
*portname,
long
baud,
int
charsize = 8,
33
vrpn_SER_PARITY
parity =
vrpn_SER_PARITY_NONE
,
34
bool
rts_flow =
false
);
35
42
extern
VRPN_API
int
vrpn_set_rts
(
int
comm);
43
extern
VRPN_API
int
vrpn_clear_rts
(
int
comm);
45
46
extern
VRPN_API
int
vrpn_close_commport
(
int
comm);
47
50
extern
VRPN_API
int
vrpn_flush_input_buffer
(
int
comm);
51
54
extern
VRPN_API
int
vrpn_flush_output_buffer
(
int
comm);
55
60
extern
VRPN_API
int
vrpn_drain_output_buffer
(
int
comm);
61
70
extern
VRPN_API
int
71
vrpn_read_available_characters
(
int
comm,
unsigned
char
*buffer,
size_t
count);
72
extern
VRPN_API
int
vrpn_read_available_characters
(
int
comm,
73
unsigned
char
*buffer,
74
size_t
count,
75
struct
timeval *timeout);
77
86
extern
VRPN_API
int
vrpn_write_characters
(
int
comm,
const
unsigned
char
*buffer,
87
size_t
bytes);
88
extern
VRPN_API
int
vrpn_write_slowly
(
int
comm,
const
unsigned
char
*buffer,
89
size_t
bytes,
int
millisec_delay);
90
91
#endif
vrpn_Configure.h
VRPN_API
#define VRPN_API
Definition
vrpn_Configure.h:648
vrpn_SER_PARITY
vrpn_SER_PARITY
Definition
vrpn_Serial.h:15
vrpn_SER_PARITY_SPACE
@ vrpn_SER_PARITY_SPACE
Definition
vrpn_Serial.h:20
vrpn_SER_PARITY_MARK
@ vrpn_SER_PARITY_MARK
Definition
vrpn_Serial.h:19
vrpn_SER_PARITY_ODD
@ vrpn_SER_PARITY_ODD
Definition
vrpn_Serial.h:17
vrpn_SER_PARITY_EVEN
@ vrpn_SER_PARITY_EVEN
Definition
vrpn_Serial.h:18
vrpn_SER_PARITY_NONE
@ vrpn_SER_PARITY_NONE
Definition
vrpn_Serial.h:16
vrpn_clear_rts
VRPN_API int vrpn_clear_rts(int comm)
Definition
vrpn_Serial.C:402
vrpn_read_available_characters
VRPN_API int vrpn_read_available_characters(int comm, unsigned char *buffer, size_t count)
Definition
vrpn_Serial.C:515
vrpn_set_rts
VRPN_API int vrpn_set_rts(int comm)
Definition
vrpn_Serial.C:368
vrpn_close_commport
VRPN_API int vrpn_close_commport(int comm)
Definition
vrpn_Serial.C:348
vrpn_flush_input_buffer
VRPN_API int vrpn_flush_input_buffer(int comm)
Throw out any characters within the input buffer.
Definition
vrpn_Serial.C:438
vrpn_open_commport
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_flush_output_buffer
VRPN_API int vrpn_flush_output_buffer(int comm)
Throw out any characters (do not send) within the output buffer.
Definition
vrpn_Serial.C:465
vrpn_write_characters
VRPN_API int vrpn_write_characters(int comm, const unsigned char *buffer, size_t bytes)
Write the buffer to the serial port.
Definition
vrpn_Serial.C:651
vrpn_write_slowly
VRPN_API int vrpn_write_slowly(int comm, const unsigned char *buffer, size_t bytes, int millisec_delay)
Definition
vrpn_Serial.C:678
vrpn_drain_output_buffer
VRPN_API int vrpn_drain_output_buffer(int comm)
Wait until all of the characters in the output buffer are sent, then return.
Definition
vrpn_Serial.C:488
vrpn_Serial.h
Generated by
1.17.0