Auto accept the pairing request and connection in TV Profile 02/44802/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 28 Jul 2015 04:10:39 +0000 (13:10 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 28 Jul 2015 04:10:39 +0000 (13:10 +0900)
Change-Id: I44a5df1bf906586675b4ac86d82f9a2abc0657ce
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-service/bt-service-agent.c
packaging/bluetooth-frwk.spec

index b6b82d2..82fdb13 100644 (file)
@@ -479,6 +479,12 @@ static gboolean __pincode_request(GapAgentPrivate *agent, GDBusProxy *device)
                goto done;
        }
 
+#ifdef AUTO_ACCEPT
+       gap_agent_reply_pin_code(agent, GAP_AGENT_ACCEPT, "0000",
+                                                                               NULL);
+       goto done;
+#endif
+
        g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
 
        tmp_value = g_variant_lookup_value(reply, "Class", G_VARIANT_TYPE_UINT32);
@@ -556,6 +562,12 @@ static gboolean __passkey_request(GapAgentPrivate *agent, GDBusProxy *device)
                goto done;
        }
 
+#ifdef AUTO_ACCEPT
+       gap_agent_reply_pin_code(agent, GAP_AGENT_ACCEPT, "0000",
+                                                                               NULL);
+       goto done;
+#endif
+
        g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
 
        tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
@@ -603,6 +615,12 @@ static gboolean __display_request(GapAgentPrivate *agent, GDBusProxy *device,
                goto done;
        }
 
+#ifdef AUTO_ACCEPT
+       gap_agent_reply_pin_code(agent, GAP_AGENT_ACCEPT, "0000",
+                                                                               NULL);
+       goto done;
+#endif
+
        g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
 
        tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
@@ -658,6 +676,12 @@ static gboolean __confirm_request(GapAgentPrivate *agent, GDBusProxy *device,
                goto done;
        }
 
+#ifdef AUTO_ACCEPT
+       gap_agent_reply_pin_code(agent, GAP_AGENT_ACCEPT, str_passkey,
+                                                                               NULL);
+       goto done;
+#endif
+
        g_variant_get(reply_temp,"(@a{sv})", &reply); /* Format of reply a{sv}*/
 
        tmp_value = g_variant_lookup_value (reply, "Address", G_VARIANT_TYPE_STRING);
@@ -755,6 +779,12 @@ static gboolean __authorize_request(GapAgentPrivate *agent, GDBusProxy *device,
 
        BT_DBG("+");
 
+#ifdef AUTO_ACCEPT
+       gap_agent_reply_authorize(agent, GAP_AGENT_ACCEPT,
+                                         NULL);
+       goto done;
+#endif
+
        /* Check if already Media connection exsist */
        if (!strcasecmp(uuid, A2DP_UUID)) {
                gboolean ret = FALSE;
index baf3423..5599dda 100644 (file)
@@ -126,7 +126,7 @@ export CFLAGS="$CFLAGS -DTIZEN_WEARABLE"
 %endif
 
 %if "%{?profile}" == "tv"
-export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV"
+export CFLAGS="$CFLAGS -DUSB_BLUETOOTH -DTIZEN_TV -DAUTO_ACCEPT"
 %define _servicefile packaging/bluetooth-frwk-mobile.service
 %define _servicedir multi-user.target.wants
 %endif