Showing
1 changed file
with
3 additions
and
3 deletions
1 | package org.thingsboard.server.common.data.yunteng.utils; | 1 | package org.thingsboard.server.common.data.yunteng.utils; |
2 | 2 | ||
3 | -import org.thingsboard.server.common.data.yunteng.enums.TkModebusCheckType; | 3 | +import org.thingsboard.server.common.data.yunteng.enums.TkModBusCheckType; |
4 | 4 | ||
5 | public class CrcUtils { | 5 | public class CrcUtils { |
6 | /** | 6 | /** |
@@ -8,7 +8,7 @@ public class CrcUtils { | @@ -8,7 +8,7 @@ public class CrcUtils { | ||
8 | * @param buf buffer to be crc | 8 | * @param buf buffer to be crc |
9 | * @return crc result word | 9 | * @return crc result word |
10 | */ | 10 | */ |
11 | - static int alex_crc16(TkModebusCheckType algorithm, byte[] buf) { | 11 | + static int alex_crc16(TkModBusCheckType algorithm, byte[] buf) { |
12 | int i, j; | 12 | int i, j; |
13 | int c, crc = algorithm.getInit(); | 13 | int c, crc = algorithm.getInit(); |
14 | for (i = 0; i < buf.length; i++) { | 14 | for (i = 0; i < buf.length; i++) { |
@@ -29,7 +29,7 @@ public class CrcUtils { | @@ -29,7 +29,7 @@ public class CrcUtils { | ||
29 | * @param toSend string to be convert | 29 | * @param toSend string to be convert |
30 | * @return buffer with crc word, high byte if after low byte according the modbus | 30 | * @return buffer with crc word, high byte if after low byte according the modbus |
31 | */ | 31 | */ |
32 | - public static String getSendBuf(TkModebusCheckType algorithm,String toSend) { | 32 | + public static String getSendBuf(TkModBusCheckType algorithm, String toSend) { |
33 | byte[] bb = ByteUtils.hexToBytes(toSend); | 33 | byte[] bb = ByteUtils.hexToBytes(toSend); |
34 | int ri = alex_crc16(algorithm,bb); | 34 | int ri = alex_crc16(algorithm,bb); |
35 | if(!algorithm.getByteOrder()){ | 35 | if(!algorithm.getByteOrder()){ |