xiuwei 3 年之前
父节点
当前提交
c5c970211d

+ 5 - 2
protocol-iec104/src/main/java/wei/yigulu/iec104/apdumodel/Cot.java

@@ -28,9 +28,12 @@ public class Cot {
 	 */
 	public Cot readByte(Byte value) {
 		original = value;
-		test=value>>7==1;
-		negativeConfirm=(value&0x40)>>6==1;
+		test=(original&0xff)>>7==1;
+		negativeConfirm=(original&0x40)>>6==1;
 		not=value&0x3f;
+		System.out.println(test);
+		System.out.println(negativeConfirm);
+		System.out.println(not);
 		return this;
 	}
 

+ 1 - 1
protocol-iec104/src/main/java/wei/yigulu/iec104/apdumodel/Vsq.java

@@ -33,7 +33,7 @@ public class Vsq {
 	public Vsq readByte(Byte value) {
 		original = value;
 		//可变结构限定词,转为二进制后获取第8位
-		sq = value>>7;
+		sq = (value&0xff)>>7;
 		num = value&0x7f;
 		return this;
 	}