public inbox for
 help / color / mirror / Atom feed
Subject: [Bug 1001466] /dev/null serial driver
Date: Thu, 16 Feb 2012 14:21:00 -0000	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

Please do not reply to this email. Use the web interface provided at:

--- Comment #6 from Bernard Fouché <> 2012-02-16 14:20:30 GMT ---
My issue is to keep in the app on the field things like
fprintf(DebugStream,...) and be able to activate/deactivate the debug messages
without modifying the app, and without adding things like 'if(DebugOpened)'
before each use of DebugStream.

This way I can use a serial port for the app and when debug is needed, I
disconnect the connected device on the serial port, connect instead a terminal
emulator, activate debug, check the debug messages and then go back to full app
mode afterwards.

If I use:


Then I also need


While with this driver I can do:


When I need to deactivate the messages, I fclose(DebugStream) and do

When I need the debug messages back I do the same fclose() but fopen() to some
/dev/serX. In my mind it's like sending stderr to /dev/null or sending it to
some output device, that's why I named this fake driver '/dev/null'.

Performance isn't an issue here, it's convenience first during app tests (that
can last for months) on a target that uses all serial ports.

I can't add enable/disable config keys to serial.c since this would completely
switch on or off the uart: I always need the uart but I need to select what
stream is feeding it.

Maybe the proper solution is in the stdio lib? Or rename the driver
/dev/ser_void to avoid semantics confusion with /dev/null?

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

  parent reply	other threads:[~2012-02-16 14:21 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 17:39 [Bug 1001466] New: " bugzilla-daemon
2012-01-27 19:14 ` [Bug 1001466] " bugzilla-daemon
2012-02-15 13:47 ` bugzilla-daemon
2012-02-15 13:48 ` bugzilla-daemon
2012-02-15 20:46 ` bugzilla-daemon
2012-02-16  9:55 ` bugzilla-daemon
2012-02-16 14:01   ` Grant Edwards
2012-02-16 12:20 ` bugzilla-daemon
2012-02-16 14:21 ` bugzilla-daemon [this message]
2012-02-16 15:06 ` bugzilla-daemon
2012-02-16 15:39 ` bugzilla-daemon
2012-02-16 15:58 ` bugzilla-daemon
2012-02-16 16:26 ` bugzilla-daemon
2012-02-16 16:37 ` bugzilla-daemon
2012-02-16 16:49 ` bugzilla-daemon
2012-02-16 17:21 ` bugzilla-daemon
2012-02-17  6:17 ` bugzilla-daemon
2012-02-18 19:38 ` bugzilla-daemon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).