diff --git a/attrib/interactive.c b/attrib/interactive.c
index 5ffe2fb..7520324 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
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]");
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()
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);