LibSerialPort.jl icon indicating copy to clipboard operation
LibSerialPort.jl copied to clipboard

purpose of seteof() and reseteof()

Open mgkuhn opened this issue 5 years ago • 1 comments

What's the purpose (“use case”) of method seteof() in the high-level API? It seems currently the sole way to influence the return value of eof().

A serial port does not really have any notion of “file” and therefore no inherent way of communicating an “end of file” condition. So I would have expected either

  1. eof(sp::SerialPort) = false as a minimalist implementation of that Base.IO function, or
  2. methods to define some EOF symbol that, if received, will cause eof() == true after the preceding byte has been read.

Are there any particular EOF signals that people would like to be interpreted that way? For example:

  1. Ctrl-Z = 0x1a (as on MS-DOS)?
  2. break signal?
  3. some particular modem status-line change?

Otherwise, why not simply set eof(sp::SerialPort) = false?

mgkuhn avatar Apr 21 '20 15:04 mgkuhn

eof was used in the readuntil method that is removed in #61. Now it is just an artifact. I have no objection to setting it to false or removing it entirely, unless one of these new uses is found for it.

andrewadare avatar Apr 21 '20 15:04 andrewadare