Skip to content

Commit

Permalink
Fix #34.
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Kochedykov authored and kochedykov committed Feb 14, 2019
1 parent 2abc6ed commit ad405ad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/com/intelligt/modbus/jlibmodbus/utils/DataUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,14 @@ public static int dwordHigh(long l) {
}

public static int wordFromBytes(int l, int h) {
return (l & 0xff) & ((h & 0xff) << 8);
return (l & 0xff) | ((h & 0xff) << 8);
}

public static int dwordFromWords(int l, int h) {
return (l & 0xffff) & ((h & 0xffff) << 16);
return (l & 0xffff) | ((h & 0xffff) << 16);
}

public static long Int64FromDwords(int l, int h) {
return ((long) l & 0xffffffff) & (((long) h & 0xffffffff) << 32);
return ((long) l & 0xffffffff) | (((long) h & 0xffffffff) << 32);
}
}

0 comments on commit ad405ad

Please sign in to comment.