Mail Archives: djgpp/2002/01/07/10:39:15
Roland wrote:
> Everything is working correct, but the program just
> crashes after X times of reading the RX-buffer.
> The thing my program does, is send data over the
> COM-port and then read it for a ACK/NACK package.
> It waits with sending a new package until an ACK/NACK
> has been received.
> When I do not connect the two devices to each other,
> the program would have to run forever (or so I
> thought), but for some reason it crashes after having
> read de RX buffer X times...
> The stranged thing is that X is not always the same
> number, but differs from one run to another...
> Does anybody know where this problem could be coming
> from?
> Or is it just impossible to read the RX-buffer over
> and over again while it's empty??
Hi,
I am also using PMCOM library and have gone thru many different situations.
There are couple of things I would like to suggest you:
1.Instead of constant polling for content of RX buffer register a
user-defined handler when opening the COM-port. This way PMCOM library will
call your routine every time something came to the COM-port (make sure to
check that your handler was invoked in response to the receiving event and
not sending or timer events, since this handler may be also registered for
timer operations).
2.Look at your crash dump and see where the termination occurs. It is
possible, that you are working with debug release of PMCOM and it has a lot
of
assert( ) calls throughout the code to check for different conditions.
For example, you are trying to read from a closed COM-port etc.
Also, what version of PMCOM library are you using?
Good luck!
Alex
- Raw text -