⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 btprotocol.java

📁 BTBrowser,用JAVA API实现蓝牙通信.
💻 JAVA
字号:
package org.klings.wireless.BluetoothNumbers;

public class BTProtocol {

	/**
	 * Defines the <code>SDP</code> short UUID value.
	 * <p>
	 * <code>SDP</code> is set to the constant value 0x0001.
	 */
	public static final int SDP = 0x0001;
	/**
	 * Defines the <code>UDP</code> short UUID value.
	 * <p>
	 * <code>UDP</code> is set to the constant value 0x0002
	 */
	public static final int UDP = 0x0002;
	/**
	 * Defines the <code>RFCOMM</code> short UUID value.
	 * <p>
	 * <code>RFCOMM</code> is set to the constant value 0x0003
	 */
	public static final int RFCOMM = 0x0003;
	/**
	 * Defines the <code>TCP</code> short UUID value.
	 * <p>
	 * <code>TCP</code> is set to the constant value 0x0004
	 */
	public static final int TCP = 0x0004;
	/**
	 * Defines the <code>TCS_BIN</code> short UUID value.
	 * <p>
	 * <code>TCS_BIN</code> is set to the constant value 0x0005
	 */
	public static final int TCS_BIN = 0x0005;

	/**
	 * Defines the <code>TCS_AT</code> short UUID value.
	 * <p>
	 * <code>TCS_AT</code> is set to the constant value 0x0006
	 */
	public static final int TCS_AT = 0x0006;
	/**
	 * Defines the <code>OBEX</code> short UUID value.
	 * <p>
	 * <code>OBEX</code> is set to the constant value 0x0008
	 */
	public static final int OBEX = 0x0008;
	/**
	 * Defines the <code>IP</code> short UUID value.
	 * <p>
	 * <code>IP</code> is set to the constant value 0x0009
	 */
	public static final int IP = 0x0009;
	/**
	 * Defines the <code>FTP</code> short UUID value.
	 * <p>
	 * <code>FTP</code> is set to the constant value 0x000A
	 */
	public static final int FTP = 0x000A;

	/**
	 * Defines the <code>HTTP</code> short UUID value.
	 * <p>
	 * <code>HTTP</code> is set to the constant value 0x000C
	 */
	public static final int HTTP = 0x000C;
	/**
	 * Defines the <code>WSP</code> short UUID value.
	 * <p>
	 * <code>WSP</code> is set to the constant value 0x000E
	 */
	public static final int WSP = 0x000E;
	/**
	 * Defines the <code>BNEP</code> short UUID value.
	 * <p>
	 * <code>BNEP</code> is set to the constant value 0x000F
	 */
	public static final int BNEP = 0x000F;
	/**
	 * Defines the <code>UPNP</code> short UUID value.
	 * <p>
	 * <code>UPNP</code> is set to the constant value 0x0010
	 */
	public static final int UPNP = 0x0010;
	/**
	 * Defines the <code>HIDP</code> short UUID value.
	 * <p>
	 * <code>HIDP</code> is set to the constant value 0x0011
	 */
	public static final int HIDP = 0x0011;

	/**
	 * Defines the <code>HardcopyControlChannel</code> short UUID value.
	 * <p>
	 * <code>HARDCOPYCONTROLCHAN</code> is set to the constant value 0x0012
	 */
	public static final int HARDCOPYCONTROLCHANNEL = 0x0012;
	/**
	 * Defines the <code>HardcopyDataChannel</code> short UUID value.
	 * <p>
	 * <code>HARDCOPYDATACHANNEL</code> is set to the constant value 0x0014
	 */
	public static final int HARDCOPYDATACHANNEL = 0x0014;
	/**
	 * Defines the <code>HardcopyNotification</code> short UUID value.
	 * <p>
	 * <code>HARDCOPYNOTIFICATION</code> is set to the constant value 0x0016
	 */
	public static final int HARDCOPYNOTIFICATION = 0x0016;
	/**
	 * Defines the <code>AVCTP</code> short UUID value.
	 * <p>
	 * <code>AVCTP</code> is set to the constant value 0x0017
	 */
	public static final int AVCTP = 0x0017;

	/**
	 * Defines the <code>AVDTP</code> short UUID value.
	 * <p>
	 * <code>AVDTP</code> is set to the constant value 0x0019
	 */
	public static final int AVDTP = 0x0019;
	/**
	 * Defines the <code>CMTP</code> short UUID value.
	 * <p>
	 * <code>CMTP</code> is set to the constant value 0x001B
	 */
	public static final int CMTP = 0x001B;

	/**
	 * Defines the <code>UDI_C_Plane</code> short UUID value.
	 * <p>
	 * <code>UDI_C_Plane</code> is set to the constant value 0x001D
	 */
	public static final int UDI_C_Plane = 0x001D;
	/**
	 * Defines the <code>L2CAP</code> short UUID value.
	 * <p>
	 * <code>L2CAP</code> is set to the constant value 0x0100
	 */
	public static final int L2CAP = 0x0100;

	private static int[] BTProtos = { SDP, UDP, TCP, TCS_BIN, TCS_AT, IP, FTP,
			HTTP, WSP, BNEP, UPNP, HIDP, HARDCOPYCONTROLCHANNEL,
			HARDCOPYDATACHANNEL, HARDCOPYNOTIFICATION, AVCTP, AVDTP, CMTP,
			UDI_C_Plane, OBEX, RFCOMM, L2CAP };

	private static String[] BTProtoStrings = { "SDP", "UDP", "TCP", "TCS_BIN",
			"TCS_AT", "IP", "FTP", "HTTP", "WSP", "BNEP", "UPNP", "HIDP",
			"HardcopyControlChannel", "HardcopyDataChannel",
			"HardcopyNotification", "AVCTP", "AVDTP", "CMTP", "UDI_C_Plane",
			"OBEX", "RFCOMM", "L2CAP" };

	public static String protocolName(int shortUUID) {
		// let's search for our UUID.
		for (int i = BTProtos.length - 1; i >= 0; i--) {
			if (shortUUID == BTProtos[i]) {
				return BTProtoStrings[i];
			}
		}
		return null;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -