亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? readmessages.java

?? 發送短信 接收短信 多種接口com/net/modem 開發庫
?? JAVA
字號:
// ReadMessages.java - Sample application.
//
// This application shows you the basic procedure needed for reading
// SMS messages from your GSM modem, in synchronous mode.
//
// Operation description:
// The application setup the necessary objects and connects to the phone.
// As a first step, it reads all messages found in the phone.
// Then, it goes to sleep, allowing the asynchronous callback handlers to
// be called. Furthermore, for callback demonstration purposes, it responds
// to each received message with a "Got It!" reply.
//
// Tasks:
// 1) Setup Service object.
// 2) Setup one or more Gateway objects.
// 3) Attach Gateway objects to Service object.
// 4) Setup callback notifications.
// 5) Run

package examples.modem;

import java.util.ArrayList;
import java.util.List;
import javax.crypto.spec.SecretKeySpec;
import org.smslib.Contact;
import org.smslib.ICallNotification;
import org.smslib.IGatewayStatusNotification;
import org.smslib.IInboundMessageNotification;
import org.smslib.InboundMessage;
import org.smslib.Library;
import org.smslib.Phonebook;
import org.smslib.Service;
import org.smslib.AGateway.GatewayStatuses;
import org.smslib.AGateway.Protocols;
import org.smslib.InboundMessage.MessageClasses;
import org.smslib.Message.MessageTypes;
import org.smslib.crypto.AESKey;
import org.smslib.modem.SerialModemGateway;

public class ReadMessages
{
	Service srv;

	public void doIt() throws Exception
	{
		// Define a list which will hold the phonebook entries.
		Phonebook phonebook;

		// Define a list which will hold the read messages.
		List<InboundMessage> msgList;

		// Create the notification callback method for inbound & status report
		// messages.
		InboundNotification inboundNotification = new InboundNotification();

		// Create the notification callback method for inbound voice calls.
		CallNotification callNotification = new CallNotification();

		//Create the notification callback method for gateway statuses.
		GatewayStatusNotification statusNotification = new GatewayStatusNotification();

		try
		{
			System.out.println("Example: Read messages from a serial gsm modem.");
			System.out.println(Library.getLibraryDescription());
			System.out.println("Version: " + Library.getLibraryVersion());

			// Create new Service object - the parent of all and the main interface
			// to you.
			this.srv = new Service();

			// Create the Gateway representing the serial GSM modem.
			SerialModemGateway gateway = new SerialModemGateway("modem.com1", "COM1", 57600, "Nokia", "");

			// Set the modem protocol to PDU (alternative is TEXT). PDU is the default, anyway...
			gateway.setProtocol(Protocols.PDU);

			// Do we want the Gateway to be used for Inbound messages?
			gateway.setInbound(true);

			// Do we want the Gateway to be used for Outbound messages?
			gateway.setOutbound(true);

			// Let SMSLib know which is the SIM PIN.
			gateway.setSimPin("0000");

			// Set up the notification methods.
			this.srv.setInboundNotification(inboundNotification);
			this.srv.setCallNotification(callNotification);
			this.srv.setGatewayStatusNotification(statusNotification);

			// Add the Gateway to the Service object.
			this.srv.addGateway(gateway);

			// Similarly, you may define as many Gateway objects, representing
			// various GSM modems, add them in the Service object and control all of them.

			// Start! (i.e. connect to all defined Gateways)
			this.srv.startService();

			// Printout some general information about the modem.
			System.out.println();
			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();

			// In case you work with encrypted messages, its a good time to declare your keys.
			// Create a new AES Key with a known key value. 
			// Register it in KeyManager in order to keep it active. SMSLib will then automatically
			// encrypt / decrypt all messages send to / received from this number.
			srv.getKeyManager().registerKey("+306948494037", new AESKey(new SecretKeySpec("0011223344556677".getBytes(), "AES")));

			// Read Messages. The reading is done via the Service object and
			// affects all Gateway objects defined. This can also be more directed to a specific
			// Gateway - look the JavaDocs for information on the Service method calls.
			msgList = new ArrayList<InboundMessage>();
			this.srv.readMessages(msgList, MessageClasses.ALL);
			for (InboundMessage msg : msgList)
				System.out.println(msg);

/*
			// Read Phonebook.
			phonebook = new Phonebook();
			System.out.println("TOTAL PHONEBOOK ENTRIES = " + srv.readPhonebook(phonebook, gateway.getGatewayId()));
			// Print out all contacts retrieved.
			for (Contact entry : phonebook.getContacts())
				System.out.println(entry);
			// Print out contact stored on the SIM card.
			for (Contact entry : phonebook.getContacts(Contact.ContactLocation.SIM_ENTRIES))
				System.out.println(entry);
*/

			// Sleep now. Emulate real world situation and give a chance to the notifications
			// methods to be called in the event of message or voice call reception.
			
			System.out.println("Now Sleeping - Hit <enter> to stop service.");
			System.in.read(); System.in.read();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		finally
		{
			srv.stopService();
		}
	}

	public class InboundNotification implements IInboundMessageNotification
	{
		public void process(String gatewayId, MessageTypes msgType, InboundMessage msg)
		{
			if (msgType == MessageTypes.INBOUND) System.out.println(">>> New Inbound message detected from Gateway: " + gatewayId);
			else if (msgType == MessageTypes.STATUSREPORT) System.out.println(">>> New Inbound Status Report message detected from Gateway: " + gatewayId);
			System.out.println(msg);
			try
			{
				// Uncomment following line if you wish to delete the message upon arrival.
				// ReadMessages.this.srv.deleteMessage(msg);
			}
			catch (Exception e)
			{
				System.out.println("Oops!!! Something gone bad...");
				e.printStackTrace();
			}
		}
	}

	public class CallNotification implements ICallNotification
	{
		public void process(String gatewayId, String callerId)
		{
			System.out.println(">>> New call detected from Gateway: " + gatewayId + " : " + callerId);
		}
	}

	public class GatewayStatusNotification implements IGatewayStatusNotification
	{
		public void process(String gatewayId, GatewayStatuses oldStatus, GatewayStatuses newStatus)
		{
			System.out.println(">>> Gateway Status change for " + gatewayId + ", OLD: " + oldStatus + " -> NEW: " + newStatus);
		}
	}

	public static void main(String args[])
	{
		ReadMessages app = new ReadMessages();
		try
		{
			app.doIt();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久精品国产免费| 麻豆精品一区二区| 亚洲国产成人一区二区三区| 日韩欧美三级在线| 欧美精品一区二区高清在线观看 | 亚洲精品一区二区三区香蕉| 欧美一级片在线| 日韩免费一区二区三区在线播放| 欧美一级高清片在线观看| 欧美精品第1页| 欧美大片在线观看| 国产视频一区不卡| 国产精品福利一区| 亚洲一区二区在线观看视频| 亚洲妇女屁股眼交7| 强制捆绑调教一区二区| 狠狠色丁香久久婷婷综合丁香| 国产一区二三区好的| 成人久久18免费网站麻豆 | 久久精品国产999大香线蕉| 欧美aaa在线| 成熟亚洲日本毛茸茸凸凹| 91亚洲精品久久久蜜桃网站| 欧美午夜一区二区三区免费大片| 在线播放一区二区三区| 欧美精品一区二区三区蜜臀 | 亚洲欧美日韩国产一区二区三区| 亚洲国产综合人成综合网站| 美女视频免费一区| av午夜精品一区二区三区| 欧美日韩免费视频| 久久嫩草精品久久久久| 综合在线观看色| 日本三级亚洲精品| av亚洲产国偷v产偷v自拍| 7777精品伊人久久久大香线蕉完整版| 精品1区2区在线观看| 亚洲免费伊人电影| 激情亚洲综合在线| 欧美性极品少妇| 久久新电视剧免费观看| 亚洲一区二区影院| 国产成人精品免费网站| 欧美高清一级片在线| 亚洲欧洲日本在线| 激情欧美一区二区| 日本乱码高清不卡字幕| 久久久无码精品亚洲日韩按摩| 亚洲一区二区综合| 成人小视频免费在线观看| 91精品国产福利| 亚洲美女屁股眼交3| 国产sm精品调教视频网站| 91精品久久久久久久99蜜桃| 亚洲视频一区在线| 国产精品亚洲人在线观看| 91精品中文字幕一区二区三区| 综合久久一区二区三区| 国产.欧美.日韩| 日韩精品自拍偷拍| 日韩不卡在线观看日韩不卡视频| a在线播放不卡| 日本一区二区三区在线观看| 久久精品国内一区二区三区| 欧美日韩精品福利| 亚洲一区中文日韩| 在线精品视频一区二区三四| 中文字幕亚洲区| 国产99久久久精品| 国产精品欧美精品| 成人精品国产一区二区4080| 中文字幕乱码久久午夜不卡 | 91亚洲男人天堂| 亚洲婷婷综合色高清在线| www.在线欧美| 国产精品传媒入口麻豆| 成人网男人的天堂| 亚洲色图第一区| 色偷偷成人一区二区三区91| 亚洲特级片在线| 在线观看www91| 午夜久久久久久久久久一区二区| 国产色婷婷亚洲99精品小说| 精品在线观看免费| 久久综合视频网| 国产精品亚洲视频| 亚洲欧洲另类国产综合| 91麻豆精品在线观看| 亚洲一区二区三区四区五区中文 | 奇米精品一区二区三区在线观看一| 欧美伦理电影网| 国产在线精品免费av| 久久久久久久久97黄色工厂| 成人av在线资源网站| 亚洲毛片av在线| 9191国产精品| 成人中文字幕电影| 亚洲一区二区三区四区五区黄| 欧美一三区三区四区免费在线看| 精品一区精品二区高清| 欧美国产欧美综合| 欧美午夜精品一区二区蜜桃| 欧美a级理论片| 中文字幕一区二区不卡| 欧美日韩一区二区三区高清| 美女一区二区久久| 国产精品美女一区二区| 欧美视频一区在线| 激情国产一区二区| 亚洲黄色性网站| 精品国产不卡一区二区三区| 99久久久国产精品| 另类综合日韩欧美亚洲| 亚洲视频在线一区| 精品剧情v国产在线观看在线| 波多野结衣一区二区三区| 亚洲成av人在线观看| 久久精品日产第一区二区三区高清版| 91传媒视频在线播放| 国内偷窥港台综合视频在线播放| 亚洲免费电影在线| 国产欧美日韩精品一区| 91麻豆精品国产自产在线 | 国产精品主播直播| 亚洲超丰满肉感bbw| 中文在线资源观看网站视频免费不卡| 欧美日韩成人高清| 99精品国产视频| 国产一区二区不卡老阿姨| 婷婷丁香激情综合| 国产精品久久久久久久久快鸭| 欧美一区二区在线免费观看| 色婷婷久久综合| 99视频超级精品| 国产成人av自拍| 国产在线精品一区二区三区不卡 | 亚洲午夜久久久久久久久电影院| 国产日韩精品一区二区三区| 日韩欧美你懂的| 欧美一级片在线| 7777精品伊人久久久大香线蕉 | 成人ar影院免费观看视频| 卡一卡二国产精品| 日韩激情一区二区| 亚洲高清免费视频| 亚洲高清免费视频| 亚洲成人午夜影院| 偷拍日韩校园综合在线| 一区二区三区小说| 亚洲国产成人91porn| 亚洲高清视频在线| 三级久久三级久久| 亚洲成人免费在线观看| 亚洲亚洲精品在线观看| 亚洲一区二区在线观看视频| 亚洲在线一区二区三区| 亚洲一级不卡视频| 亚洲va国产天堂va久久en| 婷婷中文字幕一区三区| 婷婷一区二区三区| 久久国产精品一区二区| 国产一区二区91| 国产成人综合网| 色综合天天综合在线视频| 在线视频一区二区三| 欧美日韩国产另类一区| 欧美一区二区高清| 久久久久国产精品厨房| 中文字幕在线观看不卡| 亚洲精品亚洲人成人网| 亚洲gay无套男同| 日韩精品亚洲一区| 精品无码三级在线观看视频| 国产福利精品一区| 色婷婷精品久久二区二区蜜臂av| 欧美午夜在线观看| www激情久久| 亚洲精品国产品国语在线app| 亚洲国产精品人人做人人爽| 老司机精品视频线观看86| 成人a区在线观看| 欧美三级韩国三级日本一级| 日韩亚洲欧美成人一区| 中文一区二区在线观看| 一区二区免费在线| 国产一区二区三区国产| 91久久香蕉国产日韩欧美9色| 欧美精品777| ㊣最新国产の精品bt伙计久久| 亚洲成av人在线观看| 国产成都精品91一区二区三| 欧美日韩在线免费视频| 国产日韩在线不卡| 天堂成人国产精品一区| av男人天堂一区| 精品国产麻豆免费人成网站| 亚洲视频 欧洲视频| 国产一区二区不卡在线| 91精品婷婷国产综合久久性色| 一区二区中文字幕在线|