#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
+#ifndef _WIN32
#include <termios.h>
+#endif
#include <string.h>
#include <sys/time.h>
#include <inttypes.h>
+#ifdef _WIN32
+/* TODO */
+#else
#include <arpa/inet.h>
+#endif
#include <glib.h>
#include <sigrok.h>
* respond with g_poll().
*/
g_message("probing %s...", (char *)l->data);
+#ifdef _WIN32
+ // FIXME
+ // hdl = serial_open(l->data, 0);
+#else
fd = serial_open(l->data, O_RDWR | O_NONBLOCK);
+#endif
if (fd != -1) {
serial_params[devcnt] = serial_backup_params(fd);
serial_set_params(fd, 115200, 8, 0, 1, 2);
flag_reg &= ~FLAG_DEMUX;
divider = (CLOCK_RATE / samplerate) - 1;
}
+#ifdef _WIN32
+ // FIXME
+ // divider = htonl(divider);
+#else
divider = htonl(divider);
+#endif
g_message("setting samplerate to %" PRIu64 " Hz (divider %u, demux %s)",
samplerate, divider, flag_reg & FLAG_DEMUX ? "on" : "off");
* This is the main loop telling us a timeout was reached, or
* we've acquired all the samples we asked for -- we're done.
*/
+#ifndef _WIN32
+ /* TODO: Move to serial.c? */
tcflush(fd, TCIOFLUSH);
+#endif
serial_close(fd);
packet.type = DF_END;
packet.length = 0;