Thanks Luiz, Maybe I don't understand. In bluez 5.39, prep+AF8-write+AF8-cb would send BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-RSP at the end of the function. In the new code, prep+AF8-write+AF8-complete+AF8-cb is supposed to send BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-RSP but prep+AF8-write+AF8-complete+AF8-cb is never called from gatt+AF8-db+AF8-attribute+AF8-write. Who is supposed to send the BT+AF8-ATT+AF8-OP+AF8-PREP+AF8-WRITE+AF8-RSP since prep+AF8-write+AF8-complete+AF8-cb is not getting called? With the patch, prep+AF8-write+AF8-complete+AF8-cb will get called.