コード例 #1
0
 public int getBatteryGroupBatteryNumber() {
   if (batteryGroupBatteryNumber == null) return 0;
   int firstb = BMSUtil.convertByteToBCD(batteryGroupBatteryNumber[0]) * 100;
   int secondb = BMSUtil.convertByteToBCD(batteryGroupBatteryNumber[1]);
   return firstb + secondb;
 }
コード例 #2
0
 /**
  * At unit uAh = 0.1mAh
  *
  * @return
  */
 public double getBatteryGroupStandardCapacity() {
   return BMSUtil.calculateHalfByteBCDFromByteArrayAtBaseTen(batteryGroupStandardCapacity);
 }
コード例 #3
0
 /**
  * At Unit 100 uV = 0.1mV
  *
  * @return
  */
 public double getBatteryGroupStandardVoltage() {
   return BMSUtil.calculateHalfByteBCDFromByteArrayAtBaseTen(batteryGroupStandardVoltage);
 }
コード例 #4
0
 public BatteryGroupInfoPacket(BMSPacket packet) {
   super(packet);
   setBatteryGroupStandardCapacity(BMSUtil.extractByteArray(body, 0, 5));
   setBatteryGroupStandardVoltage(BMSUtil.extractByteArray(body, 5, 5));
   setBatteryGroupBatteryNumber(new byte[] {body[10], body[11]});
 }