DELL
2025-04-28 eb746715527db9b42740db84bb576735185e21cd
ElectLock_Monitor/src/com/dev/lock/data/ElectLock_State.java
@@ -17,6 +17,9 @@
//   public static int Reg_Count_Real = 11;      //寄存器数量
//   public static int Reg_Count_Real = 12;      //寄存器数量
   public static int Reg_Count_Real = 14;      //寄存器数量
   public static int Reg_Count_Card = 100;      //读取已授权电池卡寄存器数量
   
   
   private int lock_id;            //锁具ID[当前需要操作的锁具ID号]
@@ -54,6 +57,10 @@
   
   private int lock_open_count;   //'锁具总开启次数'
   private Date last_update_time = new Date(0);   //上一次锁具开启或关闭时间
   private long[] id_cards = new long[ElectLock_ComBase.Lock_MaxCardCount];
   private int readCount = 0;            //读取数据次数,用于读取已授权卡号
   
   public ElectLock_State() {
      
@@ -111,7 +118,26 @@
         this.last_update_time = new Date();
      }
      record_time = new Date();
      readCount ++;
      if(readCount >= 999998) {
         readCount = 0;
      }
      buffer.compact();
      return true;
   }
   public boolean putCardByteBuffer(ByteBuffer buffer,int idx) {
      if(buffer.limit() < (Reg_Count_Card*2)) {
         System.out.println("实时信息返回长度错误" + buffer.limit());
         return false;
      }
      buffer.order(ByteOrder.BIG_ENDIAN);
      buffer.position(0);
      for(int k = idx;k<(idx+50) && k < ElectLock_ComBase.Lock_MaxCardCount;k++) {
         id_cards[k] = (buffer.getInt()&0xFFFFFFFF);
      }
      return true;
   }
   
@@ -125,6 +151,23 @@
      }
   }
   
   public int getReadCount() {
      return readCount;
   }
   public long[] getId_cards() {
      return id_cards;
   }
   public void setId_cards(long[] id_cards) {
      this.id_cards = id_cards;
   }
   public int getBluetooth_st_state() {
      return bluetooth_st_state;
   }