| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- package com.mt.lib.mtblesdk;
- import android.bluetooth.BluetoothGattCharacteristic;
- import java.util.HashMap;
- public class MTBeaconUUID {
- public static final String SERVICE_UUID = "0000F1E0-0000-1000-8000-00805F9B34FB";
- public static final String CMD_UUID = "0000F1E5-0000-1000-8000-00805F9B34FB";
-
- private static HashMap<String, String> attributes_uuid = new HashMap();
- private static HashMap<String, BluetoothGattCharacteristic> attributes_char = new HashMap();
-
- static {
- attributes_uuid.put("00002a19-0000-1000-8000-00805f9b34fb", "battery");
- // Sample Services.
- attributes_uuid.put("0000fae1-0000-1000-8000-00805f9b34fb", "UUID");
- attributes_uuid.put("0000fae2-0000-1000-8000-00805f9b34fb", "major");
- attributes_uuid.put("0000fae3-0000-1000-8000-00805f9b34fb", "minor");
- attributes_uuid.put("0000fae4-0000-1000-8000-00805f9b34fb", "Txpower");
- attributes_uuid.put("0000fae5-0000-1000-8000-00805f9b34fb", "ATCMD");
- }
-
- // 添加特征值
- public static void AddChar(String name, BluetoothGattCharacteristic c)
- {
- attributes_char.put(name, c);
- }
- // 获取特征值
- public static BluetoothGattCharacteristic GetChar(String name)
- {
- return attributes_char.get(name);
- }
-
- public static String lookup(String uuid) {
- String name = attributes_uuid.get(uuid);
- return name;
- }
- }
|