📄 portsettings.cs
字号:
//==========================================================================================
//
// WJ.Serial.PortSettings
// Copyright (c) 2006, WJ Communications, Inc.
//
// This class is mostly derived from the OpenNETCF.org PortSettings class.
//
// (OpenNETCF.IO.Serial.PortSettings as of 02/14/05)
// Some modifications were made to the original source, however, including:
// 1) Changed Assembly namespace to WJ.Serial
//
//==========================================================================================
//==========================================================================================
//
// 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 WJ.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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -