#include <string.h>
#include <sys/poll.h>
-#include <mono/metadata/object.h>
-#include <mono/metadata/appdomain.h>
-#include <mono/metadata/exception.h>
+#include <glib.h>
int
open_serial (char* devfile)
poll (&ufd, 1, timeout);
if ((ufd.revents & POLLIN) != POLLIN) {
- mono_raise_exception (mono_get_exception_io ("ReadTimeout exceeded"));
return -1;
}
poll (&ufd, 1, timeout);
if ((ufd.revents & POLLOUT) != POLLOUT) {
- mono_raise_exception (mono_get_exception_io ("WriteTimeout exceeded"));
return;
}
newtio.c_iflag &= ~IXOFF;
newtio.c_oflag &= ~IXON;
+#ifdef CRTSCTS
newtio.c_cflag &= ~CRTSCTS;
+#endif /* def CRTSCTS */
switch (handshake) {
case 0: /* None */
/* do nothing */
break;
case 1: /* RequestToSend (RTS) */
+#ifdef CRTSCTS
newtio.c_cflag |= CRTSCTS;
+#endif /* def CRTSCTS */
break;
case 2: /* RequestToSendXOnXOff (RTS + XON/XOFF) */
+#ifdef CRTSCTS
newtio.c_cflag |= CRTSCTS;
+#endif /* def CRTSCTS */
/* fall through */
case 3: /* XOnXOff */
newtio.c_iflag |= IXOFF;
return TRUE;
}
+/*
+ * mono internals should not be used here.
+ * this serial stuff needs to be implemented with icalls.
+ * make this at least compile until the code is moved elsewhere
+ * defined(linux) is wrong, too
+ */
+void*
+list_serial_devices (void)
+{
+ return NULL;
+}
+
+#if 0
MonoArray *
list_serial_devices (void)
{
return array;
}
+#endif
+