serialport addchar whenever needed - not only in char mode

This commit is contained in:
Dave Conway-Jones 2019-08-30 14:47:24 +01:00
parent b0c8b0f2c6
commit 1f0aa6908c
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4
2 changed files with 3 additions and 3 deletions

View File

@ -233,9 +233,9 @@ module.exports = function(RED) {
else {
payload = payload.toString();
}
if ((spliton === "char") && (addchar !== "")) { payload += addchar; }
if (addchar !== "") { payload += addchar; }
}
else if ((spliton === "char") && (addchar !== "")) {
else if (addchar !== "") {
payload = Buffer.concat([payload,addchar]);
}
return payload;

View File

@ -1,6 +1,6 @@
{
"name" : "node-red-node-serialport",
"version" : "0.8.5",
"version" : "0.8.6",
"description" : "Node-RED nodes to talk to serial ports",
"dependencies" : {
"serialport" : "^7.1.5"