Not yet working stack checking (symbol STACKCHECK)
+debugging messages
+#ifdef DEBUG
+ fprintf(stdout,_("Serial port speed setting: tcgetattr()...\n"));
+#endif /* DEBUG */
tcgetattr(__fd, &t);
// This is not needed! We set up the speed via cfsetspeed
// t.c_cflag &= ~CBAUD;
// t.c_cflag |= speed;
#ifdef DEBUG
tcgetattr(__fd, &t);
// This is not needed! We set up the speed via cfsetspeed
// t.c_cflag &= ~CBAUD;
// t.c_cflag |= speed;
#ifdef DEBUG
+ fprintf(stdout,_("Serial port speed setting: cfsetspeed()...\n"));
+#endif /* DEBUG */
+#ifdef DEBUG
if (cfsetspeed(&t, speed) == -1)
fprintf(stdout,_("Serial port speed setting failed\n"));
#else
(void)cfsetspeed(&t, speed);
#endif
if (cfsetspeed(&t, speed) == -1)
fprintf(stdout,_("Serial port speed setting failed\n"));
#else
(void)cfsetspeed(&t, speed);
#endif
- tcsetattr(__fd, TCSADRAIN, &t);
+#ifdef DEBUG
+ fprintf(stdout,_("Serial port speed setting: tcsetattr()...\n"));
+#endif /* DEBUG */
+ tcsetattr(__fd, TCSANOW, &t);
#else
ioctl(__fd, TIOCGETP, &t);
#else
ioctl(__fd, TIOCGETP, &t);
ioctl(__fd, TIOCSETN, &t);
#endif
ioctl(__fd, TIOCSETN, &t);
#endif
+#ifdef DEBUG
+ fprintf(stdout,_("Serial port speed setting done\n"));
+#endif /* DEBUG */
}
/* Read from serial device. */
size_t serial_read(int __fd, __ptr_t __buf, size_t __nbytes) {
}
/* Read from serial device. */
size_t serial_read(int __fd, __ptr_t __buf, size_t __nbytes) {
return (read(__fd, __buf, __nbytes));
}
return (read(__fd, __buf, __nbytes));
}
size_t serial_write(int __fd, __const __ptr_t __buf, size_t __n) {
size_t serial_write(int __fd, __const __ptr_t __buf, size_t __n) {
return (write(__fd, __buf, __n));
}
return (write(__fd, __buf, __n));
}