我正在sms
使用带有 AT 命令的 jSSC 发送。下面是我的代码
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);
我的问题是,如果我删除Thread.sleep
语句,那么有时我不会收到sms
,有时如果我收到,我会收到短信文本本身的命令。
使用 at 命令的正确方法是什么?