channel = g_io_channel_unix_new(fd);
g_io_channel_set_encoding(channel, NULL, NULL);
g_io_channel_set_buffered(channel, FALSE);
- g_io_channel_set_close_on_unref(channel, TRUE);
+ g_io_channel_set_close_on_unref(channel, FALSE);
g_io_channel_set_flags(channel, G_IO_FLAG_NONBLOCK, NULL);
g_io_add_watch(channel, (G_IO_IN | G_IO_ERR | G_IO_HUP),
bluetooth_gatt_client_notify_channel_watch_cb, chr_info);
bt_gatt_handle_property_t *service_handle,
bt_gatt_handle_property_t *char_handle,
int client_id,
- gboolean is_notify)
+ gboolean is_notify,
+ gboolean is_indicate)
{
int result = BLUETOOTH_ERROR_NONE;
bluetooth_gatt_client_char_prop_info_t param;
BT_CHECK_PARAMETER(char_handle, return);
chr_info = bluetooth_gatt_client_get_characteristic_notify_info(char_handle->uuid , char_handle->instance_id);
- if (chr_info) {
+ if (chr_info && !is_notify) {
BT_INFO("Already CCCD enabled. fd %d", chr_info->notify_fd);
- if (!is_notify)
- close(chr_info->notify_fd);
-
- return result;
+ close(chr_info->notify_fd);
+ return result;
}
/* ASync Function, result expected in callback from bt-service */
g_array_append_vals(in_param1, ¶m, sizeof(bluetooth_gatt_client_char_prop_info_t));
g_array_append_vals(in_param2, &client_id, sizeof(int));
g_array_append_vals(in_param3, &is_notify, sizeof(gboolean));
+ g_array_append_vals(in_param4, &is_indicate, sizeof(gboolean));
GUnixFDList *out_fd_list = NULL;
gboolean is_notify;
int fd = -1;
int mtu = 0;
+ gboolean is_indicate;
memset(¶m, 0x00, sizeof(bluetooth_gatt_client_char_prop_info_t));
sizeof(int));
__bt_service_get_parameters(in_param3, &is_notify,
sizeof(gboolean));
+ __bt_service_get_parameters(in_param4, &is_indicate,
+ sizeof(gboolean));
-
- if (is_notify == true) {
+ if (is_indicate == false) {
result = _bt_gatt_acquire_notify(¶m , &fd, &mtu);
if (BLUETOOTH_ERROR_NONE == result && fd > -1) {
BT_INFO("GATT Client: Save Invocation data for characteristic props app[%s] fd[ %d]", sender, fd);
gboolean enable);
int bluetooth_gatt_client_watch_characteristics(
- const char *address,
- bt_gatt_handle_property_t *service_handle,
- bt_gatt_handle_property_t *char_handle,
- int client_id,
- gboolean is_notify);
+ const char *address,
+ bt_gatt_handle_property_t *service_handle,
+ bt_gatt_handle_property_t *char_handle,
+ int client_id,
+ gboolean is_notify,
+ gboolean is_indicate);
#ifdef __cplusplus
}