getc() hangs with COM ports
- Posted by Andy Drummond <kestrelandy at xalt.co.uk> May 04, 2001
- 477 views
I'm still trying to get something that will drive COM ports - without trashing the port for all future use by Windows or DOS as my current system does. If I fn=open("COM1","ub") then I can write to the port nicely with wprintf(). But calling getc(fn) then it should (apparently) return -1 if there's nothing there, but it always hangs around waiting and doesn't return if the port is quiet. Which doesn't help time out loss of data too much. get_bytes() does the same. Does anyone know a way to use this method of reading the port without the thing hanging? Oh, and by the way, does anyone know what's happened to Judith Evans? Her email address is disabled, so it tells me. Andy