• C#串口官方库


    public const int InfiniteTimeout = -1;        只读 -1值

    public SerialPort();        串口默认构造

    public SerialPort(IContainer container);        接口

    SerialPort(串口名, 波特率, 校验, 数据位, 停止位);        96N81

    // 属性

    public Handshake Handshake        硬件流控制

    public Encoding Encoding         文本编码

    public bool DtrEnable                终端就绪 (DTR) 信号。

    public bool CtsHolding                可以发送

    public bool DiscardNull         忽略 Null 字节

    public int DataBits         数据位长度。

    public bool IsOpen        串行端口已打开

    public bool DsrHolding        获取数据设置就绪 (DSR) 信号的状态。

    public string NewLine        表示行尾的值。默认值为换行符

    public int ReadBufferSize       字节 默认值为 4096;

    public byte ParityReplace        奇偶校验错误时替换数据流中的无效字节。

    public string PortName

    public bool CDHolding        载波检测

    public int ReadTimeout        毫秒数

    public int ReceivedBytesThreshold        事件发生前内部输入缓冲区中的字节数。

    public bool RtsEnable                请求发送 (RTS) 信号

    public StopBits StopBits

    public int WriteBufferSize

    public int WriteTimeout

    public Parity Parity

    public int BytesToRead

    public int BaudRate

    public bool BreakState

    public Stream BaseStream 

    public int BytesToWrite

    public event SerialErrorReceivedEventHandler ErrorReceived;

    public event SerialDataReceivedEventHandler DataReceived;

    public event SerialPinChangedEventHandler PinChanged;

    static string[] GetPortNames();

    void Close();

    void DiscardInBuffer();

    void DiscardOutBuffer();

    void Open();

    int Read(byte[] buffer, int offset, int count);

    int Read(char[] buffer, int offset, int count);

    int ReadByte();

    int ReadChar();

    string ReadExisting();

    string ReadLine();

    string ReadTo(string value);

    void Write(byte[] buffer, int offset, int count);

    void Write(string text);

    void Write(char[] buffer, int offset, int count);

    void WriteLine(string text);

    override void Dispose(bool disposing);

  • 相关阅读:
    Android 12.0 framework层设置后台运行app进程最大数功能实现
    背包问题(动归)
    MySQL教程
    C复习-字符串+字符+字节
    数组越界访问导致死循环的情况
    element-ui的form校验失败
    动环监控安装及调试过程,动环监控调试是什么
    深入讲解Linux上TCP的几个内核参数调优
    华为云云耀云服务器L实例评测|华为云云耀云服务器docker部署srs,可使用HLS协议
    计算机 软件工程 毕业设计题目推荐
  • 原文地址:https://blog.csdn.net/cfqq1989/article/details/126275125