Diff between e80e4bd1ec7ede43fcac62b6e8892393ab8ea564 and 4fe74261765b633a737299ee4782694e12ef7f99

Changed Files

File Additions Deletions Status
attrib/interactive.c +7 -8 modified

Full Patch

diff --git a/attrib/interactive.c b/attrib/interactive.c
index 5ffe2fb..7520324 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -73,20 +73,18 @@ static enum state {
 
 static char *get_prompt(void)
 {
-	if (conn_state == STATE_CONNECTING) {
-		g_string_assign(prompt, "Connecting... ");
-		return prompt->str;
-	}
-
 	if (conn_state == STATE_CONNECTED)
-		g_string_append(prompt, COLOR_BLUE);
+		g_string_assign(prompt, COLOR_BLUE);
+	else
+		g_string_assign(prompt, "");
 
 	if (opt_dst)
 		g_string_append_printf(prompt, "[%17s]", opt_dst);
 	else
 		g_string_append_printf(prompt, "[%17s]", "");
 
-	g_string_append(prompt, COLOR_OFF);
+	if (conn_state == STATE_CONNECTED)
+		g_string_append(prompt, COLOR_OFF);
 
 	if (opt_psm)
 		g_string_append(prompt, "[BR]");
@@ -160,7 +158,7 @@ static void connect_cb(GIOChannel *io, GError *err, gpointer user_data)
 	g_attrib_register(attrib, ATT_OP_HANDLE_IND, GATTRIB_ALL_HANDLES,
 						events_handler, attrib, NULL);
 	set_state(STATE_CONNECTED);
-	rl_redisplay();
+	rl_printf("Connection successful\n");
 }
 
 static void disconnect_io()
@@ -408,6 +406,7 @@ static void cmd_connect(int argcp, char **argvp)
 		return;
 	}
 
+	rl_printf("Attempting to connect to %s\n", opt_dst);
 	set_state(STATE_CONNECTING);
 	iochannel = gatt_connect(opt_src, opt_dst, opt_dst_type, opt_sec_level,
 					opt_psm, opt_mtu, connect_cb, &gerr);