void
aoview_serial_set_callback(struct aoview_serial *serial,
- aoview_serial_callback func,
- gpointer data,
- GDestroyNotify notify);
+ aoview_serial_callback func);
void
aoview_serial_printf(struct aoview_serial *serial, char *format, ...);
serial = aoview_serial_open(device);
if (!serial)
return FALSE;
- aoview_serial_set_callback(serial, aoview_eeprom_callback, serial, NULL);
+ aoview_serial_set_callback(serial, aoview_eeprom_callback);
aoview_serial_printf(serial, "v\nl\n");
return TRUE;
}
aoview_table_clear();
aoview_state_reset();
aoview_serial_set_callback(monitor_serial,
- aoview_monitor_callback,
- monitor_serial,
- NULL);
+ aoview_monitor_callback);
return TRUE;
}
serial->poll_fd.events = G_IO_IN | G_IO_OUT | G_IO_HUP | G_IO_ERR;
g_source_attach(&serial->source, NULL);
g_source_add_poll(&serial->source,&serial->poll_fd);
+ aoview_serial_set_callback(serial, NULL);
return serial;
}
aoview_serial_close(struct aoview_serial *serial)
{
g_source_remove_poll(&serial->source, &serial->poll_fd);
+ close(serial->fd);
g_source_destroy(&serial->source);
- g_source_unref(&serial->source);
- free(serial);
}
void
aoview_serial_set_callback(struct aoview_serial *serial,
- aoview_serial_callback func,
- gpointer data,
- GDestroyNotify notify)
+ aoview_serial_callback func)
{
- g_source_set_callback(&serial->source, (GSourceFunc) func, data, notify);
+ g_source_set_callback(&serial->source, (GSourceFunc) func, serial, NULL);
}