TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Jeffrey Habets
from: Erik Huelsmann
date: 1997-01-22 09:21:32
subject: Monitoring data send/received on com-port

Replying to a message of Jeffrey Habets to PHIL PATTENGALE:

 JH> Hello PHIL!

 JH> Thursday, January 16 1997, PHIL PATTENGALE wrote to JEFFREY HABETS:

 JH>  ->> I would like to monitor all incoming and/or outgoing data on the 
 JH> ->> serial port. Now, that wouldn't be to difficult if my program was

 PP>> Well, if you don't wanna re-invent the wheel,

 JH> I want to.. :)

 PP>> I'd suggest you look at Ray Gwinn's PMLM (Poor Man's Line Monitor)
 PP>> which is included with his SIO package.  This displays all the chars
 PP>> going in and out of a port, as well as tracking line signals being
 PP>> raised & lowered.  Handy program.

 JH> I know the PMLM does (among other things) what I want, and I think it
 JH> uses some undocumented hooks in SIO..

 JH> The problem is that I want to put some features like measuring
 JH> cps-rate and catching the dialed telephonenumber into a program I'm
 JH> working on. Thus third party software is out of the question.

 JH> Tracking the line signals is easy.. The big problem is 'peeking' at
 JH> incoming and outgoing data. I could do things from an IOPL segment
 JH> and read directly from the port, but than I _must_ pol the port at
 JH> least 3500 times/second if I want to be able to count the cps for a
 JH> 28k8 connection. I'll then probably need to use TIMER0.SYS for the
 JH> timing-issue. Quite a hassle.

 JH> I just wonder how DosRead() manages to block on a read from a port.
 JH> Seems to me it must be able to receive interrupts somehow.

It does (receive interrupts): DosRead sees what device you are reading from
and then dispatches a read-call to the device-driver that owns the device.
This way the device-driver gets to use what it decides is best to handle
IO. 

If you want to implement port monitoring, write your own COM.SYS driver
with some undocumented hooks in it. Let the COM.SYS-replacement keep track
of data received and report it trough some api.

 PP>> Course, if you wanna write your own, I can't help there.

 JH> To bad.. But thanks anyway.

 JH> Greetz from Maastricht/The Netherlands,
 JH> Jeffrey  >

Bye, Erik!
PGPkey available by e-mail/netmail

 *** I am slowly getting there, but Sibyl is getting me there faster :-)
 *** (Sibyl=a devellopment-tool) Q's? e-mail me at ErikH{at}hcc-gron.idn.nl

---
* Origin: ORIGINal (2:500/19.1929)
SEEN-BY: 50/99 54/99 270/101 620/243 625/110 160 711/401 413 430 808 934
SEEN-BY: 712/311 407 505 506 517 623 624 704 713/317 800/1
@PATH: 500/19 9 3 396/1 270/101 712/624 711/934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.