1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Serial port - missed no split char option. If no split char then send every

character in char mode.
This commit is contained in:
Dave C-J 2014-06-08 15:21:02 +01:00
parent 00f87cbcd6
commit 12b8fa36dc

View File

@ -117,7 +117,7 @@ module.exports = function(RED) {
var splitc = new Buffer(node.serialConfig.newline.replace("\\n","\n").replace("\\r","\r").replace("\\t","\t").replace("\\e","\e").replace("\\f","\f").replace("\\0","\0")); var splitc = new Buffer(node.serialConfig.newline.replace("\\n","\n").replace("\\r","\r").replace("\\t","\t").replace("\\e","\e").replace("\\f","\f").replace("\\0","\0"));
this.port.on('data', function(msg) { this.port.on('data', function(msg) {
// single char buffer // single char buffer
if (node.serialConfig.newline == 0) { if ((node.serialConfig.newline == 0)||(node.serialConfig.newline == "")) {
node.send({"payload": new Buffer([msg])}); node.send({"payload": new Buffer([msg])});
} }
else { else {