Ahh - I'm afraid that functionality isn't built in to EspruinoHub yet.
You might be able to do a write to /ble/write/_address_/nus/nus_tx followed by a write (contents don't matter) to /ble/read/_address_/nus/nus_rx after a delay, and then listen on /ble/data/_address_/nus/nus_rx but that would only return the last 18 characters or so of response (plus some formatting characters).
To make it better you could ensure you send "\x10print(your_function())" (that's character code 16 at the start) - which will ensure that the data you receive is only the data your function returned.
However in this case, you're probably better off using contrib-blue-uart - did you get it working?
The advice above ("\x10print(your_function())") will still help you though.
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 - I'm afraid that functionality isn't built in to EspruinoHub yet.
You might be able to do a write to
/ble/write/_address_/nus/nus_tx
followed by a write (contents don't matter) to/ble/read/_address_/nus/nus_rx
after a delay, and then listen on/ble/data/_address_/nus/nus_rx
but that would only return the last 18 characters or so of response (plus some formatting characters).To make it better you could ensure you send
"\x10print(your_function())"
(that's character code 16 at the start) - which will ensure that the data you receive is only the data your function returned.However in this case, you're probably better off using
contrib-blue-uart
- did you get it working?The advice above (
"\x10print(your_function())"
) will still help you though.