From: Kent Gibson <warthog618@gmail.com>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Gabriel Matni <gabriel.matni@gmail.com>,
linux-gpio@vger.kernel.org, gabriel.matni@exfo.com
Subject: Re: [libgpiod][PATCH V4 1/1] tools: gpiomon/gpionotify: add idle-timeout option
Date: Tue, 13 Jun 2023 00:08:06 +0800 [thread overview]
Message-ID: <ZIdC5sCnXwVa5LZ6@sol> (raw)
In-Reply-To: <CAMRc=MeBQFeafXxR9fGjUCSh0UhZKvcO0pZxsRYCNHX=s87E6A@mail.gmail.com>
On Mon, Jun 12, 2023 at 06:05:11PM +0200, Bartosz Golaszewski wrote:
> On Mon, Jun 12, 2023 at 3:31 AM Gabriel Matni <gabriel.matni@gmail.com> wrote:
> >
> > From: Gabriel Matni <gabriel.matni@exfo.com>
> >
> > Add an idle timeout option to gpiomon and gpionotify to exit gracefully
> > when no event has been detected for a given period.
> >
> > Signed-off-by: Gabriel Matni <gabriel.matni@exfo.com>
> > ---
> > V3 -> V4: Submitting patch with git send-email
> >
> > V2 -> V3: Addressed the following review comments:
> > - Simplify the commit message
> > - Clarify the help description of the --idle-timeout option
> > - Declare ret variable at the top of function for gpionotify, not required for gpiomon
> >
> > V1 -> V2: Addressed the following review comments:
> > - Renamed timeout option to idle-timeout
> > - Timeout value is now signed
> > - Reused print_period_help() for idle-timeout option
> > - Added the idle-timeout option to gpionotify for consistency
> >
> > tools/gpiomon.c | 14 +++++++++++++-
> > tools/gpionotify.c | 17 +++++++++++++++--
> > 2 files changed, 28 insertions(+), 3 deletions(-)
> >
> > diff --git a/tools/gpiomon.c b/tools/gpiomon.c
> > index c2684c2..e3abb2d 100644
> > --- a/tools/gpiomon.c
> > +++ b/tools/gpiomon.c
> > @@ -30,6 +30,7 @@ struct config {
> > const char *fmt;
> > enum gpiod_line_clock event_clock;
> > int timestamp_fmt;
> > + int timeout;
> > };
> >
> > static void print_help(void)
> > @@ -57,6 +58,8 @@ static void print_help(void)
> > printf("\t\t\tBy default 'realtime' is formatted as UTC, others as raw u64.\n");
> > printf(" -h, --help\t\tdisplay this help and exit\n");
> > printf(" -F, --format <fmt>\tspecify a custom output format\n");
> > + printf(" --idle-timeout <period>\n");
> > + printf("\t\t\texit gracefully if no events occur for the period specified\n");
>
> I think it would be useful to state the time units used by this option here.
>
That is already covered by the period help:
Periods:
Periods are taken as milliseconds unless units are specified. e.g. 10us.
Supported units are 's', 'ms', and 'us'.
Cheers,
Kent.
next prev parent reply other threads:[~2023-06-12 16:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 1:30 [libgpiod][PATCH V4 1/1] tools: gpiomon/gpionotify: add idle-timeout option Gabriel Matni
2023-06-12 2:03 ` Kent Gibson
2023-06-12 16:05 ` Bartosz Golaszewski
2023-06-12 16:08 ` Kent Gibson [this message]
2023-06-12 16:30 ` Bartosz Golaszewski
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZIdC5sCnXwVa5LZ6@sol \
--to=warthog618@gmail.com \
--cc=brgl@bgdev.pl \
--cc=gabriel.matni@exfo.com \
--cc=gabriel.matni@gmail.com \
--cc=linux-gpio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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