0

I am sending sms using jSSC with AT commands. Below is my code

serialPort.writeBytes(("at+cmgf=1"+"\r\n").getBytes());

            Thread.sleep(3000);
            serialPort.writeBytes(("at+csca="+c+"+92300000042"+c+"\r\n").getBytes());
            Thread.sleep(3000);
            serialPort.writeBytes(("at+cmgs="+c+"03327172883"+c+"\r\n").getBytes());
            Thread.sleep(3000);
            serialPort.writeBytes(("hello"+control_z).getBytes());
            Thread.sleep(3000);

My problem is, if i remove Thread.sleep statements then sometimes i don't receive sms and sometimes if i receive, i receive at commands in sms text itself.

What is the proper way of doing it with at commands?

Usman Riaz
  • 2,920
  • 10
  • 43
  • 66

0 Answers0