njs-modbus 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -647,11 +647,11 @@ class RtuApplicationLayer extends AbstractApplicationLayer {
|
|
|
647
647
|
return;
|
|
648
648
|
}
|
|
649
649
|
if (typeof res === 'number') {
|
|
650
|
-
if (
|
|
650
|
+
if (frame.data.length < res) {
|
|
651
651
|
callback(new Error('Insufficient data length'));
|
|
652
652
|
return;
|
|
653
653
|
}
|
|
654
|
-
if (
|
|
654
|
+
if (frame.data.length !== res) {
|
|
655
655
|
callback(new Error('Invalid response'));
|
|
656
656
|
return;
|
|
657
657
|
}
|
|
@@ -818,11 +818,11 @@ class AsciiApplicationLayer extends AbstractApplicationLayer {
|
|
|
818
818
|
return;
|
|
819
819
|
}
|
|
820
820
|
if (typeof res === 'number') {
|
|
821
|
-
if (
|
|
821
|
+
if (frame.data.length < res) {
|
|
822
822
|
callback(new Error('Insufficient data length'));
|
|
823
823
|
return;
|
|
824
824
|
}
|
|
825
|
-
if (
|
|
825
|
+
if (frame.data.length !== res) {
|
|
826
826
|
callback(new Error('Invalid response'));
|
|
827
827
|
return;
|
|
828
828
|
}
|
|
@@ -934,11 +934,11 @@ class TcpApplicationLayer extends AbstractApplicationLayer {
|
|
|
934
934
|
return;
|
|
935
935
|
}
|
|
936
936
|
if (typeof res === 'number') {
|
|
937
|
-
if (
|
|
937
|
+
if (frame.data.length < res) {
|
|
938
938
|
callback(new Error('Insufficient data length'));
|
|
939
939
|
return;
|
|
940
940
|
}
|
|
941
|
-
if (
|
|
941
|
+
if (frame.data.length !== res) {
|
|
942
942
|
callback(new Error('Invalid response'));
|
|
943
943
|
return;
|
|
944
944
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -645,11 +645,11 @@ class RtuApplicationLayer extends AbstractApplicationLayer {
|
|
|
645
645
|
return;
|
|
646
646
|
}
|
|
647
647
|
if (typeof res === 'number') {
|
|
648
|
-
if (
|
|
648
|
+
if (frame.data.length < res) {
|
|
649
649
|
callback(new Error('Insufficient data length'));
|
|
650
650
|
return;
|
|
651
651
|
}
|
|
652
|
-
if (
|
|
652
|
+
if (frame.data.length !== res) {
|
|
653
653
|
callback(new Error('Invalid response'));
|
|
654
654
|
return;
|
|
655
655
|
}
|
|
@@ -816,11 +816,11 @@ class AsciiApplicationLayer extends AbstractApplicationLayer {
|
|
|
816
816
|
return;
|
|
817
817
|
}
|
|
818
818
|
if (typeof res === 'number') {
|
|
819
|
-
if (
|
|
819
|
+
if (frame.data.length < res) {
|
|
820
820
|
callback(new Error('Insufficient data length'));
|
|
821
821
|
return;
|
|
822
822
|
}
|
|
823
|
-
if (
|
|
823
|
+
if (frame.data.length !== res) {
|
|
824
824
|
callback(new Error('Invalid response'));
|
|
825
825
|
return;
|
|
826
826
|
}
|
|
@@ -932,11 +932,11 @@ class TcpApplicationLayer extends AbstractApplicationLayer {
|
|
|
932
932
|
return;
|
|
933
933
|
}
|
|
934
934
|
if (typeof res === 'number') {
|
|
935
|
-
if (
|
|
935
|
+
if (frame.data.length < res) {
|
|
936
936
|
callback(new Error('Insufficient data length'));
|
|
937
937
|
return;
|
|
938
938
|
}
|
|
939
|
-
if (
|
|
939
|
+
if (frame.data.length !== res) {
|
|
940
940
|
callback(new Error('Invalid response'));
|
|
941
941
|
return;
|
|
942
942
|
}
|