问题描述
- Android的BLE技术中的GattAttributes是干什么的?
-
最近在研究BLE技术发现了这个东西有一点不明白,有一个GattAttributes的文件/**
- This class includes a small subset of standard GATT attributes for demonstration purposes.
*/
public class SampleGattAttributes {
private static HashMap attributes = new HashMap();
public static String HEART_RATE_MEASUREMENT = "00002a37-0000-1000-8000-00805f9b34fb";
public static String CLIENT_CHARACTERISTIC_CONFIG = "00002902-0000-1000-8000-00805f9b34fb";static {
// Sample Services.
attributes.put("0000180d-0000-1000-8000-00805f9b34fb", "Heart Rate Service");
attributes.put("0000180a-0000-1000-8000-00805f9b34fb", "Device Information Service");
// Sample Characteristics.
attributes.put(HEART_RATE_MEASUREMENT, "Heart Rate Measurement");
attributes.put("00002a29-0000-1000-8000-00805f9b34fb", "Manufacturer Name String");
}public static String lookup(String uuid, String defaultName) {
String name = attributes.get(uuid);
return name == null ? defaultName : name;
}
}
翻译说是一种协议,请问用来干嘛的?
- This class includes a small subset of standard GATT attributes for demonstration purposes.
解决方案
http://blog.csdn.net/chaoyue0071/article/details/43450091/
解决方案二:
http://blog.csdn.net/lgdlchshg/article/details/17474087
解决方案三:
蓝牙的接口协议,是硬件给你的。其实我也不懂,之前研究了一下,这能这样理解了
时间: 2024-10-30 06:41:40