Adapt device disconnect to BT HAL framework
[platform/core/connectivity/bluetooth-frwk.git] / bt-oal / bluez_hal / src / bt-hal-bluetooth.c
index 489e2d1..fa31d3d 100644 (file)
@@ -385,6 +385,26 @@ static int enable_gap_auth_notifications(uint32_t type, uint8_t enable)
        _bt_hal_enable_gap_auth_notifications(type, ((enable == 0) ? FALSE : TRUE));
        return BT_STATUS_SUCCESS;
 }
+
+static int set_hal_adapter_request_state(int enable)
+{
+       DBG("");
+       _bt_hal_set_adapter_request_state(enable);
+       return BT_STATUS_SUCCESS;
+}
+
+static int set_hal_le_request_state(int enable)
+{
+       DBG("");
+       _bt_hal_set_le_request_state(enable);
+       return BT_STATUS_SUCCESS;
+}
+
+static int dev_disconnect(const bt_bdaddr_t *bd_addr)
+{
+       DBG("+");
+       return _bt_hal_device_disconnect(bd_addr);
+}
 #endif
 
 static const bt_interface_t bluetooth_if = {
@@ -444,6 +464,12 @@ static const bt_interface_t bluetooth_if = {
        .enable_rssi_monitoring = enable_rssi_monitoring,
        .get_connected_link_rssi_strength = get_connected_link_rssi_strength,
        .enable_gap_auth_notifications = enable_gap_auth_notifications,
+       .set_le_static_random_address = _bt_hal_set_le_static_random_address,
+       .set_hal_adapter_request_state = set_hal_adapter_request_state,
+       .set_hal_le_request_state = set_hal_le_request_state,
+       .adapter_le_set_white_list = _bt_hal_adapter_le_set_white_list,
+       .adapter_le_set_privacy = _bt_hal_adapter_le_set_privacy,
+       .device_disconnect = dev_disconnect,
 #endif
 };
 
@@ -464,7 +490,7 @@ static int close_bluetooth(struct hw_device_t *device)
 static int open_bluetooth(const struct hw_module_t *module, char const *name,
                struct hw_device_t **device)
 {
-       bluetooth_device_t *dev = malloc(sizeof(bluetooth_device_t));
+       bluetooth_device_t *dev = g_malloc0(sizeof(bluetooth_device_t));
 
        DBG("");