[Qt] Detailed explanation of QSerialPort serial communication to realize the function of sending and receiving data

Table of contents

1、QSerialPort

2. Example demonstration


1、QSerialPort

QSerialPortIt is a class used for serial communication in the Qt framework. It provides the functions of configuring the serial port, sending and receiving data.

The following are QSerialPortsome commonly used functions and methods of classes:

  • open(QIODevice::OpenMode mode): Open the serial port. modeParameters can be set to QIODevice::ReadOnly(read-only mode), QIODevice::WriteOnly(write-only mode) or QIODevice::ReadWrite(read-write mode).
  • close(): close string

Guess you like

Origin blog.csdn.net/fanjufei123456/article/details/133133732