Skip to content

BLE Client Characteristic Configuration descriptor (BLE2902) value is not resetting to default (00 00) on connection #6863

Closed
@SuperTankMan

Description

@SuperTankMan

Board

az-delivery-devkit-v4

Device Description

ESP32 with stepper motor and few basic level sensors.

Hardware Configuration

Not relevant

Version

v2.0.2

IDE Name

Arduino IDE and PlatformIO

Operating System

All.

Flash frequency

80-240Mhz

PSRAM enabled

no

Upload speed

115200

Description

Hi All, this is my first discussion post so please excuse my manners :p

Recently I have been working on ESP32 BLE where the server sets up a service in which the attributes are read, Write, Notify. hence a BLE2902 is added to the characteristics. Once the client registers for the notification and then after a few notifications being received the client disconnect from the server without disabling notifications.

I have noticed that when the client makes connection again (without being bonded) the notification is still enabled! however the Bluetooth specifications specifically state that it should be reset to default value of notifications and Indications i.e disabled when not bonded. Anyone can test this using nRF connect and a standard service or useing BLE_notify.ino from the examples which has characteristics with notification.

Test procedure:
1.0 Connect to the device.
2.0 Enable Notification on a characteristic.
3.0 Disconnect from the device but not reset.
4.0 Connect to the device without power cycle or rest.
5.0 Check the status of the notification by reading value of BLE2902 it should reset to 00 00 or notification and indication disabled (see ref below) but it does not.

Has anyone noticed this and if so is this how ESP32 BLE is supposed to behave? or is it a bug or an issue?

TankMan-

References:
BLUETOOTH SPECIFICATION Version 4.2 [Vol 0]

3.3.3.3 Client Characteristic Configuration

The Client Characteristic Configuration declaration is an optional characteristic
descriptor that defines how the characteristic may be configured by a specific
client. The Client Characteristic Configuration descriptor value shall be
persistent across connections for bonded devices. The Client Characteristic
Configuration descriptor value shall be set to the default value at each
connection with non-bonded devices. The characteristic descriptor value is a bit
field. When a bit is set, that action shall be enabled, otherwise it will not be
used. The Client Characteristic Configuration descriptor may occur in any
position within the characteristic definition after the Characteristic Value. Only
one Client Characteristic Configuration declaration shall exist in a
characteristic definition.

Extracted from further down the spec. near Table 3.11 in the specification
Configuration Value Description
Notification 0x0001 The Characteristic Value shall be notified. This value can only be set if the characteristic’s property has the notify bit set.
Indication 0x0002 The Characteristic Value shall be indicated. This value can only be set if the characteristic’s property has the indicate bit set.
Reserved for
Future Use
The following Client Characteristic Configuration bits are defined:
The default value for the Client Characteristic Configuration descriptor value
shall be 0x0000.

Sketch

Use the BLE_notify.ino example and follow the instructions above

Debug Message

None

Other Steps to Reproduce

Use nRF connect or similar to register for notification or read BLE2902 values.

I have checked existing issues, online documentation and the Troubleshooting Guide

  • I confirm I have checked existing issues, online documentation and Troubleshooting guide.

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions