public int getBatteryGroupBatteryNumber() { if (batteryGroupBatteryNumber == null) return 0; int firstb = BMSUtil.convertByteToBCD(batteryGroupBatteryNumber[0]) * 100; int secondb = BMSUtil.convertByteToBCD(batteryGroupBatteryNumber[1]); return firstb + secondb; }
/** * At unit uAh = 0.1mAh * * @return */ public double getBatteryGroupStandardCapacity() { return BMSUtil.calculateHalfByteBCDFromByteArrayAtBaseTen(batteryGroupStandardCapacity); }
/** * At Unit 100 uV = 0.1mV * * @return */ public double getBatteryGroupStandardVoltage() { return BMSUtil.calculateHalfByteBCDFromByteArrayAtBaseTen(batteryGroupStandardVoltage); }
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]}); }