www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/01/08/08:58:50

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-bounces using -f
Message-ID: <20020108135820.6101.qmail@web9102.mail.yahoo.com>
Date: Tue, 8 Jan 2002 05:58:20 -0800 (PST)
From: ROLAND <roland_asmann AT yahoo DOT com>
Subject: Re: PMCOM
To: djgpp AT delorie DOT com
Cc: alex AT compuweigh DOT com
In-Reply-To: <001501c197a0$49059a30$1400a8c0@alex>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

--- Alex Oleynikov <alex AT compuweigh DOT com> wrote:
> Here's a simple example of how to do this:
> 
> typedef  BOOL  unsigned char
> typedef BYTE  unsigned char
> 
> #define TRUE    1
> #define FALSE    0
> 
> #pragma check_stack (off)   //IMPORTANT! Make sure
> to put this macro before
> the Rx handler function's definition
> void RxHandler (int Event)
> {
>     BYTE CharRcvd;
> 
>     if( Event == evCOMRx )
>     {
>       if( COMReadChar(COM1, (char *)&CharRcvd, 0) !=
> 0)
>         return;
>     }
>     else
>       return;
> 
>     //Put your code here...
> 
>     return;
> }
> END_OF_FUNCTION(RxHandler);  //IMPORTANT! Make sure
> to put these lines at
> the end of the function's definition
> #pragma check_stack ()

Haven't tried this yet, but I don't really think this
is needed. What I need (after some research today) is
a way to make the COMReadBuffer to wait with the
reading until a message arrives... The error from
Windows was generated (I guess) because the program
kept on reading and reading from COM1.
On UNIX the program reads the port and when it is
empty it blocks until something is written to the
port.
Is there a way to do this??

> //Example of the com-port opening code
> BOOL OpenPort( void )
> {
>   if( COMPortOpen(COM1, 19200, 8, 'N', 1, 0,
> RxHandler) == 0 )
>     bPortOpen = TRUE;
>   else
>     bPortOpen = FALSE;
> 
>   return bPortOpen;
> }

This is not the problem, because I already had a
similar piece of code that opened the port, and that
did not give me an error before...
 
> Yes, I've got PMCOM v1.1 with some extras in it
> (e.g. flow control is
> working). I also did some fixes on the library code,
> so if you don't mind
> using it I can send you the sources and debug
> release (this is what I'am
> currently using myself).

I do not know if you have already tried to send it,
but if it is to big for this mailbox (max. 3MB),
please send it to roland DOT asmann AT nl DOT thalesgroup DOT com...
Thanks!

Roland


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019