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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? bluetoothservicerecordcanvas.java

?? BTBrowser,用JAVA API實(shí)現(xiàn)藍(lán)牙通信.
?? JAVA
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
package org.klings.wireless.j2me;

import java.util.Enumeration;

import javax.bluetooth.DataElement;
import javax.bluetooth.ServiceRecord;
import javax.bluetooth.UUID;
import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Ticker;

import org.klings.wireless.BluetoothNumbers.BTProtocol;
import org.klings.wireless.BluetoothNumbers.BTServiceAttributeId;
import org.klings.wireless.BluetoothNumbers.BTServiceClass;
import org.klings.wireless.BluetoothNumbers.BTUUIDTool;

/**
 * BluetoothServiceRecordCanvas prints the attributes of a Bluetooth
 * <code>ServiceRecord</code>. Only attributes which are set in the
 * <code>ServiceRecord</code> will be printed. The user may scroll up and down
 * in order to see the details for all attributes. The most common attributes
 * related to the Bluetooth Service Discovery Profile (SDP) are shown. These are
 * (with attribute IDs, in the order they are printed by
 * BluetoothServiceRecordCanvas):
 * <ul>
 * <li>0x0100, ServiceName</li>
 * <li>0x0101, ServiceDescription</li>
 * <li>0x0102, ProviderName</li>
 * <li>0x0000, ServiceRecordHandle</li>
 * <li>0x0003, ServiceID</li>
 * <li>0x0001, ServiceClassIDList</li>
 * <li>0x0004, ProtocolDescriptorList</li>
 * <li>0x0009, BluetoothProfileDescriptorList</li>
 * <li>0x0007, ServiceInfoTimeToLive</li>
 * <li>0x0008, ServiceAvailability</li>
 * <li>0x000A, DocumentationURL</li>
 * <li>0x000B, ClientExecutableURL</li>
 * <li>0x000C, IconURL</li>
 * </ul>
 */
public class BluetoothServiceRecordCanvas extends Canvas {

	/* service record to display */
	ServiceRecord sr = null;
	/* Keep track of where we are in the canvas */
	int y = 0;
	/* Different x values to indent lines */
	final int X1 = 2;
	final int X2 = 5;
	final int X3 = 8;
	/* Anchor for our text */
	final int anchor = Graphics.LEFT | Graphics.TOP;
	/* Different fonts for different types of text */
	Font plain, bold;
	/* Height of fonts */
	int plainHeight, boldHeight;
	/* Dimensions of canvas */
	int canvasHeight, canvasWidth;
	/* Offset used when there are more attributes than space in the canvas */
	int attrOffset = 0;

	/* Keycodes. The user can scroll up and down in the canvas */
	int upKey = getKeyCode(UP);
	int downKey = getKeyCode(DOWN);
	/*
	 * The MIDlet can retrieve these URLs and open them in a wap browser.
	 */
	String clientExecutableURL = null;
	String documentationURL = null;

	public BluetoothServiceRecordCanvas(ServiceRecord s) {
		// TODO Auto-generated constructor stub
		super();
		this.sr = s;
		/* Fonts for Bold and Plain text */
		plain = Font.getFont(Font.FACE_SYSTEM, Font.STYLE_PLAIN,
				Font.SIZE_MEDIUM);
		bold = Font
				.getFont(Font.FACE_SYSTEM, Font.STYLE_BOLD, Font.SIZE_MEDIUM);
		/* font heights to compute where to draw. */
		plainHeight = plain.getHeight();
		boldHeight = bold.getHeight();
		/* Canvas dimensions */
		canvasHeight = getHeight();
		canvasWidth = getWidth();
		setTicker(new Ticker("Service Record Info Canvas, by Klings @ "
				+ "http://www.klings.org/nowires --- "));
	}

	protected void paint(Graphics g) {
		/* Initialize the canvas */
		g.setColor(0xffffff);
		g.fillRect(0, 0, getWidth(), getHeight());
		/* We want black text */
		g.setColor(0x000000);
		g.setFont(plain);
		/* Start drawing two pixels from top of screen */
		y = 2;
		DataElement elm = null;
		// temp String
		String out = null;
		int shortUUID = 0;
		int offset = attrOffset;
		/* Get the serviceName */
		elm = (DataElement) sr
				.getAttributeValue(BTServiceAttributeId.SDP_SERVICENAME);
		if (elm != null && elm.getDataType() == DataElement.STRING
				&& offset++ >= 0) {
			out = (String) elm.getValue();
			/* Print servicename */
			y += CanvasHelper.printString("Service name:", X1, y, anchor, bold,
					canvasWidth - X1, g);
			y += CanvasHelper.printString(out, X2, y, anchor, plain,
					canvasWidth - X2, g);
		}
		if (y > canvasHeight)
			return;
		/* Get the serviceDescription */
		elm = (DataElement) sr
				.getAttributeValue(BTServiceAttributeId.SDP_SERVICEDESCRIPTION);
		if (elm != null && elm.getDataType() == DataElement.STRING
				&& offset++ >= 0) {
			out = (String) elm.getValue();
			/* Print serviceDescription */
			y += CanvasHelper.printString("Service description:", X1, y,
					anchor, bold, canvasWidth - X1, g);
			y += CanvasHelper.printString(out, X2, y, anchor, plain,
					canvasWidth - X2, g);
		}
		if (y > canvasHeight)
			return;
		/* Get the providerName */
		elm = (DataElement) sr
				.getAttributeValue(BTServiceAttributeId.SDP_PROVIDERNAME);
		if (elm != null && elm.getDataType() == DataElement.STRING
				&& offset++ >= 0) {
			out = (String) elm.getValue();
			/* Print providerName */
			y += CanvasHelper.printString("Provider name:", X1, y, anchor,
					bold, canvasWidth - X1, g);
			y += CanvasHelper.printString(out, X2, y, anchor, plain,
					canvasWidth - X2, g);
		}
		if (y > canvasHeight)
			return;
		/* Get the serviceRecordHandle */
		elm = (DataElement) sr
				.getAttributeValue(BTServiceAttributeId.SDP_SERVICERECORDHANDLE);
		if (elm != null && elm.getDataType() == DataElement.U_INT_4
				&& offset++ >= 0) {
			long var = elm.getLong();
			out = "0x" + Long.toString(var, 16);
			/* Print serviceRecordHandle */
			y += CanvasHelper.printString("ServiceRecordHandle:", X1, y,
					anchor, bold, canvasWidth - X1, g);
			y += CanvasHelper.printString(out, X2, y, anchor, plain,
					canvasWidth - X2, g);
		}
		if (y > canvasHeight)
			return;
		/* Get the serviceId */
		elm = (DataElement) sr
				.getAttributeValue(BTServiceAttributeId.SDP_SERVICEID);
		if (elm != null && elm.getDataType() == DataElement.UUID
				&& offset++ >= 0) {
			UUID var = (UUID) elm.getValue();
			out = "0x" + var.toString();
			/* Print serviceId */
			y += CanvasHelper.printString("ServiceId:", X1, y, anchor, bold,
					canvasWidth - X1, g);
			y += CanvasHelper.printString(out, X2, y, anchor, plain,
					canvasWidth - X2, g);
		}
		if (y > canvasHeight)
			return;
		/* Get the serviceClassIdList */
		elm = (DataElement) sr
				.getAttributeValue(BTServiceAttributeId.SDP_SERVICECLASSIDLIST);
		if (elm != null && elm.getDataType() == DataElement.DATSEQ
				&& offset++ >= 0) {
			y += CanvasHelper.printString("ServiceClassIdList:", X1, y, anchor,
					bold, canvasWidth - X1, g);
			/* elm should be a DATSEQ of UUIDs */
			DataElement elm2 = null;
			UUID uuid = null;
			try {
				Enumeration e = (Enumeration) elm.getValue();
				while (e.hasMoreElements()) {
					elm2 = (DataElement) e.nextElement();
					if (elm2.getDataType() == DataElement.UUID) {
						uuid = (UUID) elm2.getValue();
						shortUUID = BTUUIDTool.shortUUID(uuid);
						if (shortUUID != -1) {
							out = BTUUIDTool.toHexString(shortUUID)
									+ ", "
									+ BTServiceClass
											.serviceClassName(shortUUID);
						} else {
							out = "0x" + uuid.toString();
						}
						y += CanvasHelper.printString(out, X2, y, anchor,
								plain, canvasWidth - X2, g);
					}
				}
			} catch (ClassCastException cce) {
				y += CanvasHelper.printString("Unpredicted object", X2, y,
						anchor, plain, canvasWidth - X2, g);
			}
		}
		if (y > canvasHeight)
			return;
		/* Get the protocolDescriptorList */
		elm = (DataElement) sr
				.getAttributeValue(BTServiceAttributeId.SDP_PROTOCOLDESCRIPTORLIST);
		if (elm != null && elm.getDataType() == DataElement.DATSEQ
				&& offset++ >= 0) {
			y += CanvasHelper.printString("ProtocolDescriptorList:", X1, y,
					anchor, bold, canvasWidth - X1, g);
			/*
			 * elm should be a DATSEQ of DATSEQ of UUID and optional parameters
			 */
			DataElement elm2 = null;
			DataElement elm3 = null;
			UUID uuid = null;
			try {
				/* Get enumeration to the "outer" DATSEQ */
				Enumeration e = (Enumeration) elm.getValue();
				/* Iterate through the "outer" DATSEQ */
				while (e.hasMoreElements()) {

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久激情五月婷婷| 色婷婷一区二区| 亚洲黄色录像片| 久久综合九色欧美综合狠狠| 色婷婷国产精品久久包臀| 狠狠色丁香婷综合久久| 午夜久久电影网| 亚洲日穴在线视频| 中文字幕av不卡| 亚洲精品一区在线观看| 欧美日韩国产高清一区| aaa欧美色吧激情视频| 国产精品白丝jk黑袜喷水| 裸体在线国模精品偷拍| 香蕉加勒比综合久久| 一区二区三区丝袜| 国产精品理伦片| 久久久久免费观看| 日韩三级免费观看| 91 com成人网| 欧美日韩一区二区不卡| 91国模大尺度私拍在线视频 | 丁香婷婷综合激情五月色| 男人的天堂亚洲一区| 亚洲chinese男男1069| 亚洲人妖av一区二区| 国产精品久久久久一区二区三区共| 精品国产一区二区三区久久久蜜月| 91麻豆精品国产91久久久久久久久 | 麻豆精品精品国产自在97香蕉 | 亚洲一区在线观看免费观看电影高清| 国产精品理论片在线观看| 国产日韩欧美精品一区| 久久久三级国产网站| 日韩美女一区二区三区四区| 日韩一区二区三免费高清| 91精品国产入口| 欧美不卡一区二区三区四区| 日韩欧美亚洲国产另类| 精品国产伦一区二区三区观看体验| 欧美一级片在线| 精品国产一区二区三区久久久蜜月 | 亚洲麻豆国产自偷在线| 亚洲精品国产a| 午夜欧美电影在线观看| 欧美aaa在线| 国产综合一区二区| 国产凹凸在线观看一区二区| 国产一区不卡视频| 高清beeg欧美| 91丨porny丨国产入口| 91黄色激情网站| 8v天堂国产在线一区二区| 91精品国产乱码| www国产精品av| 欧美激情一二三区| 亚洲欧美国产高清| 亚洲r级在线视频| 加勒比av一区二区| 成人一区二区三区在线观看| 成人高清伦理免费影院在线观看| 91美女精品福利| 制服丝袜av成人在线看| 日韩欧美电影在线| 国产精品你懂的在线| 一区二区三区免费观看| 免费在线视频一区| 成人在线综合网站| 欧美性感一类影片在线播放| 日韩视频一区二区| 国产精品伦理在线| 丝袜诱惑亚洲看片| 成人激情综合网站| 欧美在线三级电影| 精品1区2区在线观看| 亚洲欧美欧美一区二区三区| 日韩1区2区3区| 成人国产精品免费观看动漫| 欧美日韩免费电影| 国产亚洲人成网站| 亚洲国产另类精品专区| 国产馆精品极品| 欧美日韩国产免费一区二区 | 欧美在线一二三| 精品国产a毛片| 亚洲视频免费在线| 经典三级一区二区| 欧美午夜在线观看| 久久精品综合网| 天天色天天操综合| www.欧美亚洲| 精品欧美久久久| 亚洲sss视频在线视频| 成人免费毛片aaaaa**| 91精品久久久久久久91蜜桃| 亚洲三级在线播放| 国产超碰在线一区| 日韩一区二区三区视频在线| 樱桃国产成人精品视频| 国产91精品免费| 欧美大片在线观看一区| 亚洲第一电影网| 91在线播放网址| 国产午夜精品一区二区三区嫩草 | 国内成人免费视频| 在线成人av影院| 一区二区三区国产豹纹内裤在线| 国产精品99久久久久久宅男| 欧美一区二区视频网站| 亚洲成人免费观看| 色吊一区二区三区| 日韩伦理免费电影| 国产91高潮流白浆在线麻豆| 欧美mv日韩mv| 久久99在线观看| 日韩一区二区免费高清| 天堂一区二区在线| 精品视频一区二区三区免费| 亚洲欧美另类小说| 91视视频在线观看入口直接观看www | 久久在线免费观看| 久久99最新地址| 精品国产电影一区二区| 精品在线一区二区三区| 日韩一区二区免费在线观看| 日韩高清在线电影| 日韩一区二区三区视频| 美女视频黄久久| 欧美mv和日韩mv国产网站| 蜜桃av噜噜一区| 精品国产一区二区亚洲人成毛片| 热久久一区二区| 精品少妇一区二区三区日产乱码 | 久久久久久久久久久久久久久99 | 94色蜜桃网一区二区三区| 中文字幕成人在线观看| 高清不卡一区二区| 中文字幕第一区第二区| 成人涩涩免费视频| 日韩美女啊v在线免费观看| 色先锋资源久久综合| 亚洲综合清纯丝袜自拍| 欧美日韩国产在线观看| 日本不卡在线视频| 精品成a人在线观看| 国产精品99久| 亚洲欧美在线高清| 欧美自拍偷拍午夜视频| 亚洲电影一级黄| 日韩精品自拍偷拍| 国产精品18久久久| 国产精品国产精品国产专区不片| 91小宝寻花一区二区三区| 亚洲制服欧美中文字幕中文字幕| 欧美日韩一区三区| 日本免费在线视频不卡一不卡二| 精品国产伦一区二区三区观看方式| 国产激情精品久久久第一区二区| 国产精品久久久久久亚洲伦 | 精品三级av在线| 高清免费成人av| 一区二区三区蜜桃| 日韩欧美中文字幕精品| 国产乱码字幕精品高清av| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 在线观看免费一区| 老司机免费视频一区二区三区| 久久久av毛片精品| 一本色道久久综合狠狠躁的推荐 | 欧美剧情片在线观看| 国产综合成人久久大片91| 亚洲欧洲一区二区在线播放| 欧美影院一区二区三区| 国产资源在线一区| 亚洲综合免费观看高清完整版在线 | 欧美成人精品高清在线播放 | 精品久久人人做人人爽| 99久久国产综合精品色伊| 日本视频一区二区三区| 中文字幕制服丝袜一区二区三区| 欧美久久一区二区| 国产v综合v亚洲欧| 婷婷久久综合九色综合伊人色| 国产亚洲综合av| 欧美猛男男办公室激情| 国产大陆亚洲精品国产| 亚洲成av人片一区二区三区| 国产区在线观看成人精品 | 国产成人免费高清| 三级在线观看一区二区 | 国产综合久久久久影院| 亚洲午夜一区二区| 日本一区二区动态图| 日韩欧美中文字幕公布| 在线免费观看日韩欧美| 国产成人综合在线| 青青草成人在线观看| 伊人婷婷欧美激情| 国产精品美女久久久久久久网站| 日韩免费看的电影|