Perhaps you wish to StrCopy(InBuff, strRBuff) instead?

        I would not personally use StrCopy, as this will copy all characters
up until the terminating NULL, which
        will not always exist after the single character you wait for.

        Try an algorithm similar to this:

        // bigBuf is a large buffer used to examine complete messages.
        // You may receive a few bytes of a message at a time, taking
several calls to 
        // receive the complete message.  This means you have to build the
complete message
        // elsewhere, such as bigBuf.  Checking bigBuf for completeness in
your case, would
        // be to scan for a NUL character indicating a complete string
exists.
        // Extract the string, and carry on receiving data

        while (running)
        {
            err = SerReceiveCheck(ref, &bytesToRead)
            // check err
            if (bytesToRead) 
            {
                bytesRead = SerReceive(ref, myBuf, bytesToRead, 0, &err)
                // check err
                if (bytesRead)
                {
                    // append the new data onto the end of the data received
so far
                    MemMove(&bigBuf[bigBufSize], myBuf, bytesRead)
                }
            }
        }

> -----Original Message-----
> From: Patrick Ouellet [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, 6 October 2000 08:50
> To:   Palm Developer Forum
> Subject:      Serial Weirdness
> 
> Ok Im doing this to receive a couple of string via Serial Modem
> connection
> 
> do
>  {
>   RecepErr = SerReceiveWait(NumRef, 1, -1);
>   switch(RecepErr)
>   {
>    case 0:
>    {
>     StrCopy(strRBuff, InBuff);
>     ScanComm(InBuff);
>     break;
>    }
>    case serErrTimeOut:
>    {
>     return false;
>     break;
>    }
>    case serErrLineErr:
>    {
>     return false;
>     break;
>    }
>   }
>  }
>  while(TransmissionEnd == false);
> 
> But what I receive is far from what I send...
> Does someone see a problem with the code above ?
> 
> What I send:
> "UserName:Patrick Ouellet"<CR><LF>
> 
> What I receive ( when I display it using FrmCopyLabel )
> �R�R�R�R�R�R�R�r
> Till I get a Fatal exception (assuming that I hit the capacity limit of
> my string... Be cause I
> loop until I find a <CR><LF> in the receiving buffer)
> 
> --
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Patrick Ouellet - Programmeur
> [EMAIL PROTECTED]
> Recherche & Devloppement
> Les Entreprise Microtec inc.
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> 
> 
> 
> -- 
> For information on using the Palm Developer Forums, or to unsubscribe,
> please see http://www.palmos.com/dev/tech/support/forums/
> 

--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to