RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Serial.h 文件参考

vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating systems easier. 更多...

#include "vrpn_Configure.h"
#include <stddef.h>
+ vrpn_Serial.h 的引用(Include)关系图:
+ 此图展示该文件被哪些文件直接或间接地引用了:

浏览该文件的源代码.

枚举

enum  vrpn_SER_PARITY {
  vrpn_SER_PARITY_NONE , vrpn_SER_PARITY_ODD , vrpn_SER_PARITY_EVEN , vrpn_SER_PARITY_MARK ,
  vrpn_SER_PARITY_SPACE
}
 

函数

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_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_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.
 
VRPN_API int vrpn_write_characters (int comm, const unsigned char *buffer, size_t bytes)
 
VRPN_API int vrpn_write_slowly (int comm, const unsigned char *buffer, size_t bytes, int millisec_delay)
 
RTS Hardware Flow Control

Set and clear functions for the RTS ("ready to send") hardware flow- control bit. These are used on a port that is already open. Some devices (like the Ascension Flock of Birds) use this to reset the device. Return 0 on success, nonzero on error.

VRPN_API int vrpn_set_rts (int comm)
 
VRPN_API int vrpn_clear_rts (int comm)
 
Read routines

Read up the the requested count of characters from the input buffer, return with less if less (or none) are there. Return the number of characters read, or -1 if there is an error. The second of these will keep looking until the timeout period expires before returning (NULL pointer will cause it to block indefinitely).

VRPN_API int vrpn_read_available_characters (int comm, unsigned char *buffer, size_t count)
 
VRPN_API int vrpn_read_available_characters (int comm, unsigned char *buffer, size_t count, struct timeval *timeout)
 

详细描述

vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating systems easier.

作者
Russ Taylor, 1998

函数说明

◆ vrpn_drain_output_buffer()

VRPN_API int vrpn_drain_output_buffer ( int comm)
extern

Wait until all of the characters in the output buffer are sent, then return.

返回
0 on success, -1 on error.

◆ vrpn_flush_input_buffer()

VRPN_API int vrpn_flush_input_buffer ( int comm)
extern

Throw out any characters within the input buffer.

返回
0 on success, -1 on error.

◆ vrpn_flush_output_buffer()

VRPN_API int vrpn_flush_output_buffer ( int comm)
extern

Throw out any characters (do not send) within the output buffer

返回
0 on success, tc err codes (whatever those are) on error.

◆ 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 )
extern

Open a serial port, given its name and baud rate.

Default Settings are 8 bits, no parity, 1 start and stop bits with no RTS (hardware) flow control. Also, set the port so that it will return immediately if there are no characters or less than the number of characters requested.

返回
the file descriptor on success,-1 on failure.