From: Daniel Kahlin (tlr_at_stacken.kth.se)
Date: 2004-01-24 10:11:38
On Fri, 23 Jan 2004, Marko Mäkelä wrote: > Hi all, > > Today, I spent some time debugging a development version of c2nload, > the 38400 bps auto-starting fastloader for the C2N232 adapter. The > program displays a progress meter. It has to be implemented differently > for each major platform: > > - On POSIX termios, I set up alarm(2) and catch SIGALRM. The write(2) > system call will be interrupted after the predetermined timeout, and > it will report the number of bytes sent until the interrupt. > > - On Win32, a write timeout is specified with the SetCommParams function. > > - On AmigaOS, I haven't figured out a solution. When a CMD_READ > operation is aborted, the field io_Actual reports the number of bytes > read so far. However, with CMD_WRITE, no matter if I do AbortIO and > WaitIO, or CheckIO, or nothing, the field remains zero. Is there a > solution? I tried Google, but didn't find any applicable code. I don't really remember much of the Amiga specific detail, but in over5 (0.711), I seem to ignore data read in blocks that got timeout. I attached the file bl_serial.c which is the Amiga serial-drivers for over5, originally based on Olaf Barthel's 'Term' code. The routing SerRead() does reading with timeout. I don't use the size when getting a timeout, but perhaps it works if you add it. There might be differences in our approaches that make it work, have a look. Regards /Daniel Message was sent through the cbm-hackers mailing list
Archive generated by hypermail pre-2.1.8.