projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Handle disappearing serial devices
[fw/altos]
/
aoview
/
aoview_serial.c
diff --git
a/aoview/aoview_serial.c
b/aoview/aoview_serial.c
index 5cb286f88a924c30fb656c32f379f75bf5b1870c..1721a28671d8a01ab7cd2d66cbd98be719cdf85b 100644
(file)
--- a/
aoview/aoview_serial.c
+++ b/
aoview/aoview_serial.c
@@
-191,6
+191,7
@@
serial_dispatch(GSource *source,
gpointer user_data)
{
struct aoview_serial *serial = (struct aoview_serial *) source;
gpointer user_data)
{
struct aoview_serial *serial = (struct aoview_serial *) source;
+ aoview_serial_callback func = (aoview_serial_callback) callback;
gint revents = serial->poll_fd.revents;
if (revents & G_IO_IN)
gint revents = serial->poll_fd.revents;
if (revents & G_IO_IN)
@@
-199,8
+200,8
@@
serial_dispatch(GSource *source,
if (revents & G_IO_OUT)
aoview_buf_flush(&serial->out_buf, serial->fd);
if (revents & G_IO_OUT)
aoview_buf_flush(&serial->out_buf, serial->fd);
- if (
callback && (revents & G_IO_IN)
)
- (*
callback)(user_data
);
+ if (
func
)
+ (*
func)(user_data, serial, revents
);
return TRUE;
}
return TRUE;
}
@@
-262,9
+263,9
@@
aoview_serial_close(struct aoview_serial *serial)
void
aoview_serial_set_callback(struct aoview_serial *serial,
void
aoview_serial_set_callback(struct aoview_serial *serial,
-
GSourceFunc
func,
+
aoview_serial_callback
func,
gpointer data,
GDestroyNotify notify)
{
gpointer data,
GDestroyNotify notify)
{
- g_source_set_callback(&serial->source, func, data, notify);
+ g_source_set_callback(&serial->source,
(GSourceFunc)
func, data, notify);
}
}