Hi All,

Thanks for your response.

sorry (for bad subject).. i'll take care of that from next time.

The operating system im working on is SCO Unix, and the device(port) is 
/dev/tty1a

The code looks something like this.
         
        writeport($request); #writing connect request
        my(@READYFD) = $FD_SET->can_read(0);
        foreach $fd (@READYFD){
           print "Inside foreach : $fd";

           my $msg = readport($FD);#expecting "PAD:" characters
           if($msg eq $PAD){}      #ignoring those characters
           $msg = readport($FD);   #expecting "CC" call connect
           print "message is $msg ";
           print "call connect :$CallConnect";
           sleep(0.5);
           if(($fd == $FD) && ($msg eq $CallConnect)){
             print "inside call connect";
              $msg = readport($FD); #expecting XON before writing mesg
              if($msg eq $XON){
                 writemesg($port);
               }

like this goes on..
Actually i always a expect some message in response to the request i 
sent.finally i write actual message to the port.
 Above, after first read call, if the other end is not writing anything means, 
should return an empty string is it?? but it's returning the same characters, 
the first read call returns.. so should i have to flush the file descriptor 
before second read?? if so how to use it ?? i tried to make the situation 
understandable..Hope this is what you expected , to help in this regard.


Thanks.

               On Wed, 27 Apr 2005 Chris Devers wrote :
>Please use a descriptive subject line. Half the spam I get has "Hello"
>for a subject, so your message nearly got flagged as spam & deleted.
>
>On Wed, 27 Apr 2005, laxmi goudappa patil wrote:
>
> > Doing serial programming in perl. when i read a port, if there is data
> > on the port it reads successfully. if there is no data at that moment
> > im recieving the same data which hasn't written to the port..
> >
> > i have two parts of the program.. one is writing to the port, and the
> > other is reading from the port..can you please help, understanding why
> > it's happening like this?? and what can i do to overcome this
> > problem??
>
>What operating system are you working on? Windows? Linux? Other?
>
>What does your code look like? It's impossible to make suggestions
>without being able to read the section of code that isn't behaving.
>
>More information is needed in order to help you.
>
>
>
>--
>Chris Devers

Reply via email to