if (otp_client_s->curr_op == BT_OTP_OBJECT_WRITE) {
_bt_otp_client_write_on_fd(otc_info);
} else if (otp_client_s->curr_op == BT_OTP_OBJECT_READ) {
+ bluetooth_otc_info_t *new_otc_info = g_malloc0(sizeof(bluetooth_otc_info_t));
+
+ new_otc_info->fd = otc_info->fd;
+ new_otc_info->connected = otc_info->connected;
+ new_otc_info->address = g_strdup(otc_info->address);
+
id = g_io_add_watch(data_io,
G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
- __client_data_received_cb, (gpointer)otc_info);
+ __client_data_received_cb, (gpointer)new_otc_info);
timeout_id = g_timeout_add(BT_OTC_CONNECTION_MAX_TIMEOUT,
- (GSourceFunc)__bt_otc_connection_timeout_cb, (gpointer)otc_info);
+ (GSourceFunc)__bt_otc_connection_timeout_cb, (gpointer)new_otc_info);
}
} else {
BT_DBG("OTC Disconnected");