[Tizen-submit] 18009: Changes to Tizen:Mobile/bluetooth-frwk

noreply at tizen.org noreply at tizen.org
Wed Nov 20 02:38:20 GMT 2013


Hi,
Wu zheng have made the following changes to bluetooth-frwk in project Tizen:Mobile. Please review and accept ASAP.

Thank You,

[This message was auto-generated]

---

Request: #18009

  submit:       Tizen:Mobile:build/bluetooth-frwk(cleanup) -> Tizen:Mobile


Message:
Submitter: Wu zheng <wu.zheng at intel.com>
Comments: Modify the condition of checking BT enabled
Git project: platform/core/connectivity/bluetooth-frwk
Tag: submit/tizen/20131120.024558
Commit: 341e1dff4e826ead1f1c0bbae5d640952ebff864 Modify the condition of checking BT enabled

State:   new        2013-11-20T02:37:13 tizenrobot
Comment: <no comment>
changes files:
--------------

spec files:
-----------
--- bluetooth-frwk.spec
+++ bluetooth-frwk.spec
@@ -3,7 +3,7 @@
 %bcond_with multi_user
 
 Name:       bluetooth-frwk
-VCS:        platform/core/connectivity/bluetooth-frwk#bc74ee95e5a8a7d945688d82c7023ee914462ad9
+VCS:        platform/core/connectivity/bluetooth-frwk#341e1dff4e826ead1f1c0bbae5d640952ebff864
 Summary:    Bluetooth framework for BlueZ and Obexd
 Version:    0.2.55
 Release:    2

other changes:
--------------

++++++ bluetooth-frwk-0.2.55.tar.gz
--- bt-api/bt-adapter.c
+++ bt-api/bt-adapter.c
@@ -62,12 +62,21 @@
 
 BT_EXPORT_API int bluetooth_check_adapter(void)
 {
+#ifdef __TIZEN_MOBILE__
 	int ret;
 
 	ret = _bt_get_adapter_path(_bt_get_system_gconn(), NULL);
 
 	return ret == BLUETOOTH_ERROR_NONE ? BLUETOOTH_ADAPTER_ENABLED :
 						BLUETOOTH_ADAPTER_DISABLED;
+#else
+	gboolean powered;
+
+	powered = _bt_get_adapter_power(_bt_get_system_gconn());
+
+	return powered == TRUE ? BLUETOOTH_ADAPTER_ENABLED :
+						BLUETOOTH_ADAPTER_DISABLED;
+#endif
 }
 
 BT_EXPORT_API int bluetooth_enable_adapter(void)
--- bt-api/bt-common.c
+++ bt-api/bt-common.c
@@ -323,11 +323,44 @@
 	}
 
 	adapter_proxy = dbus_g_proxy_new_for_name(conn, BT_BLUEZ_NAME,
-				adapter_path, BT_ADAPTER_INTERFACE);
+				adapter_path, BT_PROPERTIES_INTERFACE);
 
 	return adapter_proxy;
 }
 
+gboolean _bt_get_adapter_power(DBusGConnection *conn)
+{
+	DBusGProxy *proxy = NULL;
+	gboolean powered;
+	GValue powered_v = { 0 };
+	GError *err = NULL;
+
+	BT_DBG("+");
+
+	proxy = _bt_get_adapter_proxy(conn);
+	retv_if(proxy == NULL, FALSE);
+
+	if (!dbus_g_proxy_call(proxy, "Get", &err,
+			G_TYPE_STRING, BT_ADAPTER_INTERFACE,
+			G_TYPE_STRING, "Powered",
+			G_TYPE_INVALID,
+			G_TYPE_VALUE, &powered_v,
+			G_TYPE_INVALID)) {
+		if (err != NULL) {
+			BT_ERR("Getting property failed: [%s]\n", err->message);
+			g_error_free(err);
+		}
+		return FALSE;
+	}
+
+	powered = (gboolean)g_value_get_boolean(&powered_v);
+
+	BT_DBG("powered = %d", powered);
+	BT_DBG("-");

Please refer to OBS webUI for more details about this SR.


More information about the Tizen-submit mailing list