BLE _IRQ_GATTS_READ_REQUEST

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
MerseyViking
Posts: 5
Joined: Tue Nov 16, 2021 10:14 pm

BLE _IRQ_GATTS_READ_REQUEST

Post by MerseyViking » Tue Nov 16, 2021 11:05 pm

The docs say that

Code: Select all

_IRQ_GATTS_READ_REQUEST
is only supported on the STM32. Is there a reason this hasn't been implemented on the ESP32?

My use case is that I want to receive the values for some characteristics after the central has connected, regardless whether they have changed on the peripheral. The data is too large to fit in a scan request packet, and it doesn't seem like the right place to put it anyway.
I have tried issuing an indication in the connection event handler, but that doesn't seem to be picked up by my client because (I think) the indication handler is set after connection has been established, so it's being eaten before I can get it.
My next thought is to add a command characteristic that when written to tells the server to issue notifications/indications for each characteristic.

As I am new to BLE, what's the preferred strategy for a central to read data from the peripheral on demand on an ESP32?

MerseyViking
Posts: 5
Joined: Tue Nov 16, 2021 10:14 pm

Re: BLE _IRQ_GATTS_READ_REQUEST

Post by MerseyViking » Thu Nov 18, 2021 1:10 pm

Answering my own question - it was a misunderstanding on my part. I assumed reads weren't implemented on the ESP32, but it's just the interrupt that's not called on a read. So you *must* set a value using gatts_write and you can't do anything fancy when a central performs the read.

Post Reply