RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Serial.h
浏览该文件的文档.
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 {
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
31extern VRPN_API int
32vrpn_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
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);
72extern VRPN_API int vrpn_read_available_characters(int comm,
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
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.
VRPN_API int vrpn_flush_output_buffer(int comm)
Throw out any characters (do not send) within the 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.