标准和定制 GATT 特征

2024-05-13

我正在为 Android 手机和 Android 手表(wearOS)编写应用程序。这些应用程序将通过蓝牙相互通信。基本上Android手机上的应用程序将与WearOS设备绑定,然后与WearOS上的应用程序通信以启动指定功能,获取电池信息,...

我知道我应该使用 GATT 特征来获取标准信息,例如电池、设备名称……

请帮忙指教一下这两个问题:

在哪里可以获得标准特征 UUID 的完整列表?

如何定义自定义信息/功能(例如“显示照片”或“播放声音”)的自定义特征?

非常感谢


在哪里可以获得标准特征 UUID 的完整列表?

这是在 Markus Kauppinen 共享的链接中找到的文档:-

https://btprodspecationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf https://btprodspecificationrefs.blob.core.windows.net/assigned-values/16-bit%20UUID%20Numbers%20Document.pdf

在第 12 页左右,您会发现“GATT 特征和对象类型”。在第 19 页左右,您会发现“的开头关贸总协定服务".

如何定义自定义信息/功能(例如“显示照片”或“播放声音”)的自定义特征?

我推荐以下链接,其中介绍了如何在 Android 上创建 BLE GATT 表:-

  • Android:使用 GATT 服务器 https://riptutorial.com/android/example/30768/using-a-gatt-server
  • BLE GATT 服务器示例 https://github.com/androidthings/sample-bluetooth-le-gattserver
  • Nordic 的 Android BLE 库 https://github.com/NordicSemiconductor/Android-BLE-Library(检查 GATT 服务器支持)
  • 蓝牙Gatt服务器 Android API https://developer.android.com/reference/android/bluetooth/BluetoothGattServer

其他资源

  • Android BLE 开发终极指南 https://punchthrough.com/android-ble-guide/
  • 如何设计定制服务和特征 https://www.novelbits.io/bluetooth-gatt-services-characteristics/
  • BLE 特性:初学者教程 https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial
  • BLE:在两个 Android 设备之间发送数据 https://stackoverflow.com/questions/65636725/bluetooth-le-send-string-data-between-android-devices-via-application
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

标准和定制 GATT 特征 的相关文章

随机推荐