Write a function on Puck.js, maybe function myFunction() { ... }
Then send an MQTT packet like "myFunction()\n" to /ble/write/de:vi:ce:ad:dr/nus/nus_tx
If you're interested in what is sent as a reply and don't want Espruino polluting the response with characters like > for the REPL, just prefix the line with char code 16:
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.
Ok, all you do is:
function myFunction() { ... }
"myFunction()\n"
to/ble/write/de:vi:ce:ad:dr/nus/nus_tx
If you're interested in what is sent as a reply and don't want Espruino polluting the response with characters like
>
for the REPL, just prefix the line with char code 16:"\x10myFunction()\n"