亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? serial.h

?? common c++提供socket
?? H
?? 第 1 頁 / 共 2 頁
字號:
// Copyright (C) 1999-2005 Open Source Telecom Corporation.//// This program is free software; you can redistribute it and/or modify// it under the terms of the GNU General Public License as published by// the Free Software Foundation; either version 2 of the License, or// (at your option) any later version.// // This program is distributed in the hope that it will be useful,// but WITHOUT ANY WARRANTY; without even the implied warranty of// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// GNU General Public License for more details.// // You should have received a copy of the GNU General Public License// along with this program; if not, write to the Free Software// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.// // As a special exception, you may use this file as part of a free software// library without restriction.  Specifically, if other files instantiate// templates or use macros or inline functions from this file, or you compile// this file and link it with other files to produce an executable, this// file does not by itself cause the resulting executable to be covered by// the GNU General Public License.  This exception does not however    // invalidate any other reasons why the executable file might be covered by// the GNU General Public License.    //// This exception applies only to the code released under the name GNU// Common C++.  If you copy code from other releases into a copy of GNU// Common C++, as the General Public License permits, the exception does// not apply to the code that you add in this way.  To avoid misleading// anyone as to the status of such modified files, you must delete// this exception notice from them.//// If you write modifications of your own for GNU Common C++, it is your choice// whether to permit this exception to apply to your modifications.// If you do not wish that, delete this exception notice.///** * @file serial.h * @short Serial I/O services. **/#ifndef	CCXX_SERIAL_H_#define	CCXX_SERIAL_H_#ifndef CCXX_MISSING_H_#include <cc++/missing.h>#endif#ifndef	CCXX_THREAD_H_#include <cc++/thread.h>#endif#ifndef	CCXX_EXCEPTION_H_#include <cc++/exception.h>#endif#ifndef	WIN32typedef	int HANDLE;#define		INVALID_HANDLE_VALUE	(-1)#endif#ifdef	CCXX_NAMESPACESnamespace ost {#endif/** * The Serial class is used as the base for all serial I/O services * under APE.  A serial is a system serial port that is used either * for line or packet based data input.  Serial ports may also be * "streamable" in a derived form. *  *  Common C++ serial I/O classes are used to manage serial devices and *  implement serial device protocols.  From the point of view of Common C++, *  serial devices are supported by the underlying Posix specified "termios" *  call interface. *  *  The serial I/O base class is used to hold a descriptor to a serial device *  and to provide an exception handling interface for all serial I/O classes. *  The base class is also used to specify serial I/O properties such as *  communication speed, flow control, data size, and parity.  The "Serial" *  base class is not itself directly used in application development, *  however. *  *  Common C++ Serial I/O is itself divided into two conceptual modes; frame *  oriented and line oriented I/O.  Both frame and line oriented I/O makes *  use of the ability of the underlying tty driver to buffer data and return *  "ready" status from when select either a specified number of bytes or *  newline record has been reached by manipulating termios c_cc fields *  appropriately.  This provides some advantage in that a given thread *  servicing a serial port can block and wait rather than have to continually *  poll or read each and every byte as soon as it appears at the serial port. * * @author David Sugar <dyfet@ostel.com> * @short base class for all serial I/O services. */class __EXPORT Serial{public:	enum Error	{		errSuccess = 0,		errOpenNoTty,		errOpenFailed,		errSpeedInvalid,		errFlowInvalid,		errParityInvalid,		errCharsizeInvalid,		errStopbitsInvalid,		errOptionInvalid,		errResourceFailure,		errOutput,		errInput,		errTimeout,		errExtended	};	typedef enum Error Error;	enum Flow	{		flowNone,		flowSoft,		flowHard,		flowBoth	};	typedef enum Flow Flow;	enum Parity	{		parityNone,		parityOdd,		parityEven	};	typedef enum Parity Parity;	enum Pending	{		pendingInput,		pendingOutput,		pendingError	};	typedef enum Pending Pending;private:	Error errid;	char *errstr;	struct	{		bool thrown: 1;		bool linebuf: 1;	} flags;	void	*	original;	void	*	current;	/**	 * Used to properly initialize serial object.	 */	void initSerial(void);protected:	HANDLE	dev;	int bufsize;	/**	 * Opens the serial device.	 *	 * @param fname Pathname of device to open	 */	void		open(const char *fname);	/**	 * Closes the serial device.	 *	 */	void		close(void);	/**	 * Reads from serial device.	 *	 * @param Data  Point to character buffer to receive data.  Buffers MUST	 *				be at least Length + 1 bytes in size.	 * @param Length Number of bytes to read.	 */	virtual int	aRead(char * Data, const int Length);	/**	 * Writes to serial device.	 *	 * @param Data  Point to character buffer containing data to write.  Buffers MUST	 * @param Length Number of bytes to write.	 */	virtual int	aWrite(const char * Data, const int Length);	/**	 * This service is used to throw all serial errors which usually	 * occur during the serial constructor.	 *	 * @param error defined serial error id.	 * @param errstr string or message to optionally pass.	 */	Error error(Error error, char *errstr = NULL);	/**	 * This service is used to thow application defined serial	 * errors where the application specific error code is a string.	 *	 * @param err string or message to pass.	 */	inline void error(char *err)		{error(errExtended, err);};	/**	 * This method is used to turn the error handler on or off for	 * "throwing" execptions by manipulating the thrown flag.	 *	 * @param enable true to enable handler.	 */	inline void setError(bool enable)		{flags.thrown = !enable;};	/**	 * Set packet read mode and "size" of packet read buffer.	 * This sets VMIN to x.  VTIM is normally set to "0" so that	 * "isPending()" can wait for an entire packet rather than just	 * the first byte.	 *	 * @return actual buffer size set.	 * @param size of packet read request.	 * @param btimer optional inter-byte data packet timeout.	 */	int setPacketInput(int size, unsigned char btimer = 0);	/**	 * Set "line buffering" read mode and specifies the newline	 * character to be used in seperating line records.  isPending	 * can then be used to wait for an entire line of input.	 *	 * @param newline newline character.	 * @param nl1 EOL2 control character. 	 * @return size of conical input buffer.	 */	int setLineInput(char newline = 13, char nl1 = 0);	/**	 * Restore serial device to the original settings at time of open.	 */	void restore(void);	/**	 * Used to flush the input waiting queue.	 */	void flushInput(void);	/**	 * Used to flush any pending output data.	 */	void flushOutput(void);	/**	 * Used to wait until all output has been sent.	 */	void waitOutput(void);	/**	 * Used as the default destructor for ending serial I/O	 * services.  It will restore the port to it's original state.	 */	void endSerial(void);	/**	 * Used to initialize a newly opened serial file handle.  You	 * should set serial properties and DTR manually before first	 * use.	 */	void initConfig(void);	/**	 * This allows later ttystream class to open and close a serial	 * device.	 */	Serial()		{initSerial();};	/**	 * A serial object may be constructed from a named file on the	 * file system.  This named device must be "isatty()".	 *	 * @param name of file.	 */	Serial(const char *name);public:	/**	 * The serial base class may be "thrown" as a result on an error,	 * and the "catcher" may then choose to destory the object.  By	 * assuring the socket base class is a virtual destructor, we	 * can assure the full object is properly terminated.	 */	virtual ~Serial();	/**	 * Serial ports may also be duplecated by the assignment	 * operator.	 */	Serial &operator=(const Serial &from);	/**	 * Set serial port speed for both input and output.	 * 	 * @return 0 on success.	 * @param speed to select. 0 signifies modem "hang up".	 */	Error setSpeed(unsigned long speed);	/**	 * Set character size.	 *	 * @return 0 on success.	 * @param bits character size to use (usually 7 or 8).	 */	Error setCharBits(int bits);	/**	 * Set parity mode.	 *	 * @return 0 on success.	 * @param parity mode.	 */	Error setParity(Parity parity);	/**	 * Set number of stop bits.	 *	 * @return 0 on success.	 * @param bits stop bits.	 */	Error setStopBits(int bits);	/**	 * Set flow control.	 *	 * @return 0 on success.	 * @param flow control mode.	 */	Error setFlowControl(Flow flow);	/**	 * Set the DTR mode off momentarily.	 *	 * @param millisec number of milliseconds.	 */	void toggleDTR(timeout_t millisec);	/**	 * Send the "break" signal.	 */	void sendBreak(void);	/**	 * Often used by a "catch" to fetch the last error of a thrown	 * serial.	 *	 * @return error numbr of last Error.	 */	inline Error getErrorNumber(void)		{return errid;};	/**	 * Often used by a "catch" to fetch the user set error string	 * of a thrown serial.	 *	 * @return string for error message.	 */	inline char *getErrorString(void)		{return errstr;};	/**	 * Get the "buffer" size for buffered operations.  This can	 * be used when setting packet or line read modes to determine	 * how many bytes to wait for in a given read call.	 *	 * @return number of bytes used for buffering.	 */	inline int getBufferSize(void)		{return bufsize;};	/**	 * Get the status of pending operations.  This can be used to	 * examine if input or output is waiting, or if an error has	 * occured on the serial device.	 *	 * @return true if ready, false if timeout.	 * @param pend ready check to perform.	 * @param timeout in milliseconds.	 */	virtual bool isPending(Pending pend, timeout_t timeout = TIMEOUT_INF);};/** * TTY streams are used to represent serial connections that are fully * "streamable" objects using C++ stream classes and friends. *  * The first application relevant serial I/O class is the TTYStream class. * TTYStream offers a linearly buffered "streaming" I/O session with the * serial device.  Furthermore, traditional C++ "stream" operators (<< and * >>) may be used with the serial device.  A more "true" to ANSI C++ library * format "ttystream" is also available, and this supports an "open" method * in which one can pass initial serial device parameters immediately * following the device name in a single string, as in * "/dev/tty3a:9600,7,e,1", as an example. *  * The TTYSession aggragates a TTYStream and a Common C++ Thread which is * assumed to be the execution context that will be used to perform actual * I/O operations.  This class is very anagolous to TCPSession. *  * * @author David Sugar <dyfet@ostel.com> * @short streamable tty serial I/O class. */class __EXPORT TTYStream : protected std::streambuf, public Serial, public std::iostream{private:	int doallocate();	friend TTYStream& crlf(TTYStream&);	friend TTYStream& lfcr(TTYStream&);protected:	char *gbuf, *pbuf;	timeout_t timeout;	/**	 * This constructor is used to derive "ttystream", a more	 * C++ style version of the TTYStream class.	 */	TTYStream();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91 com成人网| 国产一区二区三区最好精华液| 亚洲成人激情社区| 日本三级韩国三级欧美三级| 国内精品嫩模私拍在线| 成人高清伦理免费影院在线观看| 91视频观看免费| 91.com在线观看| 国产精品丝袜黑色高跟| 亚洲大片在线观看| 国产成a人亚洲| 欧美午夜寂寞影院| 精品福利在线导航| 亚洲精品视频观看| 国内精品嫩模私拍在线| 在线免费观看视频一区| 欧美大黄免费观看| 亚洲免费av高清| 另类欧美日韩国产在线| 99久久综合国产精品| 欧美一区二区三区在线观看| 国产精品久久久久一区二区三区 | 91麻豆123| 日韩欧美综合一区| 中文字幕日韩一区二区| 美女视频黄频大全不卡视频在线播放| 成人精品一区二区三区四区| 欧美浪妇xxxx高跟鞋交| 国产欧美日韩精品在线| 婷婷一区二区三区| 99久久久久久| 精品久久久久久久人人人人传媒 | av不卡免费在线观看| 日韩天堂在线观看| 一区二区视频在线看| 国产一区二区三区久久悠悠色av| 欧美午夜免费电影| 国产精品青草综合久久久久99| 日韩—二三区免费观看av| 色天天综合久久久久综合片| 久久久亚洲国产美女国产盗摄| 亚洲国产成人va在线观看天堂| 国产suv精品一区二区883| 日韩无一区二区| 亚洲成人高清在线| 色综合咪咪久久| 国产精品天美传媒沈樵| 麻豆国产欧美一区二区三区| 欧美日韩综合在线| 亚洲视频在线观看三级| 国产福利精品一区| 精品国产免费久久| 日韩在线一区二区| 欧美伊人久久久久久久久影院| 亚洲欧洲性图库| 国产成人精品免费一区二区| 久久综合色8888| 蜜桃视频免费观看一区| 欧美日韩国产影片| 亚洲国产综合人成综合网站| 99久久精品国产导航| 中文字幕第一区综合| 国产aⅴ综合色| 日本一区二区三区电影| 国产一区二区美女| 久久色在线视频| 精品一区二区在线免费观看| 欧美一区二区成人| 青青草原综合久久大伊人精品优势 | 欧美一区二区三区啪啪| 爽好久久久欧美精品| 欧美日韩夫妻久久| 亚洲一区二区在线免费看| 一本到一区二区三区| 亚洲免费伊人电影| 一本大道久久a久久综合婷婷| 国产精品成人免费精品自在线观看 | 欧美精选一区二区| 日韩国产在线一| 日韩色视频在线观看| 日韩经典中文字幕一区| 91麻豆精品国产综合久久久久久| 天天操天天干天天综合网| 欧美剧情片在线观看| 石原莉奈一区二区三区在线观看| 91精品免费观看| 久久精品噜噜噜成人88aⅴ| 精品国产一区二区在线观看| 国产一区二区在线免费观看| 久久精品在线免费观看| 成人aa视频在线观看| 亚洲伦在线观看| 欧美在线免费观看视频| 免费观看日韩电影| 久久久精品免费网站| 成人av影院在线| 一区二区三区在线视频播放| 欧美群妇大交群的观看方式| 蜜臀久久99精品久久久画质超高清 | 亚洲一区二区3| 欧美丰满高潮xxxx喷水动漫 | 久久久综合九色合综国产精品| 成人晚上爱看视频| 亚洲男女一区二区三区| 欧美精品一级二级| 久久精品国产亚洲aⅴ| 中文字幕欧美国产| 日本道色综合久久| 日本中文字幕一区二区有限公司| 2021中文字幕一区亚洲| 99久久免费精品高清特色大片| 亚洲午夜激情网页| 久久伊人蜜桃av一区二区| 97se亚洲国产综合自在线不卡| 亚洲成年人影院| 久久精品在这里| 欧美日韩一区二区三区四区| 国产又粗又猛又爽又黄91精品| 国产精品久久久久久久裸模| 欧美亚洲综合网| 国产精品一二三在| 亚洲国产一区视频| 久久夜色精品一区| 欧美性生活一区| 国产乱国产乱300精品| 一区二区不卡在线播放| 欧美成人video| 色婷婷一区二区三区四区| 美女视频黄 久久| 一区二区三区中文字幕| 精品成人免费观看| 在线观看亚洲一区| 国产伦精品一区二区三区免费迷 | 色猫猫国产区一区二在线视频| 蜜桃久久精品一区二区| 日韩美女视频一区| 日韩精品一区二区三区老鸭窝| 99久久国产综合精品麻豆| 久久精品国产999大香线蕉| 亚洲欧洲日韩一区二区三区| 日韩一区二区三区在线观看| 99riav久久精品riav| 国产综合久久久久影院| 亚洲成av人片www| 国产精品天美传媒沈樵| 精品久久久久久久久久久院品网| 欧美三级中文字幕在线观看| 成人免费av网站| 国产在线精品一区二区不卡了| 午夜电影一区二区| 亚洲欧美区自拍先锋| 国产区在线观看成人精品| 日韩视频免费直播| 欧美日韩一区小说| 97精品视频在线观看自产线路二| 国产九九视频一区二区三区| 三级不卡在线观看| 洋洋av久久久久久久一区| 中文字幕一区二| 欧美国产丝袜视频| 久久精品一区二区| 日韩免费观看高清完整版| 欧美撒尿777hd撒尿| 在线欧美小视频| 99vv1com这只有精品| a级高清视频欧美日韩| 国产宾馆实践打屁股91| 六月丁香婷婷久久| 欧美极品美女视频| 欧美日本一区二区| 欧美日韩精品免费观看视频| av亚洲精华国产精华精| 成人黄色免费短视频| 久99久精品视频免费观看| 性做久久久久久免费观看欧美| 欧美国产视频在线| 国产精品毛片高清在线完整版| 欧美videos大乳护士334| 日韩欧美在线一区二区三区| 欧美日韩午夜影院| 色香色香欲天天天影视综合网| 国产一区日韩二区欧美三区| 国产精品综合二区| 久久精品国产亚洲5555| 日韩高清欧美激情| 日本女优在线视频一区二区| 亚洲123区在线观看| 亚洲一区在线看| 中文无字幕一区二区三区| 久久久久久久久97黄色工厂| 欧美成人精品1314www| 欧美日韩三级在线| 欧美性一二三区| 欧美四级电影网| 欧美在线观看视频一区二区| 欧美日韩不卡视频| 欧美精品丝袜久久久中文字幕| 欧美视频在线播放| 欧美一区二区不卡视频| 日韩亚洲国产中文字幕欧美|