timeoutMs: how many millis to wait before assuming code failed. If not specified, device.evalTimeoutMs is used as a default.
assumeExlusive: assume device is not producing any other output than for our evaluation
A random string is created to pair eval requests and responses. code will be run on the device, with the result
wrapped in JSON, and in turn wrapped in a object that is sent back.
The actual code that gets sent to the device is then:
\x10${evalReplyPrefix}(JSON.stringify({reply:"${id}", result:JSON.stringify(${code})}))\n
For example, it might end up being:
\x10Bluetooth.println(JSON.stringify({reply: "a35gP", result: "{ 'x': '10' }" }))\n
Evaluates some code on an Espruino device.
Options:
device.evalTimeoutMs
is used as a default.A random string is created to pair eval requests and responses.
code
will be run on the device, with the result wrapped in JSON, and in turn wrapped in a object that is sent back.The actual code that gets sent to the device is then:
\x10${evalReplyPrefix}(JSON.stringify({reply:"${id}", result:JSON.stringify(${code})}))\n
For example, it might end up being:
\x10Bluetooth.println(JSON.stringify({reply: "a35gP", result: "{ 'x': '10' }" }))\n