-
Couldn't load subscription status.
- Fork 1.3k
Description
BLE provides different types of writes (with or without responses as an additional "option"), like normal and extended writes. Normal writes are "immediate" writes whereas extended writes usually carry a longer payload stream and induce one-or-more partial write messages (...PREPARE_WRITE...) concluded with an execute-write message (sort of like a sql-database commit).
At least for the nordic and espressif ports I didn't notice any exposed options relating to these write types. It would be great if there was a (unified/consistent across ports) way to "select" which type of write shall by invoked. I presume it would probably have to be some sort of configuration based on filters/criteria so that the selection (of which type of write to call in a given context) can be handled consistently. Also, since this is a fairly low level context, it's probably not something that lends itself to being exposed via a callback handler to decide (by return code?) which type of write should be conducted.
As a side note: The project context that made me stumble upon this is a BLE device that only accepts "extended" writes (in all contexts), so my project-specific solution was changing bleio_gattc_write() in ports/espressif/common-hal/_bleio/init.c (patch is linked below - but I think this could be of general interest (but probably only for a small fraction of all circuitpython users).