Remove wrong dependency in the systemd service file
[platform/core/connectivity/bluetooth-frwk.git] / bt-api / bt-adapter-le.c
index 989d2d4..8554da0 100644 (file)
@@ -33,7 +33,7 @@ BT_EXPORT_API int bluetooth_check_adapter_le(void)
        int ret;
        int value;
 
-       ret = _bt_get_adapter_path(_bt_gdbus_get_system_gconn(), NULL);
+       ret = _bt_get_adapter_path(_bt_get_system_private_conn(), NULL);
 
        if (ret != BLUETOOTH_ERROR_NONE)
                return BLUETOOTH_ADAPTER_LE_DISABLED;
@@ -127,8 +127,7 @@ BT_EXPORT_API int bluetooth_stop_le_discovery(void)
 
        BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
-       if (result == BLUETOOTH_ERROR_NONE)
-               _bt_set_le_scan_status(FALSE);
+       _bt_set_le_scan_status(FALSE);
 
        return result;
 }
@@ -709,3 +708,53 @@ BT_EXPORT_API int bluetooth_le_set_data_length(bluetooth_device_address_t *addre
 
        return result;
 }
+
+BT_EXPORT_API int bluetooth_is_le_2m_phy_supported(gboolean *is_supported)
+{
+       int result;
+
+       BT_CHECK_PARAMETER(is_supported, return);
+       BT_CHECK_ENABLED_ANY(return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_LE_2M_PHY_SUPPORTED,
+                       in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       if (result == BLUETOOTH_ERROR_NONE) {
+               *is_supported = g_array_index(out_param, int, 0);
+       } else {
+               BT_ERR("Fail to send request");
+       }
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       BT_INFO("LE 2M PHY Support[%s]", *is_supported ? "TRUE" : "FALSE");
+       return result;
+}
+
+BT_EXPORT_API int bluetooth_is_le_coded_phy_supported(gboolean *is_supported)
+{
+       int result;
+
+       BT_CHECK_PARAMETER(is_supported, return);
+       BT_CHECK_ENABLED_ANY(return);
+
+       BT_INIT_PARAMS();
+       BT_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       result = _bt_send_request(BT_BLUEZ_SERVICE, BT_IS_LE_CODED_PHY_SUPPORTED,
+                       in_param1, in_param2, in_param3, in_param4, &out_param);
+
+       if (result == BLUETOOTH_ERROR_NONE) {
+               *is_supported = g_array_index(out_param, int, 0);
+       } else {
+               BT_ERR("Fail to send request");
+       }
+
+       BT_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
+
+       BT_INFO("LE CODED PHY Support[%s]", *is_supported ? "TRUE" : "FALSE");
+       return result;
+}