File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 11/**
2- *
2+ *
33 * A network based REPL (Read–eval–print loop).
4- *
4+ *
55 * Usage:
66 * netcat [IP-ADDRESS] 1234
7- *
7+ *
88 * After successful connection a prompt appears: '>'
99 * Then type [USER]:[PASS] (the defaults are esp32:esp32)
1010 * After successful authentication you will see "====> authorized."
11- *
12- * After that you can type every JS expression, which then gets
13- * evaluated in esp32-javascript and the result is printed.
14- *
11+ *
12+ * After that you can type every JS expression, which then gets
13+ * evaluated in esp32-javascript and the result is printed.
14+ *
1515 */
1616var configManager = require ( "esp32-javascript/config" ) ;
1717
1818var PROMPT = "> " ;
19+ var textDecoder = new TextDecoder ( ) ;
1920
2021function writeOutput ( socket , result ) {
2122 socket . write ( result ) ;
@@ -27,7 +28,8 @@ require("socket-events").sockListen(
2728 function ( socket ) {
2829 var authorized = false ;
2930 var _ = undefined ;
30- socket . onData = function ( data ) {
31+ socket . onData = function ( buffer ) {
32+ var data = textDecoder . decode ( buffer ) ;
3133 var result = null ;
3234 if ( ! authorized ) {
3335 var accessConfig = configManager . config . access ;
You can’t perform that action at this time.
0 commit comments