trance_creator
asked on
Intercept serial port communication
Hi,
Because I want to understand the protocol in which an application "talks" to external hardware, I need to have a program which intercepts the "talking" and dumps it to a file.
The program must sit and wait until another program writes or retrieves data to or from the COM1: port (it has to run on a Windows 2000 machine).
Is this possible in VISUAL C++ (or in any way at all?). If such a program already exists, please say where I can get it!
Thnx in advance,
Bart van der Vliet
trance_creator@zonnet.nl
Because I want to understand the protocol in which an application "talks" to external hardware, I need to have a program which intercepts the "talking" and dumps it to a file.
The program must sit and wait until another program writes or retrieves data to or from the COM1: port (it has to run on a Windows 2000 machine).
Is this possible in VISUAL C++ (or in any way at all?). If such a program already exists, please say where I can get it!
Thnx in advance,
Bart van der Vliet
trance_creator@zonnet.nl
You have to use following APIs CreateFile & ReadFile to Read from ComPort.
Do you only want to Read from it?
Do you only want to Read from it?
>>You have to use following APIs CreateFile & ReadFile to
>>Read from ComPort.
But these APIs don't allow to intercept an ongoing communication...
>>Read from ComPort.
But these APIs don't allow to intercept an ongoing communication...
oh yes, thats right
okay, want to know what i did?
i had to monitor the communication over COM1 Port.
I made a patch-cable that was 1:1:1, that means APLLICATION - COM1 - COM2
over COM1 i communicated with the APPLICATION and on COM2 i watched what's happening. I think that's a very easy and fast way to do that...
U can watch COM2 with a normal Terminal-Program like Windows Hyper Terminal...
okay, want to know what i did?
i had to monitor the communication over COM1 Port.
I made a patch-cable that was 1:1:1, that means APLLICATION - COM1 - COM2
over COM1 i communicated with the APPLICATION and on COM2 i watched what's happening. I think that's a very easy and fast way to do that...
U can watch COM2 with a normal Terminal-Program like Windows Hyper Terminal...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
that's maybe right...but you're a little restricted with that application...
but anyway, maybe it's enough for trance_creator...
grEEz RideOn
but anyway, maybe it's enough for trance_creator...
grEEz RideOn
ASKER
The program is exactly what I need! Thanks a lot!!!
TTYL,
Bart van der Vliet
TTYL,
Bart van der Vliet
You can always do that usina API hooking - see http://research.microsoft.com/sn/detours/ and http://msdn.microsoft.com/msdnmag/issues/1000/vtrace/VTrace.asp on this issue.
BTW: A great tool that already does what you want to is http://www.sysinternals.com/ntw2k/freeware/portmon.shtml