Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Response from modem dissapeared

 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a gsm modem program which sends commands to the modem and i have been receving ok response for 'AT' command.
But the next day when i again started the program I began receiving <space> as the response for many events that i fire eg. If i make a call on that no. even then i receive <space> as the response, on firing AT i get <space> as response.
But when i use HyperTerminal for the same commands i receive the appropriate responses.

For reading response what i am doing is getting the inputstream and then using the bufferedreader to read the stream till the stream is != null.

Thanks
 
Prakash Subramanian
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Verify whether it is actually a bug related to your Java code.

InputStream and BufferedReader, they do not match. Is it a typo? Maybe you can post only the relevant code snippet.

Should you not be checking for -1 for end of stream detection? What do you mean by stream != null?
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know there is a bug in my code. But where

inputStream is serial port's input stream object which contains the responses.



I have been using the combination of inputstreamreader and bufferedreader for long time with no problems. Is this the problem??

Thanks
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody has a solution for this minor stuff...???
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's some example code here. If you search in the I/O and Streams forum (where this post should really be) you might find some other useful stuff.
 
robin singal
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Neal...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!