diff mbox series

[BlueZ,3/9] btgatt-client: Don't wait for discovery on read/write commands

Message ID 20230323103835.571037-4-simon.mikuda@streamunlimited.com (mailing list archive)
State New, archived
Headers show
Series gatt-db fix + btgatt-client features | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch success CheckPatch PASS
tedd_an/GitLint success Gitlint PASS
tedd_an/IncrementalBuild success Incremental Build PASS

Commit Message

Simon Mikuda March 23, 2023, 10:38 a.m. UTC
---
 tools/btgatt-client.c | 45 -------------------------------------------
 1 file changed, 45 deletions(-)
diff mbox series

Patch

diff --git a/tools/btgatt-client.c b/tools/btgatt-client.c
index cce978869..2a0cb5181 100644
--- a/tools/btgatt-client.c
+++ b/tools/btgatt-client.c
@@ -490,11 +490,6 @@  static void cmd_read_multiple(struct client *cli, char *cmd_str)
 	int i;
 	char *endptr = NULL;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	if (!parse_args(cmd_str, sizeof(argv), argv, &argc) || argc < 2) {
 		read_multiple_usage();
 		return;
@@ -560,11 +555,6 @@  static void cmd_read_value(struct client *cli, char *cmd_str)
 	uint16_t handle;
 	char *endptr = NULL;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	if (!parse_args(cmd_str, 1, argv, &argc) || argc != 1) {
 		read_value_usage();
 		return;
@@ -594,11 +584,6 @@  static void cmd_read_long_value(struct client *cli, char *cmd_str)
 	uint16_t offset;
 	char *endptr = NULL;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	if (!parse_args(cmd_str, 2, argv, &argc) || argc != 2) {
 		read_long_value_usage();
 		return;
@@ -661,11 +646,6 @@  static void cmd_write_value(struct client *cli, char *cmd_str)
 	bool without_response = false;
 	bool signed_write = false;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	if (!parse_args(cmd_str, 514, argv + 1, &argc)) {
 		printf("Too many arguments\n");
 		write_value_usage();
@@ -791,11 +771,6 @@  static void cmd_write_long_value(struct client *cli, char *cmd_str)
 	uint8_t *value = NULL;
 	bool reliable_writes = false;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	if (!parse_args(cmd_str, 514, argv + 1, &argc)) {
 		printf("Too many arguments\n");
 		write_value_usage();
@@ -901,11 +876,6 @@  static void cmd_write_prepare(struct client *cli, char *cmd_str)
 	unsigned int length;
 	uint8_t *value = NULL;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	if (!parse_args(cmd_str, 514, argv + 1, &argc)) {
 		printf("Too many arguments\n");
 		write_value_usage();
@@ -1026,11 +996,6 @@  static void cmd_write_execute(struct client *cli, char *cmd_str)
 	unsigned int session_id;
 	bool execute;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	if (!parse_args(cmd_str, 514, argv, &argc)) {
 		printf("Too many arguments\n");
 		write_value_usage();
@@ -1193,11 +1158,6 @@  static void cmd_set_security(struct client *cli, char *cmd_str)
 	char *endptr = NULL;
 	int level;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	if (!parse_args(cmd_str, 1, argv, &argc)) {
 		printf("Too many arguments\n");
 		set_security_usage();
@@ -1225,11 +1185,6 @@  static void cmd_get_security(struct client *cli, char *cmd_str)
 {
 	int level;
 
-	if (!bt_gatt_client_is_ready(cli->gatt)) {
-		printf("GATT client not initialized\n");
-		return;
-	}
-
 	level = bt_gatt_client_get_security(cli->gatt);
 	if (level < 0)
 		printf("Could not set sec level\n");