From 379f3fa52ed76d0e50f65de4bf4eef6522defc89 Mon Sep 17 00:00:00 2001 From: Amit Purwar Date: Wed, 25 Sep 2019 18:07:13 +0530 Subject: [PATCH] Resolved the GAP Agent re-registration Failure Change-Id: I8c828e15b2aae66bcdb4d606328b27e5e1993f46 Signed-off-by: Amit Purwar --- bt-oal/bluez_hal/src/bt-hal-gap-agent.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bt-oal/bluez_hal/src/bt-hal-gap-agent.c b/bt-oal/bluez_hal/src/bt-hal-gap-agent.c index 9a9f804..735951b 100644 --- a/bt-oal/bluez_hal/src/bt-hal-gap-agent.c +++ b/bt-oal/bluez_hal/src/bt-hal-gap-agent.c @@ -49,6 +49,8 @@ typedef enum { GAP_AGENT_ERROR_TIMEOUT, } GapAgentError; +#define AGENT_ALREADY_EXIST 0x24 + #define GAP_AGENT_ERROR (gap_agent_error_quark()) static GQuark gap_agent_error_quark(void) @@ -150,11 +152,17 @@ gboolean _gap_agent_register(GapAgentPrivate *agent) if (error) { ERR("Agent registration failed: errCode[%x], message[%s]", error->code, error->message); + } + + if (error->code == AGENT_ALREADY_EXIST) { + DBG("Agent is already registered"); + g_clear_error(&error); + } else { g_clear_error(&error); + g_object_unref(agent_manager); + priv->agent_manager = NULL; + return FALSE; } - g_object_unref(agent_manager); - priv->agent_manager = NULL; - return FALSE; } g_variant_unref(reply); reply = NULL; -- 2.7.4