Mail Archives: djgpp/2002/07/12/13:30:59
Alex Oleynikov (alex AT compuweigh DOT com) wrote:
: MartinS wrote:
: > : Well, I cannot have COM3 open internally for both stderr and my
: > : application's output at the same time, right?
: > : Maybe you could suggest some other way of printing the crash dump
: > : without using redir?
: >
: > How about only printing to stderr and let redir direct it to COM3?
: Impossible due to specific regulations in the industry - this area has a lot
: of rules and regulations especially about the audit printing of the weighing
: process, which is supervised by the government. Therefore I need to have a
: direct connection with the printer in order to recognize "Off-line" or "Out
: of paper" conditions etc.
Ok. How about adding a file system extension (FSEXT) that handles the
device (say you name it "my_prn") and then you open it and fprintf()
as usual to it. In the extension you use the serial comm. library
(which name I've forgotten right now) and detect if something goes
wrong and set errno accordingly and return -1?
By the way, if that printer is the only output you got for error dumps
what do you do when the printer signals out of paper? (Print a an
error message..., oops the printer isn't working!)
Right,
MartinS
- Raw text -