CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 1999
    Posts
    92

    Serial Port gets caught in loop

    I have developed a class that access the serial ports of a PC. I have one problem though. If I am reading the buffer and I come to the end of the text the app waits until it finds a return character. Is there a way to use the CreateFile and Readfile functions so that you can detect the end of file?


  2. #2
    Guest

    Re: Serial Port gets caught in loop

    As I understood the problem you want to read data from serial port until there are any without having any particular character that indicates the end of data?
    If so you can use ReadFile to read a certain number of bytes and then check if the specified number of bytes are read or the specified timeout occurs(which must be set)what would mean that there are no more data.

    I hope it help...


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured