1 /*
2  * Copyright (C) 2013 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.example.android.bluetoothlegatt;
18 
19 import java.util.HashMap;
20 
21 /**
22  * This class includes a small subset of standard GATT attributes for demonstration purposes.
23  */
24 public class SampleGattAttributes {
25     private static HashMap<String, String> attributes = new HashMap();
26     public static String HEART_RATE_MEASUREMENT = "00002a37-0000-1000-8000-00805f9b34fb";
27     public static String CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb";
28 
29     static {
30         // Sample Services.
31         attributes.put("0000180d-0000-1000-8000-00805f9b34fb", "Heart Rate Service");
32         attributes.put("0000180a-0000-1000-8000-00805f9b34fb", "Device Information Service");
33         // Sample Characteristics.
attributes.put(HEART_RATE_MEASUREMENT, "Heart Rate Measurement")34         attributes.put(HEART_RATE_MEASUREMENT, "Heart Rate Measurement");
35         attributes.put("00002a29-0000-1000-8000-00805f9b34fb", "Manufacturer Name String");
36     }
37 
lookup(String uuid, String defaultName)38     public static String lookup(String uuid, String defaultName) {
39         String name = attributes.get(uuid);
40         return name == null ? defaultName : name;
41     }
42 }
43