猫池二次开发错误,求高人指点。

lianxiang_64006777 lianxiang_64006777 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
0 [Thread-1] WARN org.smslib - GTW: 短信猫: Cannot understand SIMPIN response: ERROR
, will wait for a while...
运行发短信程序出这样的错误
源码:
Service srv;
OutboundMessage msg;
OutboundNotification outboundNotification = new OutboundNotification();
System.out.println("Example: Send message from a serial gsm modem.");
System.out.println(Library.getLibraryDescription());
System.out.println("Version: " + Library.getLibraryVersion());
srv = new Service();

SerialModemGateway gateway = new SerialModemGateway("短信猫", "COM3", 9600, "Wavecom", "M1306B");//115200是波特率,一般为9600。可以通过超级终端测试出来
gateway.setInbound(true);
gateway.setOutbound(true);
gateway.setSimPin("0000");
gateway.setOutboundNotification(outboundNotification);
srv.addGateway(gateway);
srv.startService();----运行到这句出上面的错误。
System.out.println("Modem Information:");
System.out.println(" Manufacturer: " + gateway.getManufacturer());
System.out.println(" Model: " + gateway.getModel());
System.out.println(" Serial No: " + gateway.getSerialNo());
System.out.println(" SIM IMSI: " + gateway.getImsi());
System.out.println(" Signal Level: " + gateway.getSignalLevel() + "%");
System.out.println(" Battery Level: " + gateway.getBatteryLevel() + "%");
System.out.println();
// Send a message synchronously.

msg = new OutboundMessage(phone, content);
msg.setEncoding(MessageEncodings.ENCUCS2);//这句话是发中文短信必须的
srv.sendMessage(msg);

System.out.println("Now Sleeping - Hit <enter> to terminate.");
srv.stopService();
System.out.println("over le");
...全文
评论 9
收藏 已收藏
分享
返回顶部
lianxiang_64006777
J2ME 13,096 成员 26,491 内容