From 16158b89f0223db6a4501e5263f6d2817b562b09 Mon Sep 17 00:00:00 2001
From: Administrator <zhubaomin>
Date: 星期五, 14 六月 2024 13:40:36 +0800
Subject: [PATCH] Merge branch 'master' of http://8.140.179.55:20000/r/pipIrr-SV

---
 pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java
index 8a5f836..2f087bc 100644
--- a/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java
+++ b/pipIrr-platform/pipIrr-common/src/main/java/com/dy/common/mw/protocol/p206V1_0_0/parse/global/GlParse.java
@@ -11,25 +11,31 @@
     private static final Logger log = LogManager.getLogger(GlParse.class);
 
     public static DataAlarmVo parseAlarm(byte[] bs, short index){
+        /*
+        11011111 (DF)  +  11111001 (F9)
+        鎶ヨ:
+        钃勭數姹犵數鍘嬶細鎶ヨ
+        婕忔崯锛氭姤璀�
+        浠〃锛氭姤璀�
+        闃�闂細鎶ヨ
+        */
         DataAlarmVo avo = new DataAlarmVo() ;
-        byte b = bs[index] ;
-        index++ ;
-        avo.batteryVolt = (byte)(b & 0x2 >> 1) ;
-        avo.loss = (byte)(b & 0x8 >> 3) ;
-        avo.meter = (byte)(b & 0x20 >> 5) ;
+        byte b = bs[index + 1] ;
+        avo.batteryVolt = (byte)((b & 0x2) >> 1) ;
+        avo.meter = (byte)((b & 0x20) >> 5) ;
 
         b = bs[index] ;
-        avo.valve = (byte)(b & 0x20 >> 5) ;
+        avo.loss = (byte)((b & 0x2) >> 1) ;
+        avo.valve = (byte)((b & 0x4) >> 2) ;
         return avo ;
     }
 
     public static DataStateVo parseState(byte[] bs, short index){
         DataStateVo avo = new DataStateVo() ;
-        byte b = bs[index] ;
-        index++ ;
-        avo.icCard = (byte)(b & 0x4 >> 2) ;
-        avo.working = (byte)(b & 0x8 >> 3) ;
-        avo.valve = (byte)(b & 0x20 >> 5) ;
+        byte b = bs[index + 1] ;
+        avo.icCard = (byte)((b & 0x4) >> 2) ;
+        avo.working = (byte)((b & 0x10) >> 4) ;
+        avo.powerType = (byte)((b & 0x40) >> 6) ;
         return avo ;
     }
 

--
Gitblit v1.8.0