testcomm.java
来自「jsmsengine 1.1 用于手机开发SMS短信接受发送的开源包」· Java 代码 · 共 29 行
JAVA
29 行
package dk.daimi.jones.app.smsdemo;
import dk.daimi.jones.services.sms.*;
import dk.daimi.jones.impl.sms.*;
/**
* @author Jonas Thomsen
*
* Testing communication with the mobile phone. Displays all communication
* on the screen.
* Ends up with saying successful or FAILED!
*/
public class TestComm {
public static void main(String[] args) {
// Show a lot of debugging information on the screen.
// Displays all serial communication with the phone.
dk.daimi.jones.debug.Debugger.getDebugger().enableDebug();
SMS sms = new SMSImpl();
System.out.println("Testing SMS service...");
if (((SMSImpl)sms).open("COM1", "")) {
System.out.println("SMS service test was succesful!");
} else {
System.out.println("SMS service test FAILED!");
}
((SMSImpl)sms).close();
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?