* Function: Open the serial port and return the description of the serial device file Opening the serial module has that and some components.ġ > Call the open() function to open the serial port and get the device file descriptor of the serial portĢ > Obtain the state of serial port and judge whether it is blocked or notģ> test Is the open file descriptor a terminal device? O_NDELAY: Indicates that you do not care about the state of the DCD signa l line (whether the other end of the port is activated or stopped).ģ. If this flag is not used, a task input (eg: keyboard stop signal, etc.) will affect the process. O_NOCTTY: This means that a terminal device is opened and the program will not become the control terminal of the port. For the open operation of the serial port, the O_NOCTTY parameter must be used. Call the open() function to replace the serial device. In Linxu, serial devices are accessed through serial terminal device files, that is, by accessing / dev/ttyS0,/dev/ttyS1,/dev/ttyS2.Ģ. Since the serial port is in the linux It is regarded as a file, so it should be opened before it is operated.ġ. Linux The following serial port programming and those components
0 Comments
Leave a Reply. |