Adapt device disconnect to BT HAL framework
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / oal-device-mgr.c
index 1ddacc9..df06cee 100755 (executable)
@@ -547,6 +547,26 @@ oal_status_t device_enable_gap_auth_notifications(oal_gap_auth_type_e type, gboo
 #endif
 }
 
+oal_status_t device_disconnect(bt_address_t * addr)
+{
+       int res;
+       bdstr_t bdstr;
+
+       CHECK_OAL_INITIALIZED();
+
+       OAL_CHECK_PARAMETER(addr, return);
+
+       API_TRACE("[%s]", bdt_bd2str(addr, &bdstr));
+
+       res = blued_api->device_disconnect((bt_bdaddr_t *)addr);
+       if (res != BT_STATUS_SUCCESS) {
+               BT_ERR("device_disconnect error: [%s]", status2string(res));
+               return convert_to_oal_status(res);
+       }
+
+       return OAL_STATUS_SUCCESS;
+}
+
 void cb_device_properties(bt_status_t status, bt_bdaddr_t *bd_addr,
                int num_properties, bt_property_t *properties)
 {
@@ -936,4 +956,5 @@ void cb_raw_rssi_received(bt_bdaddr_t *bd_addr, int32_t link_type, int32_t rssi)
                        ev, sizeof(event_dev_rssi_info_t), (bt_address_t*)bd_addr);
        BT_DBG("-");
 }
+
 #endif