- /* Save the informations to invocation */
- _bt_save_invocation_context(context, result, sender,
- function_name,
- (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_char_prop_info_t)));
+ 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);
+
+ GUnixFDList *fd_list = NULL;
+ GError *error = NULL;
+
+ g_array_append_vals(*out_param1, &mtu, sizeof(int));
+ /* Add socket fd to unix_fd_list */
+ fd_list = g_unix_fd_list_new();
+ g_unix_fd_list_append(fd_list, fd, &error);
+ g_assert_no_error(error);
+ close(fd);
+ _bt_service_method_return_with_unix_fd_list(
+ context, *out_param1, result, fd_list);
+
+ g_object_unref(fd_list);
+ } else
+ goto normal;
+ } else {
+
+normal:
+ result = _bt_gatt_watch_characteristic(¶m , client_id, is_notify);
+ if (BLUETOOTH_ERROR_NONE == result) {
+ BT_INFO("GATT Client: Save Invocation data for characteristic props app[%s]", sender);
+
+ /* Save the informations to invocation */
+ _bt_save_invocation_context(context, result, sender, function_name,
+ (gpointer)g_memdup(¶m, sizeof(bluetooth_gatt_client_char_prop_info_t)));
+ }