[code:1]
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <termios.h>
#include <stdio.h>
#include <string.h>
#define LINESPEED B19200
int main (void)
{
int fd, res;
struct termios oldterm, newterm;
char buf='w';
fd= open ("/dev/ttyS2", O_RDWR | O_NOCTTY );
if (fd < 0) {
perror ("/dev/ttyS2");
exit (-1);
}
tcgetattr (fd, &oldterm);
bzero (&newterm, sizeof (newterm));