From 7d6f70545a6d77ab43c2b3a313cf758543eea9ab Mon Sep 17 00:00:00 2001 From: Dave C-J Date: Sun, 8 Jun 2014 15:27:15 +0100 Subject: [PATCH] and honour text (utf8) mode in single char mode. aaargh. --- nodes/core/io/25-serial.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nodes/core/io/25-serial.js b/nodes/core/io/25-serial.js index 90f2648fd..3785e53d5 100644 --- a/nodes/core/io/25-serial.js +++ b/nodes/core/io/25-serial.js @@ -118,7 +118,8 @@ module.exports = function(RED) { this.port.on('data', function(msg) { // single char buffer if ((node.serialConfig.newline == 0)||(node.serialConfig.newline == "")) { - node.send({"payload": new Buffer([msg])}); + if (node.serialConfig.bin !== "bin") { node.send({"payload": String.fromCharCode(msg)}); } + else { node.send({"payload": new Buffer([msg])}); } } else { // do the timer thing