0
我有一個TC65調制解調器,我無法從任何地方獲得幫助。我想問一下如何使用Java來執行AT命令。程序編寫完成後,它將被上傳到調制解調器,並可以獨立運行。我想用Java編寫一個使用AT命令發送SMS的代碼。使用Java和AT命令發送短信
任何人都可以幫助我嗎?我怎麼會寫這在Java中:
數= + XXXXXXXXXX
AT + CMGS =人數/輸入
(消息)/輸入
我要上傳這個程序,我的GSM調制解調器,以便在上電時發送短信。
package example.helloworld;
import javax.microedition.midlet.*;
/**
* MIDlet with some simple text output
*/
public class HelloWorld extends MIDlet {
/**
* Default constructor
*/
public HelloWorld() {
System.out.println("Welcome");
}
/**
* This is the main application entry point. Here we simply give some
* text output and close the application immediately again.
*/
public void startApp() throws MIDletStateChangeException {
System.out.println("startApp");
System.out.println("\nHello World\n");
destroyApp(true);
}
/**
* Called when the application has to be temporary paused.
*/
public void pauseApp() {
System.out.println("pauseApp()");
}
/**
* Called when the application is destroyed. Here we must clean
* up everything not handled by the garbage collector.
* In this case there is nothing to clean.
*/
public void destroyApp(boolean cond) {
System.out.println("destroyApp(" + cond + ")");
notifyDestroyed();
}
}
謝謝。
定義「使用Java語言編寫本」,你的意思爲'String'或流?還是其他什麼東西?另外,告訴我們你已經嘗試了什麼。 – Jeffrey 2012-03-10 17:40:05
已編輯的問題。 – 2012-03-11 15:03:10
我在哪裏添加它,以及如何告訴它執行AT命令?任何幫助,將不勝感激。 – 2012-03-11 15:06:44