Hello
Thanks for the information
Now I can get characters from the interrupt handler and that's fine
But something strange happened after the return of the SIGIO handler.. the
current process go into sleep mode
I think this happened because the interruption occured during a system call (I
use a select call in my code and this one return EINTR)
Perhaps can you tell me how to execute the system call again???
here is the handler init code
saio.sa_handler = GLComSerialHdlr;
//saio.sa_mask = 0; ?????
saio.sa_flags = 0;
saio.sa_restorer = NULL;
sigaction(SIGIO,&saio,NULL);
fcntl(serialportfd, F_SETOWN, getpid());
fcntl(this_mgw_ctrl->serialportfd, F_SETFL, FASYNC);
tcgetattr(this_mgw_ctrl->serialportfd,&oldtio); /* save current port
settings */
newtio.c_cflag = BAUDRATE | CRTSCTS | CS8 | CLOCAL | CREAD;
newtio.c_iflag = IGNPAR | ICRNL; newtio.c_oflag = 0;
newtio.c_lflag = ICANON;
newtio.c_cc[VMIN] =1;
newtio.c_cc[VTIME] =0;
tcflush(this_mgw_ctrl->serialportfd, TCIFLUSH);
tcsetattr(this_mgw_ctrl->serialportfd,TCSANOW,&newtio);
and here is the select call
timeout.tv_sec=0;
timeout.tv_usec=UDP_LISTEN_TIMEOUT;
FD_SET(sockfd,&readfds);
inputs=readfds;
clilen=maxclilen;
result=select(FD_SETSIZE,&inputs,(fd_set *)0,(fd_set *)0,&timeout);
//<+++++ interrupt arrives here!!!
switch(result){
.....
Thanks
Fabien
To: klein fabien <[EMAIL PROTECTED]>
cc: Fabien Klein/Intl/Conexant
Subject: serial port reading process implementation (fwd)
Received from ........
Date: Tue, 29 Jun 1999 00:34:53 -0700 (PDT)
From: klein fabien <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: serial port reading process implementation
hi
Can someone help me to do(in the easiest way possible ) a thing like
this:
1.configure a serial port for a specific speed
2.wake up a process when data arrive
3.process read the buffer and sleep again
that's all
(Any source available???)
Fabien
[EMAIL PROTECTED]
I suggest you to refer the serial port driver code present under
/usr/src/linux/drivers/char/serial.c
This may throw some light on u'r doubts.
Also the baud rate settings,speed ..etc can be done in user space thru
ioctl calls.
Please write back if u want more details about the same.
regards
Surekha
----------------------------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]