Skip to content

Commit

Permalink
Update ldds75.js (#634)
Browse files Browse the repository at this point in the history
Changed if(len==5) to if(len==8). The length of the payload should always be 8 bytes.

Co-authored-by: Jaime Trinidad <[email protected]>
  • Loading branch information
Jinajon and Jaime-Trinidad committed Jul 4, 2023
1 parent 0e42be4 commit 618d2ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/dragino/ldds75.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function decodeUplink(input) {
var interrupt = input.bytes[len-1];
switch (input.fPort) {
case 2:
if(len==5)
if(len==8)
{
data.value=input.bytes[2]<<8 | input.bytes[3];
data.distance=(value);//distance,units:mm
Expand All @@ -25,4 +25,4 @@ default:
errors: ["unknown FPort"]
}
}
}
}

0 comments on commit 618d2ff

Please sign in to comment.