Re: [PATCH BlueZ v4 3/9] mgmt: Introduce mgmt_set_verbose

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Luiz,

> This introduces mgmt_set_verbose which can be used to enable printing
> the the likes hexdump of packets, by default it is disabled since in
> most cases the hexdump is not very useful and there are better tools
> to collect the hexdumo like btmon.
> ---
> src/shared/mgmt.c | 24 ++++++++++++++++++++----
> src/shared/mgmt.h |  1 +
> 2 files changed, 21 insertions(+), 4 deletions(-)
> 
> diff --git a/src/shared/mgmt.c b/src/shared/mgmt.c
> index c7e6a6c1d..cf518cc2b 100644
> --- a/src/shared/mgmt.c
> +++ b/src/shared/mgmt.c
> @@ -50,6 +50,7 @@ struct mgmt {
> 	mgmt_debug_func_t debug_callback;
> 	mgmt_destroy_func_t debug_destroy;
> 	void *debug_data;
> +	bool verbose;
> };
> 
> struct mgmt_request {
> @@ -192,6 +193,15 @@ static void mgmt_log(struct mgmt *mgmt, const char *format, ...)
> 	va_end(ap);
> }
> 
> +static void mgmt_hexdump(struct mgmt *mgmt, char dir, const void *data,
> +							size_t len)
> +{
> +	if (!mgmt->verbose)
> +		return;
> +
> +	util_hexdump(dir, data, len, mgmt->debug_callback, mgmt->debug_data);
> +}
> +

this is stupid, lets just remove the support for hexdump altogether here. This code was written when mgmt tracing via btmon was not available, but since it is now, there is really no point.

Regards

Marcel




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux