Go to file
Jimmy Durand Wesolowski 360e04fa36
Fixing BLE GATT Characteristic notification and Characteristic Descriptor read (#4464)
* BLERemoteChar: fix descriptor 2902 write for characteristic notifications

When registering a notification on a characteristic, the 2902 descriptor
(CCCD) value is set to 1 (or 2 for indication).
According to the BLUETOOTH CORE SPECIFICATION Version 5.2, Revision Date
2019-12-31, section 4.12.3 "Write Characteristic Descriptors" (page 1588),
the characteristic descriptor write must expect a response.
Currently, the descriptor write is performed without expecting a reponse,
which prevents the notification to be functional with some BLE stacks.
This commit modify the write to expect the response.

Signed-off-by: Jimmy Durand Wesolowski <jimmy.durand.wesolowski@commsolid.com>

* BLERemoteChar: forward GATT client event to characteristic descriptors

This commits prevents a permanent wait when calling BLERemoteDescriptor
readValue function, on the m_semaphoreReadDescrEvt semaphore.

ESP32 BLE stack calls to remote characteristic
- notification,
- value read
- value write
and remote characteristic descriptor
- value read
are asynchronous.

When such a call is performed by this library, a semaphore is taken prior
to the BLE stack read or write operation, and waited on after it.

Releasing the semaphore is done by the characteristic event handling
function (gattClientEventHandler), when the appropriate event is received.

However, the characteristic descriptor events are discarded, and the
value read semaphore is never released.

This commits forwards the GATT client events from the remote
characteristic down to their remote characteristic descriptor, and
implements their event handling.

Adding a semaphore for the remote characteristic descriptor value write
will be done in a separate commit.

Signed-off-by: Jimmy Durand Wesolowski <jimmy.durand.wesolowski@commsolid.com>

* BLERemoteDescriptor: add semaphore to characteristic descriptor write

This adds a semaphore to characteristic descriptor value write, to mimic
the value read function, and to ensure completion of the operation before
we carry on.

Signed-off-by: Jimmy Durand Wesolowski <jimmy.durand.wesolowski@commsolid.com>

Co-authored-by: Jimmy Durand Wesolowski <jimmy.durand.wesolowski@commsolid.com>
2020-11-02 18:36:25 +02:00
.github Update PlatformIO CI script (#4307) 2020-08-31 18:06:34 +03:00
cores/esp32 Corrections of Stream.Find, FindUntil and added FindMulti - like AVR-Core Libraries (#3442) 2020-10-14 15:20:40 +03:00
docs shallow clone to make installation faster (#4246) 2020-10-01 14:43:48 +03:00
libraries Fixing BLE GATT Characteristic notification and Characteristic Descriptor read (#4464) 2020-11-02 18:36:25 +02:00
package Add ARM toolchain 2019-10-01 21:48:03 +03:00
tools Add missing "-mlongcalls" flag to PlatformIO build script (#4420) 2020-10-16 21:58:05 +03:00
variants Added the DoIT ESPduino-32 board (#1520) 2020-10-03 03:06:40 +03:00
.gitignore M5Stack's product offering includes various ESP32-based camera devices. (#4030) 2020-06-01 01:41:56 +03:00
.gitmodules Set ESP-IDF to 3.2 (#2662) 2019-04-12 15:43:53 +02:00
.travis.yml Use Github Actions for release (#3309) 2019-10-01 10:44:04 +03:00
boards.txt bugfix (#4389) 2020-10-14 14:30:32 +03:00
CMakeLists.txt Fix missing headers when compiling as IDF component with Cmake (#4377) 2020-10-01 15:45:52 +03:00
component.mk Fix compilation errors when used as IDF component 2019-01-26 21:37:03 +01:00
Kconfig.projbuild Make a selective menuconfig option for FFat (#2966) 2019-07-09 19:14:53 +03:00
LICENSE.md Add LGPL 2.1 License 2019-04-16 03:08:50 +02:00
Makefile.projbuild Remove duplicate ota_data flashing under IDF 2018-08-16 13:34:47 +02:00
package.json Initial version of build script for @PlatformIO; CI integration for Linux, macOS and Windows (#153) 2017-01-28 14:19:56 +02:00
platform.txt Rename eep -> partitions.bin & hex -> bin (#4143) 2020-10-14 14:34:14 +03:00
programmers.txt initial import 2016-10-06 07:09:44 -06:00
README.md Updated Readme.md (#4400) 2020-10-14 14:26:41 +03:00

Arduino core for the ESP32

Build Status

Need help or have a question? Join the chat at https://gitter.im/espressif/arduino-esp32

Contents

Development Status

Latest Stable Release Release Version Release Date Downloads

Latest Development Release Release Version Release Date Downloads

Installation Instructions

Decoding exceptions

You can use EspExceptionDecoder to get meaningful call trace.

Issue/Bug report template

Before reporting an issue, make sure you've searched for similar one that was already created. Also make sure to go through all the issues labelled as for reference.

Finally, if you are sure no one else had the issue, follow the ISSUE_TEMPLATE while reporting any issue.

ESP32Dev Board PINMAP

Pin Functions

Tip

Sometimes to program ESP32 via serial you must keep GPIO0 LOW during the programming process