Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to read the entire data from serial port.

chaitanya karthikk
Ranch Hand
Posts: 806
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers, I am Chaitanya, I am working on a GSM based application. The aim is to send message to a mobile from computer. Some user will send a message to my SIM, the SIM is placed in a GSM modem. My java program will alert me on receiving a message. Then I will issue a command to read the first message.

The command goes like this. AT+CMGR=1. In return the message content is delivered by the modem to the serial port. Now my data is on the serial port.

I am using serialPort.getInputStream() and assigning it to an InputStream.

The problem is sometimes I am receiving the entire message content, other times, a part of the message is being read. How to read the data. Is there any efficient way?

Shall I place a sample code? Thanks in advance. Have a nice day.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic