From: Szymon Janc <szymon.janc@codecoup.pl>
To: "Łukasz Rymanowski" <lukasz.rymanowski@codecoup.pl>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH BlueZ] btmon: Add colors to data status in extended adv report
Date: Tue, 30 Oct 2018 10:21:53 +0100 [thread overview]
Message-ID: <1719606.xSmM3C9bhQ@ix> (raw)
In-Reply-To: <20181024101718.26695-1-lukasz.rymanowski@codecoup.pl>
Hi Łukasz,
On Wednesday, 24 October 2018 12:17:18 CET Łukasz Rymanowski wrote:
> This patch gives color indicators to data status in extended
> advertising reports. This gives better visibility on which advertising
> events were completed or truncated.
> ---
> monitor/packet.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/monitor/packet.c b/monitor/packet.c
> index cf4a64362..eabd21914 100644
> --- a/monitor/packet.c
> +++ b/monitor/packet.c
> @@ -9323,6 +9323,7 @@ static void print_ext_adv_report_evt_type(const char
> *indent, uint16_t flags) uint16_t props = flags;
> uint8_t data_status;
> const char *str;
> + const char *color_on;
> int i;
>
> print_field("%sEvent type: 0x%4.4x", indent, flags);
> @@ -9343,19 +9344,23 @@ static void print_ext_adv_report_evt_type(const char
> *indent, uint16_t flags) switch (data_status) {
> case 0x00:
> str = "Complete";
> + color_on = COLOR_GREEN;
> break;
> case 0x01:
> str = "Incomplete, more data to come";
> + color_on = COLOR_YELLOW;
> break;
> case 0x02:
> str = "Incomplete, data truncated, no more to come";
> + color_on = COLOR_RED;
> break;
> default:
> str = "Reserved";
> + color_on = COLOR_RED;
> break;
> }
>
> - print_field("%s Data status: %s", indent, str);
> + print_field("%s Data status: %s%s%s", indent, color_on, str, COLOR_OFF);
>
> if (mask)
> print_text(COLOR_UNKNOWN_ADV_FLAG,
Patch applied, thanks.
--
pozdrawiam
Szymon Janc
prev parent reply other threads:[~2018-10-30 9:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-24 10:17 [PATCH BlueZ] btmon: Add colors to data status in extended adv report Łukasz Rymanowski
2018-10-30 9:21 ` Szymon Janc [this message]
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=1719606.xSmM3C9bhQ@ix \
--to=szymon.janc@codecoup.pl \
--cc=linux-bluetooth@vger.kernel.org \
--cc=lukasz.rymanowski@codecoup.pl \
/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;
as well as URLs for NNTP newsgroup(s).