ble中的客户端特征配置描述符中的ENABLE_INDICATION_VALUE和ENABLE_NOTIFICATION_VALUE是什么? [英] What is ENABLE_INDICATION_VALUE and ENABLE_NOTIFICATION_VALUE in Client Characteristic Configuration Descriptor in ble?

查看:247
本文介绍了ble中的客户端特征配置描述符中的ENABLE_INDICATION_VALUE和ENABLE_NOTIFICATION_VALUE是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在开发一个应用程序来从另一个 BLE 设备读取和写入数据.从应用程序的角度来看,我没有任何问题.只是我需要澄清的一些概念性疑问.所以:

I have been working on an app to read and write data from another BLE device. I don't have any issues going on from the app point of view. Just some of the conceptual doubts I need to clarify. So:

  1. 为什么我们需要 cccd 来启用通知?

  1. Why do we need the cccd for enabling notification?

一旦通过 ENABLE_INDICATION_VALUE,是否启用通知在外围设备中?

Once passing the ENABLE_INDICATION_VALUE, does it enables the notification in the peripheral device?

ENABLE_INDICATION_VALUE 和 ENABLE_INDICATION_VALUE 之间的主要区别是什么?ENABLE_NOTIFICATION_VALUE 两者都执行相同的任务,即发送连续数据到中央设备?

What is the major difference between ENABLE_INDICATION_VALUE and ENABLE_NOTIFICATION_VALUE while both do the same task that is, sending continuous data to the central device?

推荐答案

  1. 客户端需要配置服务器才能启用通知/指示.否则它不会发送任何东西.

  1. The client needs to configure the server if it should enable notifications/indications. Otherwise it won't send anything.

没有.16 位描述符值是一个位字段.目前只定义了两个位:通知和指示.您可以设置这两个位,然后您应该会同时收到通知和服务器行为是否正确的指示.

No. The 16-bit descriptor value is a bit field. Currently only two bits are defined: Notification and Indication. You could set both bits and then you should get both a notification and an indication if the server behaves correctly.

服务器可以随时发送通知.每个连接事件甚至可能有多个通知,从而提供高性能.一台服务器只能有一个未完成的指示.在服务器可以发送新的指示之前,客户端需要确认接收到指示.与通知相比,这会降低性能.请注意,在我看来,使用 Android 或 iOS 作为客户端的指示是没有用的,因为在应用程序完全处理指示之前,蓝牙堆栈将确认发送回.所以确认是一个错误"的确认.

A server can send notifications whenever it wants. Possibly even multiple notifications per connection event, which gives high performance. A server can only have one outstanding indication. The client needs to confirm the reception of an indication before the server can send a new one. This gives slow performance compared to notifications. Note that, in my opinion, using indications with Android or iOS as client is kind of useless because the confirmation is sent back by the Bluetooth stack before the app has handled the indication completely. So the confirmation is a "false" confirmation.

这篇关于ble中的客户端特征配置描述符中的ENABLE_INDICATION_VALUE和ENABLE_NOTIFICATION_VALUE是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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