esp-idf_Bluetooth_Multi-Service icon indicating copy to clipboard operation
esp-idf_Bluetooth_Multi-Service copied to clipboard

document support for long read

Open phatpaul opened this issue 5 years ago • 4 comments

I see there is support for long write (prepare/exec write) and it works with Android. But I also need long read. It seems the example is missing the logic to split-up a read.

(I know this example is based off ESP-IDF example- which is also missing the long read https://github.com/espressif/esp-idf/tree/master/examples/bluetooth/gatt_server_service_table )

Here's an implementation in C++.
https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/BLECharacteristic.cpp#L348 I am trying to use it as a guide to implement into this c project structure.

Please let me know if it's already been done or there is a better way.

phatpaul avatar Feb 19 '19 19:02 phatpaul

Hmm it seems if I set the characteristic to ESP_GATT_AUTO_RSP, then the long read and long write is handled at a lower-level.

So it is misleading that there is this example code: example_prepare_write_event_env() and example_exec_write_event_env(), because that code is not even needed to write a long char.

phatpaul avatar Feb 19 '19 20:02 phatpaul

Yes, that is just left over from the IDF example code. I've never actually needed to send more bytes than the MTU is set to, so I've never tested to see whether manual message chunking is necessary or if the IDF handles it transparently. I'll try to cleanup this project in the next couple of weeks and remove anything that is unnecessary. Pretty soon I'm going to be working on a project requiring a TX and and RX BLE characteristic and just streaming data through those, so it is likely that I'll hit the MTU there and I can roll any new findings about long writes and reads back into this project.

eagi223 avatar Feb 19 '19 21:02 eagi223

FYI I asked at https://www.esp32.com/viewtopic.php?f=13&t=9345

and since no response for a week I opened an issue https://github.com/espressif/esp-idf/issues/3102

phatpaul avatar Feb 26 '19 15:02 phatpaul

Ill leave this open as a reminder to document the long-read/write and ftp service some day...

phatpaul avatar Apr 01 '19 14:04 phatpaul