All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] tools/btmgmt: Add readline support to stop-find
@ 2017-10-06  4:12 ERAMOTO Masaya
  2017-10-06  4:14 ` [PATCH BlueZ 2/2] tools/btmgmt: Remove 'btmgmt' from stop-find usage ERAMOTO Masaya
  2017-10-12  8:16 ` [PATCH BlueZ 1/2] tools/btmgmt: Add readline support to stop-find ERAMOTO Masaya
  0 siblings, 2 replies; 3+ messages in thread
From: ERAMOTO Masaya @ 2017-10-06  4:12 UTC (permalink / raw)
  To: linux-bluetooth

So can continue to run btmgmt even if using 'stop-find --help' in the 
interactive mode.
---
 tools/btmgmt.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index e454d86..0f21f48 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -2357,13 +2357,12 @@ static void stop_find_rsp(uint8_t status, uint16_t len, const void *param,
 							void *user_data)
 {
 	if (status != 0) {
-		fprintf(stderr,
-			"Stop Discovery failed: status 0x%02x (%s)\n",
+		error("Stop Discovery failed: status 0x%02x (%s)",
 						status, mgmt_errstr(status));
 		return noninteractive_quit(EXIT_SUCCESS);
 	}
 
-	printf("Discovery stopped\n");
+	print("Discovery stopped");
 	discovery = false;
 
 	noninteractive_quit(EXIT_SUCCESS);
@@ -2371,7 +2370,7 @@ static void stop_find_rsp(uint8_t status, uint16_t len, const void *param,
 
 static void stop_find_usage(void)
 {
-	printf("Usage: btmgmt stop-find [-l|-b]>\n");
+	print("Usage: btmgmt stop-find [-l|-b]");
 }
 
 static struct option stop_find_options[] = {
@@ -2406,7 +2405,7 @@ static void cmd_stop_find(struct mgmt *mgmt, uint16_t index, int argc,
 		default:
 			stop_find_usage();
 			optind = 0;
-			exit(EXIT_SUCCESS);
+			return noninteractive_quit(EXIT_SUCCESS);
 		}
 	}
 
@@ -2419,8 +2418,8 @@ static void cmd_stop_find(struct mgmt *mgmt, uint16_t index, int argc,
 
 	if (mgmt_send(mgmt, MGMT_OP_STOP_DISCOVERY, index, sizeof(cp), &cp,
 					     stop_find_rsp, NULL, NULL) == 0) {
-		fprintf(stderr, "Unable to send stop_discovery cmd\n");
-		exit(EXIT_FAILURE);
+		error("Unable to send stop_discovery cmd");
+		return noninteractive_quit(EXIT_FAILURE);
 	}
 }
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH BlueZ 2/2] tools/btmgmt: Remove 'btmgmt' from stop-find usage
  2017-10-06  4:12 [PATCH BlueZ 1/2] tools/btmgmt: Add readline support to stop-find ERAMOTO Masaya
@ 2017-10-06  4:14 ` ERAMOTO Masaya
  2017-10-12  8:16 ` [PATCH BlueZ 1/2] tools/btmgmt: Add readline support to stop-find ERAMOTO Masaya
  1 sibling, 0 replies; 3+ messages in thread
From: ERAMOTO Masaya @ 2017-10-06  4:14 UTC (permalink / raw)
  To: linux-bluetooth

Apply the similar change as 5c35029fad ("tools/btmgmt: Remove 'btmgmt'
from help output") to stop-find usage.
---
 tools/btmgmt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/btmgmt.c b/tools/btmgmt.c
index 0f21f48..c29c1cb 100644
--- a/tools/btmgmt.c
+++ b/tools/btmgmt.c
@@ -2370,7 +2370,7 @@ static void stop_find_rsp(uint8_t status, uint16_t len, const void *param,
 
 static void stop_find_usage(void)
 {
-	print("Usage: btmgmt stop-find [-l|-b]");
+	print("Usage: stop-find [-l|-b]");
 }
 
 static struct option stop_find_options[] = {
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ 1/2] tools/btmgmt: Add readline support to stop-find
  2017-10-06  4:12 [PATCH BlueZ 1/2] tools/btmgmt: Add readline support to stop-find ERAMOTO Masaya
  2017-10-06  4:14 ` [PATCH BlueZ 2/2] tools/btmgmt: Remove 'btmgmt' from stop-find usage ERAMOTO Masaya
@ 2017-10-12  8:16 ` ERAMOTO Masaya
  1 sibling, 0 replies; 3+ messages in thread
From: ERAMOTO Masaya @ 2017-10-12  8:16 UTC (permalink / raw)
  To: linux-bluetooth

Hi Luiz,

Could you please help to have a review?

Regards,
Eramoto

On 10/06/2017 01:12 PM, ERAMOTO Masaya wrote:
> So can continue to run btmgmt even if using 'stop-find --help' in the 
> interactive mode.
> ---
>  tools/btmgmt.c | 13 ++++++-------
>  1 file changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/tools/btmgmt.c b/tools/btmgmt.c
> index e454d86..0f21f48 100644
> --- a/tools/btmgmt.c
> +++ b/tools/btmgmt.c
> @@ -2357,13 +2357,12 @@ static void stop_find_rsp(uint8_t status, uint16_t len, const void *param,
>  							void *user_data)
>  {
>  	if (status != 0) {
> -		fprintf(stderr,
> -			"Stop Discovery failed: status 0x%02x (%s)\n",
> +		error("Stop Discovery failed: status 0x%02x (%s)",
>  						status, mgmt_errstr(status));
>  		return noninteractive_quit(EXIT_SUCCESS);
>  	}
>  
> -	printf("Discovery stopped\n");
> +	print("Discovery stopped");
>  	discovery = false;
>  
>  	noninteractive_quit(EXIT_SUCCESS);
> @@ -2371,7 +2370,7 @@ static void stop_find_rsp(uint8_t status, uint16_t len, const void *param,
>  
>  static void stop_find_usage(void)
>  {
> -	printf("Usage: btmgmt stop-find [-l|-b]>\n");
> +	print("Usage: btmgmt stop-find [-l|-b]");
>  }
>  
>  static struct option stop_find_options[] = {
> @@ -2406,7 +2405,7 @@ static void cmd_stop_find(struct mgmt *mgmt, uint16_t index, int argc,
>  		default:
>  			stop_find_usage();
>  			optind = 0;
> -			exit(EXIT_SUCCESS);
> +			return noninteractive_quit(EXIT_SUCCESS);
>  		}
>  	}
>  
> @@ -2419,8 +2418,8 @@ static void cmd_stop_find(struct mgmt *mgmt, uint16_t index, int argc,
>  
>  	if (mgmt_send(mgmt, MGMT_OP_STOP_DISCOVERY, index, sizeof(cp), &cp,
>  					     stop_find_rsp, NULL, NULL) == 0) {
> -		fprintf(stderr, "Unable to send stop_discovery cmd\n");
> -		exit(EXIT_FAILURE);
> +		error("Unable to send stop_discovery cmd");
> +		return noninteractive_quit(EXIT_FAILURE);
>  	}
>  }
>  
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-12  8:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06  4:12 [PATCH BlueZ 1/2] tools/btmgmt: Add readline support to stop-find ERAMOTO Masaya
2017-10-06  4:14 ` [PATCH BlueZ 2/2] tools/btmgmt: Remove 'btmgmt' from stop-find usage ERAMOTO Masaya
2017-10-12  8:16 ` [PATCH BlueZ 1/2] tools/btmgmt: Add readline support to stop-find ERAMOTO Masaya

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.