Change-Id: I8b870f29ec3c71d6a0b75e915307b76e57d33ad7
Signed-off-by: Amit Purwar <amit.purwar@samsung.com>
BT_INFO("GATT Server: Notification Enabled?? Handle: [%d] address [%s] Is Enabled [%d] result [%d]",
info.handle, address, info.notification, result);
BT_INFO("GATT Server: Notification Enabled?? Handle: [%d] address [%s] Is Enabled [%d] result [%d]",
info.handle, address, info.notification, result);
+ if (info.notification == FALSE)
+ cleanup_gatt_acquire_fd(info.handle);
+
_bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED,
result, &info,
event_info->cb, event_info->user_data);
_bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED,
result, &info,
event_info->cb, event_info->user_data);
+ BT_INFO("setting up g_io channel");
channel = g_io_channel_unix_new(fd);
g_io_channel_set_encoding(channel, NULL, NULL);
g_io_channel_set_buffered(channel, FALSE);
channel = g_io_channel_unix_new(fd);
g_io_channel_set_encoding(channel, NULL, NULL);
g_io_channel_set_buffered(channel, FALSE);
dev_address.addr,
BLUETOOTH_ADDRESS_LENGTH);
info.handle = att_han;
dev_address.addr,
BLUETOOTH_ADDRESS_LENGTH);
info.handle = att_han;
+ info.notification = TRUE;
_bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED,
result, &info,
_bt_gatt_server_event_cb(BLUETOOTH_EVENT_GATT_SERVER_NOTIFICATION_STATE_CHANGED,
result, &info,
+
+void cleanup_gatt_acquire_fd(int handle)
+{
+ bluetooth_gatt_acquire_notify_info_t *chr_info = NULL;
+
+ BT_INFO("+");
+
+ chr_info = bluetooth_get_characteristic_info_from_path(handle);
+
+ if (chr_info != NULL) {
+ BT_INFO("GATT Server: acquire notification char info found");
+
+ if (chr_info->write_fd >= 0) {
+ BT_INFO("closing fd");
+ close(chr_info->write_fd);
+ }
+ }
+}
void bluetooth_gatt_server_send_acquire_notify_response(GVariant * parameter, bt_event_info_t *event_info);
void bluetooth_gatt_server_send_acquire_notify_response(GVariant * parameter, bt_event_info_t *event_info);
+void cleanup_gatt_acquire_fd(int handle);
+
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
#ifdef __cplusplus
}
#endif /* __cplusplus */