简体   繁体   English

当您无法访问官方 GATT XML 文件时,如何构建 BLE 应用程序?

[英]How do you build a BLE app when you don't have access to the official GATT XML files?

To build a BLE app, you need要构建 BLE 应用程序,您需要

  1. service UUID服务 UUID
  2. the service's characteristic UUIDs服务的特征 UUID
  3. the characteristic's permissions (read / write / notify ...)特征的权限(读/写/通知...)
  4. If you are sending any data, you need to know the value type (uint8_t, uint16_t ...)如果要发送任何数据,则需要知道值类型 (uint8_t, uint16_t ...)

For an instance, if it was environment sensing service, I can read this PDF from this page , and find Environmental Sensing under GATT Service and the UUID is 0x181A .例如,如果它是环境感知服务,我可以从这个页面阅读这个 PDF ,并在GATT Service下找到Environmental Sensing ,UUID 是0x181A Then I can go on reading the same PDF and find Temperature (although it's T emperature in text for some reasons, and it can't be searched by Temperature ) under GATT Characteristic and Object Type , and the UUID is 0x2A6E .然后我可以继续阅读相同的 PDF 并在GATT Characteristic and Object Type下找到Temperature (尽管由于某些原因它是文本中的T emperature ,并且不能通过Temperature进行搜索),并且 UUID 为0x2A6E

OK, so far so good.好的,到目前为止一切顺利。 Then I hit a wall.然后我撞墙了。 How about the data size (eg uint16_t or whatever) to notify or which permissions are allowed (eg read / write ...)?要通知的数据大小(例如 uint16_t 或其他)如何或允许哪些权限(例如读/写...)?

After hours of googling, I finally found this github and this github .经过几个小时的谷歌搜索,我终于找到了这个 github这个 github But this is not official, somebody copied and evacuated them.但这不是官方的,有人复制并疏散了他们。

How do you efficiently program a BLE app when you don't have official XML files to look up?当您没有官方 XML 文件可供查找时,您如何有效地编写 BLE 应用程序?

From the GATT Specification page there is the GATT Specification Supplement document where it has the information on the structure of the temperature characteristic:GATT 规范页面GATT 规范补充文件,其中包含有关温度特性结构的信息:

在此处输入图片说明

Environmental Sensing Service document also on GATT Specification page details if a characteristic can have notifications:如果特征可以有通知,则GATT 规范页面上的环境传感服务文档也有详细信息:

在此处输入图片说明

I also found the XML documents presented the information in a more compact manner and I have bought this to the attention of the Bluetooth SIG but the links don't seem to get fixed.我还发现 XML 文档以更紧凑的方式呈现信息,我已将其购买以引起蓝牙 SIG 的注意,但链接似乎没有得到修复。 The data is still there on the site if you can workout the URL.如果您可以锻炼 URL,数据仍然存在于站点上。 I have no idea if that data is being maintained.我不知道是否正在维护该数据。

https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.environmental_sensing.xml https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Services/org.bluetooth.service.environmental_sensing.xml

https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.temperature.xml https://www.bluetooth.com/wp-content/uploads/Sitecore-Media-Library/Gatt/Xml/Characteristics/org.bluetooth.characteristic.temperature.xml

所有 GATT xml 规范都可以在这里找到: https : //github.com/oesmith/gatt-xml

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM