Enhance console by a new key to clear line and echo off in one go #6014
Replies: 1 comment
-
Posted at 2018-11-09 by @gfwilliams Am I right in thinking that you only do it once when you initially connect? Do you have the ability to write code for the Espruino device itself? It'd be pretty easy to add code to do the echo(0) and clear line automatically when Bluetooth was connected, meaning you don't need to send anything. I'm a bit worried about adding stuff like that because if anyone ever enters the key by accident (eg copy pasting something with some dodgy char codes in) at any point it basically makes the board seem like it's crashed until it is rebooted :( Posted at 2018-11-09 by Wilberforce Or define on the board:
Then you can do: Posted at 2018-11-11 by Steffen Thanks for your replies. Although I'm able to make code changes I don't want to run propriatary code builds. A year from now I might have lost interest in making own Espruino builds (not in Espruino) - then I'll loose either the official Espruino improvements or my propriatary enhancements. Posted at 2018-11-12 by @gfwilliams Did you know you can prefix a line with Posted at 2018-11-12 by Steffen Yes, I've made good experience prefixing all commands with Posted at 2018-11-13 by @gfwilliams
Yes, that'll be the issue. Posted at 2018-11-13 by Steffen Wow, a basic JS technique I didn't even think of. This makes the introduction of a new echo-off-char really unnecessary. Thank you so much Gordon for engaging in this discussion! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-11-08 by Steffen
When connecting to Espruino programmatically I send for example
'\x15\x10echo(0);print(E.getTemperature())\n'
This works well, but besides looking a little ugly it is a big waste when connected over BLE.
If the were a key, say \x1f, that makes jsiHandleChar
the command sent became
'\x1fprint(E.getTemperature())\n'
.This saves 9 bytes (almost halve of one BLE packet's payload, and probably a little overhead for parsing and interpreting the echo(0) call.
Is this something to consider as an enhancement?
Regards, Steffen
Beta Was this translation helpful? Give feedback.
All reactions