#include "timestamp.h"
#include "misc.h"
-#if defined(__APPLE__)
+/* tty device listing configuration */
+
+#if defined(__linux__)
+#define PATH_SERIAL_DEVICES "/dev/serial/by-id/"
+#define PREFIX_TTY_DEVICES ""
+#elif defined(__FreeBSD__)
+#define PATH_SERIAL_DEVICES "/dev/"
+#define PREFIX_TTY_DEVICES "cua"
+#elif defined(__APPLE__)
#define PATH_SERIAL_DEVICES "/dev/"
#define PREFIX_TTY_DEVICES "tty."
#elif defined(__CYGWIN__)
#define PATH_SERIAL_DEVICES "/dev/"
#define PREFIX_TTY_DEVICES "ttyS"
-#else
-#define PATH_SERIAL_DEVICES "/dev/serial/by-id/"
+#elif defined(__HAIKU__)
+#define PATH_SERIAL_DEVICES "/dev/ports/"
#define PREFIX_TTY_DEVICES ""
+#else
+#define PATH_SERIAL_DEVICES "/dev/"
+#define PREFIX_TTY_DEVICES "tty"
#endif
#ifndef CMSPAR
};
bool interactive_mode = true;
+bool map_i_nl_cr = false;
+bool map_i_cr_nl = false;
+bool map_ign_cr = false;
static struct termios tio, tio_old, stdout_new, stdout_old, stdin_new, stdin_old;
static unsigned long rx_total = 0, tx_total = 0;
if (strcmp(token,"INLCR") == 0)
{
tio.c_iflag |= INLCR;
+ map_i_nl_cr = true;
}
else if (strcmp(token,"IGNCR") == 0)
{
tio.c_iflag |= IGNCR;
+ map_ign_cr = true;
}
else if (strcmp(token,"ICRNL") == 0)
{
tio.c_iflag |= ICRNL;
+ map_i_cr_nl = true;
}
else if (strcmp(token,"OCRNL") == 0)
{
if (option.response_wait)
{
- if ((input_char == '\r') || (input_char == '\n'))
+ if (input_char == '\n')
{
tty_sync(fd);
exit(EXIT_SUCCESS);