BLE中属性和服务的区别 [英] Difference between attributes and services in BLE

查看:23
本文介绍了BLE中属性和服务的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道 BLE 规范中 GATT 中的属性和服务有什么区别,我们可以在哪里找到属性,它们是在服务中、特征中还是在描述符中?

I would like to know what is the difference between attributes and service in GATT in BLE specification, and where we can find attributes, are they in service, characteristics or in descriptors?

推荐答案

总而言之 ... 服务、特征和描述符 ... 是属性 :-)

In summary ... services, characteristics, and descriptors ... are attributes :-)

BLE 标准提供了定义属性概念的 ATT 协议.所有属性都定义在一个表中,它们有一个句柄、一个类型(带有 UUID)、一个值(和权限).在 BLE 堆栈中的 ATT 协议之上,您有 GATT 和 GAP.GATT 协议定义了服务、特征和描述符,它们中的每一个都是一个属性.例如,一个特性是一个带有句柄的属性、一个类型(一个 UUID 告诉我们该属性是一个特性)和一个值(具有属性值句柄的特性属性等等).在特征内部,您有一个作为特征值的属性和一个或多个本身就是属性的描述符.

The BLE standard provides the ATT protocol that defines the concept of attributes. All attributes are defined inside a table and they have a handle, a type (with a UUID), a value (and permissions). On top of ATT protocol in the BLE stack, you have GATT and GAP. The GATT protocol defines services, characteristics, and descriptors and each of them is an attribute. For example, a characteristic is an attribute with a handle, a type (a UUID that tells us that the attribute is a characteristic) and a value (the characteristic properties with a handle to the attribute value and so on). Inside the characteristic, you have an attribute that is the value of the characteristic and one or more descriptors that are themselves attributes.

您可以将属性概念视为抽象类型,您可以定义具体类型,例如服务、特征和描述符.

You can see the attribute concept as the abstract type you can define concrete types like service, characteristic and descriptors.

我建议您观看 Nordic 的以下视频(BLE 介绍).

I can suggest seeing the following video (intro on BLE) by Nordic.

这篇关于BLE中属性和服务的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆