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

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

?? portsettings.cs

?? C#串口通訊開發實例一個基于C#開發的串口通訊實例
?? CS
字號:
//==========================================================================================
//
//		namespace OpenNETCF.IO.Serial.PortSettings
//		Copyright (c) 2003, OpenNETCF.org
//
//		This library is free software; you can redistribute it and/or modify it under 
//		the terms of the OpenNETCF.org Shared Source License.
//
//		This library 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 OpenNETCF.org Shared Source License 
//		for more details.
//
//		You should have received a copy of the OpenNETCF.org Shared Source License 
//		along with this library; if not, email licensing@opennetcf.org to request a copy.
//
//		If you wish to contact the OpenNETCF Advisory Board to discuss licensing, please 
//		email licensing@opennetcf.org.
//
//		For general enquiries, email enquiries@opennetcf.org or visit our website at:
//		http://www.opennetcf.org
//
//==========================================================================================

using System;
using System.Runtime.InteropServices;

namespace OpenNETCF.IO.Serial
{
	#region namespace enumerations
	/// <summary>
	/// Common ASCII Control Codes
	/// </summary>
	public enum ASCII : byte
	{
		/// <summary>
		/// NULL
		/// </summary>
		NULL = 0x00,
		/// <summary>
		/// Start of Heading
		/// </summary>
		SOH  = 0x01,  
		/// <summary>
		/// Start of Text
		/// </summary>
		STX = 0x02,  
		/// <summary>
		/// End of Text
		/// </summary>
		ETX = 0x03,
		/// <summary>
		/// End of Transmission
		/// </summary>
		EOT = 0x04,  
		/// <summary>
		/// Enquiry
		/// </summary>
		ENQ = 0x05,
		/// <summary>
		/// Acknowledge
		/// </summary>
		ACK	= 0x06,
		/// <summary>
		/// Bell
		/// </summary>
		BELL = 0x07,
		/// <summary>
		/// Backspace
		/// </summary>
		BS  = 0x08,
		/// <summary>
		/// Horizontal tab
		/// </summary>
		HT  = 0x09,
		/// <summary>
		/// Line Feed
		/// </summary>
		LF  = 0x0A,
		/// <summary>
		/// Vertical tab
		/// </summary>
		VT  = 0x0B,
		/// <summary>
		/// Form Feed
		/// </summary>
		FF  = 0x0C,
		/// <summary>
		/// Carriage Return
		/// </summary>
		CR  = 0x0D,
		/// <summary>
		/// Shift out
		/// </summary>
		SO  = 0x0E,
		/// <summary>
		/// Shift in
		/// </summary>
		SI  = 0x0F,
		/// <summary>
		/// Device Control 1
		/// </summary>
		DC1 = 0x11,
		/// <summary>
		/// Device Control 2
		/// </summary>
		DC2 = 0x12,
		/// <summary>
		/// Device Control 3
		/// </summary>
		DC3 = 0x13,
		/// <summary>
		/// Device Control 4
		/// </summary>
		DC4 = 0x14,
		/// <summary>
		/// No Acknowledge
		/// </summary>
		NAK = 0x15,
		/// <summary>
		/// Synchronization
		/// </summary>
		SYN = 0x16,
		/// <summary>
		/// End of Transmission Block
		/// </summary>
		ETB = 0x17,
		/// <summary>
		/// Cancel
		/// </summary>
		CAN = 0x18,
		/// <summary>
		/// End of Medium
		/// </summary>
		EM  = 0x19,
		/// <summary>
		/// Substitute Character
		/// </summary>
		SUB = 0x1A,
		/// <summary>
		/// Escape
		/// </summary>
		ESC = 0x1B,
		/// <summary>
		/// Field Separator
		/// </summary>
		FS  = 0x1C,
		/// <summary>
		/// Group Separator
		/// </summary>
		GS  = 0x1D,
		/// <summary>
		/// Record Separator
		/// </summary>
		RS  = 0x1E,
		/// <summary>
		/// Unit Separator
		/// </summary>
		US  = 0x1F,
		/// <summary>
		/// Spare
		/// </summary>
		SP  = 0x20,
		/// <summary>
		/// Delete
		/// </summary>
		DEL = 0x7F
	}

	/// <summary>
	/// Common serial handshaking protocols
	/// </summary>
	public enum Handshake
	{
		/// <summary>
		/// No handshaking
		/// </summary>
		none,
		/// <summary>
		/// XOn/XOff handshaking
		/// </summary>
		XonXoff,
		/// <summary>
		/// CTS/RTS
		/// </summary>
		CtsRts,
		/// <summary>
		/// DSR/DTR
		/// </summary>
		DsrDtr
	}

	/// <summary>
	/// Parity
	/// </summary>
	public enum Parity 
	{
		/// <summary>
		/// No parity
		/// </summary>
		none	= 0,
		/// <summary>
		/// Odd parity
		/// </summary>
		odd		= 1,
		/// <summary>
		/// Even parity
		/// </summary>
		even	= 2,
		/// <summary>
		/// Mark parity
		/// </summary>
		mark	= 3,
		/// <summary>
		/// Space parity
		/// </summary>
		space	= 4
	};

	/// <summary>
	/// Stop bits
	/// </summary>
	public enum StopBits
	{
		/// <summary>
		/// One stop bit
		/// </summary>
		one				= 0,
		/// <summary>
		/// 1.5 stop bits
		/// </summary>
		onePointFive	= 1,
		/// <summary>
		/// Two stop bits
		/// </summary>
		two				= 2
	};

	/// <summary>
	/// DTR Flow Control
	/// </summary>
	public enum DTRControlFlows
	{
		/// <summary>
		/// Disabled
		/// </summary>
		disable		= 0x00,
		/// <summary>
		/// Enabled
		/// </summary>
		enable		= 0x01,
		/// <summary>
		/// Determined by handshaking
		/// </summary>
		handshake	= 0x02
	}

	/// <summary>
	/// RTS Flow Control
	/// </summary>
	public enum RTSControlFlows
	{
		/// <summary>
		/// Disabled
		/// </summary>
		disable		= 0x00,
		/// <summary>
		/// Enabled
		/// </summary>
		enable		= 0x01,
		/// <summary>
		/// Determined by handshaking
		/// </summary>
		handshake	= 0x02,
		/// <summary>
		/// Toggle
		/// </summary>
		toggle		= 0x03
	}

	/// <summary>
	/// CE-supported baud rates (check your hardware for actual availability)
	/// </summary>
	public enum BaudRates : int
	{
		/// <summary>
		/// 110bpb
		/// </summary>
		CBR_110    = 110,
		/// <summary>
		/// 300bps
		/// </summary>
		CBR_300    = 300,
		/// <summary>
		/// 600bps
		/// </summary>
		CBR_600    = 600,
		/// <summary>
		/// 1200bps
		/// </summary>
		CBR_1200   = 1200,
		/// <summary>
		/// 2400bps
		/// </summary>
		CBR_2400   = 2400,
		/// <summary>
		/// 4800bps
		/// </summary>
		CBR_4800   = 4800,
		/// <summary>
		/// 9600bps
		/// </summary>
		CBR_9600   = 9600,
		/// <summary>
		/// 14.4kbps
		/// </summary>
		CBR_14400  = 14400,
		/// <summary>
		/// 19.2kbps
		/// </summary>
		CBR_19200  = 19200,
		/// <summary>
		/// 38.4kbps
		/// </summary>
		CBR_38400  = 38400,
		/// <summary>
		/// 56kbps
		/// </summary>
		CBR_56000  = 56000,
		/// <summary>
		/// 57.6kbps
		/// </summary>
		CBR_57600  = 57600,
		/// <summary>
		/// 115kbps
		/// </summary>
		CBR_115200 = 115200,
		/// <summary>
		/// 128kbps
		/// </summary>
		CBR_128000 = 128000,
		/// <summary>
		/// 225kbps
		/// </summary>
		CBR_230400 = 230400,
		/// <summary>
		/// 256kbps
		/// </summary>
		CBR_256000 = 256000,
		/// <summary>
		/// 450kbps
		/// </summary>
		CBR_460800= 460800,
		/// <summary>
		/// 900kbps
		/// </summary>
		CBR_921600 = 921600,
	}
	#endregion

	/// <summary>
	/// Used for manipulating several basic Port settings of a Port class
	/// </summary>
	[StructLayout(LayoutKind.Sequential)]
	public class BasicPortSettings
	{
		/// <summary>
		/// Baud rate (default = 19200bps)
		/// </summary>
		public BaudRates	BaudRate	= BaudRates.CBR_19200;
		/// <summary>
		/// Byte Size of data (default = 8)
		/// </summary>
		public byte			ByteSize	= 8;
		/// <summary>
		/// Data Parity (default = none)
		/// </summary>
		public Parity		Parity		= Parity.none;
		/// <summary>
		/// Number of stop bits (default = 1)
		/// </summary>
		public StopBits		StopBits	= StopBits.one;
	}

	/// <summary>
	/// Used for manipulating all settings of a Port class
	/// </summary>
	[StructLayout(LayoutKind.Sequential)]
	public class DetailedPortSettings
	{
		/// <summary>
		/// Create a DetailedPortSettings class
		/// </summary>
		public DetailedPortSettings()
		{
			BasicSettings = new BasicPortSettings();
			Init();
		}

		/// <summary>
		/// These are the default port settings
		/// override Init() to create new defaults (i.e. common handshaking)
		/// </summary>
		protected virtual void Init()
		{
			BasicSettings.BaudRate	= BaudRates.CBR_19200;
			BasicSettings.ByteSize	= 8;
			BasicSettings.Parity	= Parity.none;
			BasicSettings.StopBits	= StopBits.one;

			OutCTS				= false;
			OutDSR				= false;
			DTRControl			= DTRControlFlows.disable;
			DSRSensitive		= false;
			TxContinueOnXOff	= true;
			OutX				= false;
			InX					= false;
			ReplaceErrorChar	= false;
			RTSControl			= RTSControlFlows.disable;
			DiscardNulls		= false;
			AbortOnError		= false;
			XonChar				= (char)ASCII.DC1;
			XoffChar			= (char)ASCII.DC3;		
			ErrorChar			= (char)ASCII.NAK;
			EOFChar				= (char)ASCII.EOT;
			EVTChar				= (char)ASCII.NULL;	
		}

		/// <summary>
		/// Basic port settings
		/// </summary>
		public BasicPortSettings	BasicSettings;
		/// <summary>
		/// Specifies if the CTS (clear-to-send) signal is monitored for output flow control. If this member is TRUE and CTS is turned off, output is suspended until CTS is sent again.
		/// </summary>
		public bool					OutCTS				= false;
		/// <summary>
		/// Specifies if the DSR (data-set-ready) signal is monitored for output flow control. If this member is TRUE and DSR is turned off, output is suspended until DSR is sent again. 
		/// </summary>
		public bool					OutDSR				= false;
		/// <summary>
		/// Specifies the DTR (data-terminal-ready) flow control.
		/// </summary>
		public DTRControlFlows		DTRControl			= DTRControlFlows.disable;
		/// <summary>
		/// Specifies if the communications driver is sensitive to the state of the DSR signal. If this member is TRUE, the driver ignores any bytes received, unless the DSR modem input line is high.
		/// </summary>
		public bool					DSRSensitive		= false;
		/// <summary>
		/// Specifies if transmission stops when the input buffer is full and the driver has transmitted the XoffChar character. If this member is TRUE, transmission continues after the input buffer has come within XoffLim bytes of being full and the driver has transmitted the XoffChar character to stop receiving bytes. If this member is FALSE, transmission does not continue until the input buffer is within XonLim bytes of being empty and the driver has transmitted the XonChar character to resume reception.
		/// </summary>
		public bool					TxContinueOnXOff	= true;
		/// <summary>
		/// Specifies if XON/XOFF flow control is used during transmission. If this member is TRUE, transmission stops when the XoffChar character is received and starts again when the XonChar character is received.
		/// </summary>
		public bool					OutX				= false;
		/// <summary>
		/// Specifies if XON/XOFF flow control is used during reception. If this member is TRUE, the XoffChar character is sent when the input buffer comes within XoffLim bytes of being full, and the XonChar character is sent when the input buffer comes within XonLim bytes of being empty
		/// </summary>
		public bool					InX					= false;
		/// <summary>
		/// Specifies if bytes received with parity errors are replaced with the character specified by the ErrorChar member. If this member is TRUE and the fParity member is TRUE, replacement occurs.
		/// </summary>
		public bool					ReplaceErrorChar	= false;
		/// <summary>
		/// Specifies the RTS (request-to-send) flow control. If this value is zero, the default is RTS_CONTROL_HANDSHAKE. The following table shows possible values for this member.
		/// </summary>
		public RTSControlFlows		RTSControl			= RTSControlFlows.disable;
		/// <summary>
		/// Specifies if null bytes are discarded. If this member is TRUE, null bytes are discarded when received. 
		/// </summary>
		public bool					DiscardNulls		= false;
		/// <summary>
		/// Specifies if read and write operations are terminated if an error occurs. If this member is TRUE, the driver terminates all read and write operations with an error status if an error occurs. The driver will not accept any further communications operations until the application has acknowledged the error by calling the ClearError function.
		/// </summary>
		public bool					AbortOnError		= false;
		/// <summary>
		/// Specifies the value of the XON character for both transmission and reception
		/// </summary>
		public char					XonChar				= (char)ASCII.DC1;
		/// <summary>
		/// Specifies the value of the XOFF character for both transmission and reception.
		/// </summary>
		public char					XoffChar			= (char)ASCII.DC3;
		/// <summary>
		/// Specifies the value of the character used to replace bytes received with a parity error.
		/// </summary>
		public char					ErrorChar			= (char)ASCII.NAK;
		/// <summary>
		/// Specifies the value of the character used to signal the end of data. 
		/// </summary>
		public char					EOFChar				= (char)ASCII.EOT;
		/// <summary>
		/// Specifies the value of the character used to signal an event.
		/// </summary>
		public char					EVTChar				= (char)ASCII.NULL;	
	}

	/// <summary>
	/// A common implementation of DetailedPortSettings for non handshaking
	/// </summary>
	public class HandshakeNone : DetailedPortSettings
	{
		/// <summary>
		/// Initialize the port
		/// </summary>
		protected override void Init()
		{
			base.Init ();

			OutCTS = false;
			OutDSR = false;
			OutX = false;
			InX	= false;
			RTSControl = RTSControlFlows.enable;
			DTRControl = DTRControlFlows.enable;
			TxContinueOnXOff = true;
			DSRSensitive = false;			
		}
	}

	/// <summary>
	/// A common implementation of DetailedPortSettings for XON/XOFF handshaking
	/// </summary>
	public class HandshakeXonXoff : DetailedPortSettings
	{
		/// <summary>
		/// Initialize the port
		/// </summary>
		protected override void Init()
		{
			base.Init ();
			
			OutCTS = false;
			OutDSR = false;
			OutX = true;
			InX	= true;
			RTSControl = RTSControlFlows.enable;
			DTRControl = DTRControlFlows.enable;
			TxContinueOnXOff = true;
			DSRSensitive = false;			
			XonChar = (char)ASCII.DC1; 
			XoffChar = (char)ASCII.DC3;
		}
	}

	/// <summary>
	/// A common implementation of DetailedPortSettings for CTS/RTS handshaking
	/// </summary>
	public class HandshakeCtsRts : DetailedPortSettings
	{
		/// <summary>
		/// Initialize the port
		/// </summary>
		protected override void Init()
		{
			base.Init ();

			OutCTS = true;
			OutDSR = false;
			OutX = false;
			InX	= false;
			RTSControl = RTSControlFlows.handshake;
			DTRControl = DTRControlFlows.enable;
			TxContinueOnXOff = true;
			DSRSensitive = false;			
		}
	}

	/// <summary>
	/// A common implementation of DetailedPortSettings for DSR/DTR handshaking
	/// </summary>
	public class HandshakeDsrDtr : DetailedPortSettings
	{
		/// <summary>
		/// Initialize the port
		/// </summary>
		protected override void Init()
		{
			base.Init ();
			
			OutCTS = false;
			OutDSR = true;
			OutX = false;
			InX	= false;
			RTSControl = RTSControlFlows.enable;
			DTRControl = DTRControlFlows.handshake;
			TxContinueOnXOff = true;
			DSRSensitive = false;			
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美日韩电影| 欧美另类z0zxhd电影| 99riav久久精品riav| www.成人网.com| 欧美三区免费完整视频在线观看| 制服丝袜中文字幕一区| 日韩精品中文字幕一区二区三区| 国产亚洲欧美激情| 伊人一区二区三区| 国产一区二区调教| 欧美日韩一区高清| 国产亚洲精品aa午夜观看| 亚洲精品乱码久久久久久久久| 日日摸夜夜添夜夜添国产精品| 成人免费视频一区| 日韩午夜电影av| 亚洲日本一区二区| 国产精品一区在线观看你懂的| 日本韩国精品在线| 日韩视频中午一区| 国产欧美视频一区二区| 亚洲成人综合视频| 不卡av免费在线观看| 麻豆精品久久精品色综合| 97精品久久久午夜一区二区三区 | 国产精品色在线观看| 亚洲第一福利视频在线| 成人免费精品视频| 日韩欧美亚洲一区二区| 亚洲猫色日本管| 成人在线视频一区| 337p粉嫩大胆噜噜噜噜噜91av| 亚洲在线中文字幕| 99视频超级精品| 国产欧美一区二区三区网站 | 国产乱码精品一区二区三| 欧美性猛交xxxx黑人交| 亚洲欧美在线另类| 日本不卡一二三区黄网| 在线看不卡av| 亚洲一区二区三区视频在线| 91在线高清观看| 国产精品久久毛片| a级高清视频欧美日韩| 国产亚洲欧美日韩在线一区| 国产精品主播直播| 久久久久久久网| 九九精品一区二区| 日韩欧美一区二区久久婷婷| 日韩高清中文字幕一区| 在线不卡的av| 丝袜亚洲精品中文字幕一区| 在线不卡a资源高清| 日韩国产欧美在线播放| 成人深夜在线观看| 国产精品成人免费精品自在线观看| 国产成人精品免费一区二区| 国产亚洲成年网址在线观看| 激情小说亚洲一区| 国产午夜精品一区二区三区视频| 国产一区二区三区精品欧美日韩一区二区三区 | 国产一区二区福利| 国产蜜臀av在线一区二区三区| 久久99精品久久久久| 国产亚洲短视频| 91猫先生在线| 蜜桃av噜噜一区二区三区小说| 久久一夜天堂av一区二区三区| 91视频在线观看| 免费观看一级欧美片| 自拍偷拍国产精品| 欧美v亚洲v综合ⅴ国产v| www.欧美精品一二区| 日本女人一区二区三区| 1区2区3区精品视频| 欧美本精品男人aⅴ天堂| 99精品视频免费在线观看| 免费观看一级特黄欧美大片| 亚洲视频免费看| 欧美精品一区二区三区一线天视频| 色婷婷香蕉在线一区二区| 国产一区二区三区不卡在线观看| 亚洲综合在线视频| 日本一二三四高清不卡| 日韩免费高清av| 欧美午夜理伦三级在线观看| 成人av综合在线| 黑人精品欧美一区二区蜜桃| 亚洲成av人片在www色猫咪| 日本一区二区视频在线| 欧美成人一区二区三区片免费 | 一区二区三区自拍| 亚洲国产成人私人影院tom| 日韩一区二区三区在线观看| 在线观看视频一区二区欧美日韩| 国产aⅴ综合色| 精品综合久久久久久8888| 视频一区二区欧美| 亚洲最新视频在线播放| 中文字幕在线观看一区| 久久久久国色av免费看影院| 欧美一区二区日韩一区二区| 欧美日韩精品一区二区在线播放| 99精品欧美一区二区三区小说| 国产不卡高清在线观看视频| 国产综合色视频| 精品亚洲成a人| 国精品**一区二区三区在线蜜桃| 蜜臀精品一区二区三区在线观看| 亚洲成人777| 亚洲成人福利片| 亚洲成a人v欧美综合天堂下载| 综合在线观看色| 最近日韩中文字幕| 亚洲视频免费在线| 亚洲男同1069视频| 亚洲精品视频免费观看| 亚洲精品欧美在线| 亚洲一区在线观看免费 | 国产日韩影视精品| 日本一区二区三区视频视频| 国产欧美久久久精品影院| 久久精品日韩一区二区三区| 国产视频视频一区| 欧美激情综合在线| 亚洲色图欧美偷拍| 亚洲国产精品影院| 免费不卡在线视频| 国产精品一区二区男女羞羞无遮挡| 国产福利精品导航| 91麻豆福利精品推荐| 欧美日韩国产免费| 精品国产在天天线2019| 国产欧美精品国产国产专区| 国产精品黄色在线观看| 亚洲午夜免费福利视频| 六月丁香婷婷色狠狠久久| 国产高清在线观看免费不卡| 91免费国产在线| 91精品国产一区二区三区蜜臀| 久久综合九色综合久久久精品综合 | 国产成+人+日韩+欧美+亚洲 | 懂色av一区二区夜夜嗨| 99r国产精品| 日韩亚洲欧美中文三级| 国产精品丝袜久久久久久app| 一区二区三区中文字幕电影| 麻豆国产一区二区| 99久久婷婷国产综合精品电影| 欧美精选在线播放| 欧美韩日一区二区三区| 亚洲福利国产精品| 国产精品综合av一区二区国产馆| 91香蕉视频黄| 亚洲精品一区二区在线观看| 亚洲视频1区2区| 精品在线视频一区| 97久久超碰国产精品| 久久综合久久99| 亚洲成精国产精品女| 成a人片亚洲日本久久| 欧美一区永久视频免费观看| 国产精品嫩草影院com| 五月天丁香久久| 97精品国产露脸对白| 久久久久久免费网| 日产精品久久久久久久性色| 成人sese在线| 亚洲精品在线观| 性久久久久久久久| 91免费国产在线观看| 久久久.com| 蜜桃av噜噜一区| 欧美日韩夫妻久久| 综合自拍亚洲综合图不卡区| 国产精品正在播放| 欧美一区二区观看视频| 亚洲精品高清在线观看| av在线不卡免费看| 久久久不卡影院| 极品美女销魂一区二区三区 | 欧美蜜桃一区二区三区| 最新中文字幕一区二区三区 | 国产美女精品一区二区三区| 欧美精品18+| 亚洲一区二区不卡免费| 色婷婷一区二区三区四区| 中文字幕一区二区三中文字幕| 国产suv一区二区三区88区| 日韩欧美国产系列| 另类专区欧美蜜桃臀第一页| 欧美一区二区在线不卡| 丝瓜av网站精品一区二区| 欧美在线|欧美| 午夜影院久久久| 宅男噜噜噜66一区二区66| 日韩在线一二三区| 91精品国产乱码| 麻豆91精品视频| 久久久久久**毛片大全|