#endif
if (is_indicate == false) {
- result = _bt_gatt_acquire_notify(¶m , &fd, &mtu);
- if (BLUETOOTH_ERROR_NONE == result && fd > -1) {
- BT_DBG("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);
+ result = _bt_gatt_acquire_notify(¶m, &fd, &mtu);
+ if (result != BLUETOOTH_ERROR_NONE)
+ break;
- g_object_unref(fd_list);
- } else
- goto normal;
- } else {
+ BT_DBG("GATT Client: Save Invocation data for characteristic props app[%s] fd[ %d]", sender, fd);
-normal:
- result = _bt_gatt_watch_characteristic(¶m , client_id, is_notify);
+ 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 {
+ result = _bt_gatt_watch_characteristic(¶m, client_id, is_notify);
if (BLUETOOTH_ERROR_NONE == result) {
/* Save the informations to invocation */
_bt_save_invocation_context(context, result, sender, function_name,
- (gpointer)g_memdup2(¶m, sizeof(bluetooth_gatt_client_char_prop_info_t)));
+ (gpointer)g_memdup2(¶m, sizeof(bluetooth_gatt_client_char_prop_info_t)));
}
}
break;