Sorry, I'd been thinking about setServices for some reason (hence the EVT_HVX).
Annoyingly it's the Web Bluetooth spec so I can't just change the way it works (eg for the event to have a data field for current data).
But actually the fix should be quite easy. Just changing jsiQueueObjectCallbacks to jsiExecuteObjectCallbacks - as you say it'll just defer the processing until after.
If that causes issues we could queue a function call that looks a bit like:
function handleData(characteristic, data) {
characteristic.value = data;
characteristic.emit('characteristicvaluechanged',{target:characteristic});
}
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ahh - that's right! Thank you!
Sorry, I'd been thinking about
setServices
for some reason (hence theEVT_HVX
).Annoyingly it's the Web Bluetooth spec so I can't just change the way it works (eg for the event to have a
data
field for current data).But actually the fix should be quite easy. Just changing
jsiQueueObjectCallbacks
tojsiExecuteObjectCallbacks
- as you say it'll just defer the processing until after.If that causes issues we could queue a function call that looks a bit like: