Several questions about the serial port

Source: Internet
Author: User
For more information about serial port-general Linux technology-Linux programming and kernel, see the following. 1. Is it possible to open a serial port and open a cache to receive data without reading the data?
2. read (fd, buf, size );
Tcflush (fd, TCIFLUSH );
Is tcflush refreshing the above buf cache?
3. Now I want to read commands from the serial port. Each Command has one byte. Do I need to clear the cache every time I finish reading it? Otherwise, the subsequent commands will be placed at the end. I want to determine if the following command is a new one?
Or do you want to notify the other party of reading each command, and the other party sends a new command?

4. How can I find the source code of a function in which file? Man functionname can only be used to find the file in which the function is declared. I don't know in which file

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.