Skip to content

Commit

Permalink
refactored utils and added initial Sacredsun BMS binding
Browse files Browse the repository at this point in the history
  • Loading branch information
ai-republic committed Nov 10, 2024
1 parent 508b03a commit 4587028
Show file tree
Hide file tree
Showing 45 changed files with 1,348 additions and 911 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import com.airepublic.bmstoinverter.core.Port;
import com.airepublic.bmstoinverter.core.bms.data.Alarm;
import com.airepublic.bmstoinverter.core.bms.data.BatteryPack;
import com.airepublic.bmstoinverter.core.util.Util;
import com.airepublic.bmstoinverter.core.util.BitUtil;

/**
* The class to handle CAN messages from a BYD {@link BMS}.
Expand Down Expand Up @@ -104,210 +104,210 @@ private void readAlarms(final BatteryPack pack, final ByteBuffer data) {
// warnings
byte bits = data.get(4);

if (Util.bit(bits, 0)) {
if (BitUtil.bit(bits, 0)) {
pack.setAlarm(Alarm.FAILURE_OTHER, AlarmLevel.WARNING);
}

if (Util.bit(bits, 1)) {
if (BitUtil.bit(bits, 1)) {
pack.setAlarm(Alarm.FAILURE_OTHER, AlarmLevel.NONE);
}

if (Util.bit(bits, 2)) {
if (BitUtil.bit(bits, 2)) {
pack.setAlarm(Alarm.PACK_VOLTAGE_HIGH, AlarmLevel.WARNING);
}

if (Util.bit(bits, 3)) {
if (BitUtil.bit(bits, 3)) {
pack.setAlarm(Alarm.PACK_VOLTAGE_HIGH, AlarmLevel.NONE);
}

if (Util.bit(bits, 4)) {
if (BitUtil.bit(bits, 4)) {
pack.setAlarm(Alarm.PACK_VOLTAGE_LOW, AlarmLevel.WARNING);
}

if (Util.bit(bits, 5)) {
if (BitUtil.bit(bits, 5)) {
pack.setAlarm(Alarm.PACK_VOLTAGE_LOW, AlarmLevel.NONE);
}

if (Util.bit(bits, 6)) {
if (BitUtil.bit(bits, 6)) {
pack.setAlarm(Alarm.PACK_TEMPERATURE_HIGH, AlarmLevel.WARNING);
}

if (Util.bit(bits, 7)) {
if (BitUtil.bit(bits, 7)) {
pack.setAlarm(Alarm.PACK_TEMPERATURE_HIGH, AlarmLevel.NONE);
}

bits = data.get(5);

if (Util.bit(bits, 0)) {
if (BitUtil.bit(bits, 0)) {
pack.setAlarm(Alarm.PACK_TEMPERATURE_LOW, AlarmLevel.WARNING);
}

if (Util.bit(bits, 1)) {
if (BitUtil.bit(bits, 1)) {
pack.setAlarm(Alarm.PACK_TEMPERATURE_LOW, AlarmLevel.NONE);
}

if (Util.bit(bits, 2)) {
if (BitUtil.bit(bits, 2)) {
pack.setAlarm(Alarm.CHARGE_TEMPERATURE_HIGH, AlarmLevel.WARNING);
}

if (Util.bit(bits, 3)) {
if (BitUtil.bit(bits, 3)) {
pack.setAlarm(Alarm.CHARGE_TEMPERATURE_HIGH, AlarmLevel.NONE);
}

if (Util.bit(bits, 4)) {
if (BitUtil.bit(bits, 4)) {
pack.setAlarm(Alarm.CHARGE_TEMPERATURE_LOW, AlarmLevel.WARNING);
}

if (Util.bit(bits, 5)) {
if (BitUtil.bit(bits, 5)) {
pack.setAlarm(Alarm.CHARGE_TEMPERATURE_LOW, AlarmLevel.NONE);
}

if (Util.bit(bits, 6)) {
if (BitUtil.bit(bits, 6)) {
pack.setAlarm(Alarm.PACK_CURRENT_HIGH, AlarmLevel.WARNING);
}

if (Util.bit(bits, 7)) {
if (BitUtil.bit(bits, 7)) {
pack.setAlarm(Alarm.PACK_CURRENT_HIGH, AlarmLevel.NONE);
}

bits = data.get(6);

if (Util.bit(bits, 0)) {
if (BitUtil.bit(bits, 0)) {
pack.setAlarm(Alarm.CHARGE_CURRENT_HIGH, AlarmLevel.WARNING);
}

if (Util.bit(bits, 1)) {
if (BitUtil.bit(bits, 1)) {
pack.setAlarm(Alarm.CHARGE_CURRENT_HIGH, AlarmLevel.NONE);
}

if (Util.bit(bits, 4)) {
if (BitUtil.bit(bits, 4)) {
pack.setAlarm(Alarm.FAILURE_SHORT_CIRCUIT_PROTECTION, AlarmLevel.WARNING);
}

if (Util.bit(bits, 5)) {
if (BitUtil.bit(bits, 5)) {
pack.setAlarm(Alarm.FAILURE_SHORT_CIRCUIT_PROTECTION, AlarmLevel.NONE);
}

if (Util.bit(bits, 6) && pack.getAlarmLevel(Alarm.FAILURE_OTHER) != AlarmLevel.WARNING) {
if (BitUtil.bit(bits, 6) && pack.getAlarmLevel(Alarm.FAILURE_OTHER) != AlarmLevel.WARNING) {
pack.setAlarm(Alarm.FAILURE_OTHER, AlarmLevel.WARNING);
}

if (Util.bit(bits, 7)) {
if (BitUtil.bit(bits, 7)) {
pack.setAlarm(Alarm.FAILURE_OTHER, AlarmLevel.NONE);
}

bits = data.get(7);

if (Util.bit(bits, 0)) {
if (BitUtil.bit(bits, 0)) {
pack.setAlarm(Alarm.CELL_VOLTAGE_DIFFERENCE_HIGH, AlarmLevel.WARNING);
}

if (Util.bit(bits, 1)) {
if (BitUtil.bit(bits, 1)) {
pack.setAlarm(Alarm.CELL_VOLTAGE_DIFFERENCE_HIGH, AlarmLevel.NONE);
}

// alarms
bits = data.get(0);

if (Util.bit(bits, 0)) {
if (BitUtil.bit(bits, 0)) {
pack.setAlarm(Alarm.FAILURE_OTHER, AlarmLevel.ALARM);
}

if (Util.bit(bits, 1)) {
if (BitUtil.bit(bits, 1)) {
pack.setAlarm(Alarm.FAILURE_OTHER, AlarmLevel.NONE);
}

if (Util.bit(bits, 2)) {
if (BitUtil.bit(bits, 2)) {
pack.setAlarm(Alarm.PACK_VOLTAGE_HIGH, AlarmLevel.ALARM);
}

if (Util.bit(bits, 3)) {
if (BitUtil.bit(bits, 3)) {
pack.setAlarm(Alarm.PACK_VOLTAGE_HIGH, AlarmLevel.NONE);
}

if (Util.bit(bits, 4)) {
if (BitUtil.bit(bits, 4)) {
pack.setAlarm(Alarm.PACK_VOLTAGE_LOW, AlarmLevel.ALARM);
}

if (Util.bit(bits, 5)) {
if (BitUtil.bit(bits, 5)) {
pack.setAlarm(Alarm.PACK_VOLTAGE_LOW, AlarmLevel.NONE);
}

if (Util.bit(bits, 6)) {
if (BitUtil.bit(bits, 6)) {
pack.setAlarm(Alarm.PACK_TEMPERATURE_HIGH, AlarmLevel.ALARM);
}

if (Util.bit(bits, 7)) {
if (BitUtil.bit(bits, 7)) {
pack.setAlarm(Alarm.PACK_TEMPERATURE_HIGH, AlarmLevel.NONE);
}

bits = data.get(1);

if (Util.bit(bits, 0)) {
if (BitUtil.bit(bits, 0)) {
pack.setAlarm(Alarm.PACK_TEMPERATURE_LOW, AlarmLevel.ALARM);
}

if (Util.bit(bits, 1)) {
if (BitUtil.bit(bits, 1)) {
pack.setAlarm(Alarm.PACK_TEMPERATURE_LOW, AlarmLevel.NONE);
}

if (Util.bit(bits, 2)) {
if (BitUtil.bit(bits, 2)) {
pack.setAlarm(Alarm.CHARGE_TEMPERATURE_HIGH, AlarmLevel.ALARM);
}

if (Util.bit(bits, 3)) {
if (BitUtil.bit(bits, 3)) {
pack.setAlarm(Alarm.CHARGE_TEMPERATURE_HIGH, AlarmLevel.NONE);
}

if (Util.bit(bits, 4)) {
if (BitUtil.bit(bits, 4)) {
pack.setAlarm(Alarm.CHARGE_TEMPERATURE_LOW, AlarmLevel.ALARM);
}

if (Util.bit(bits, 5)) {
if (BitUtil.bit(bits, 5)) {
pack.setAlarm(Alarm.CHARGE_TEMPERATURE_LOW, AlarmLevel.NONE);
}

if (Util.bit(bits, 6)) {
if (BitUtil.bit(bits, 6)) {
pack.setAlarm(Alarm.PACK_CURRENT_HIGH, AlarmLevel.ALARM);
}

if (Util.bit(bits, 7)) {
if (BitUtil.bit(bits, 7)) {
pack.setAlarm(Alarm.PACK_CURRENT_HIGH, AlarmLevel.NONE);
}

bits = data.get(2);

if (Util.bit(bits, 0)) {
if (BitUtil.bit(bits, 0)) {
pack.setAlarm(Alarm.CHARGE_CURRENT_HIGH, AlarmLevel.ALARM);
}

if (Util.bit(bits, 1)) {
if (BitUtil.bit(bits, 1)) {
pack.setAlarm(Alarm.CHARGE_CURRENT_HIGH, AlarmLevel.NONE);
}

if (Util.bit(bits, 4)) {
if (BitUtil.bit(bits, 4)) {
pack.setAlarm(Alarm.FAILURE_SHORT_CIRCUIT_PROTECTION, AlarmLevel.ALARM);
}

if (Util.bit(bits, 5)) {
if (BitUtil.bit(bits, 5)) {
pack.setAlarm(Alarm.FAILURE_SHORT_CIRCUIT_PROTECTION, AlarmLevel.NONE);
}

if (Util.bit(bits, 6) && pack.getAlarmLevel(Alarm.FAILURE_OTHER) != AlarmLevel.ALARM) {
if (BitUtil.bit(bits, 6) && pack.getAlarmLevel(Alarm.FAILURE_OTHER) != AlarmLevel.ALARM) {
pack.setAlarm(Alarm.FAILURE_OTHER, AlarmLevel.ALARM);
}

if (Util.bit(bits, 7)) {
if (BitUtil.bit(bits, 7)) {
pack.setAlarm(Alarm.FAILURE_OTHER, AlarmLevel.NONE);
}

bits = data.get(3);

if (Util.bit(bits, 0)) {
if (BitUtil.bit(bits, 0)) {
pack.setAlarm(Alarm.CELL_VOLTAGE_DIFFERENCE_HIGH, AlarmLevel.ALARM);
}

if (Util.bit(bits, 1)) {
if (BitUtil.bit(bits, 1)) {
pack.setAlarm(Alarm.CELL_VOLTAGE_DIFFERENCE_HIGH, AlarmLevel.NONE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import com.airepublic.bmstoinverter.core.bms.data.Alarm;
import com.airepublic.bmstoinverter.core.bms.data.BatteryPack;
import com.airepublic.bmstoinverter.core.bms.data.EnergyStorage;
import com.airepublic.bmstoinverter.core.util.Util;
import com.airepublic.bmstoinverter.core.util.BitUtil;

/**
* The handler to interpret the {@link DalyMessage} and update the application wide
Expand Down Expand Up @@ -266,7 +266,7 @@ private void getStatusInfo(final DalyMessage msg, final BMS bms) throws IOExcept
// data byte 4 represents the 8 bits as booleans of the states of the Digital IO
final byte dioBits = msg.data.get();
for (int i = 0; i < 8; i++) {
battery.dIO[i] = Util.bit(dioBits, i);
battery.dIO[i] = BitUtil.bit(dioBits, i);
}

// data bytes 5-6 BMS cycles
Expand Down Expand Up @@ -356,7 +356,7 @@ private void getCellBalanceState(final DalyMessage msg, final BMS bms) throws IO

// read the cell balance state of the next 8 cells
for (int j = 0; j < 8; j++) {
final boolean state = Util.bit(byteValue, j);
final boolean state = BitUtil.bit(byteValue, j);
battery.cellBalanceState[cellNo] = state;
cellNo++;

Expand Down Expand Up @@ -395,65 +395,65 @@ private void getFailureCodes(final DalyMessage msg, final BMS bms) throws IOExce

byte byteValue = msg.data.get(0);
/* 0x00 */
battery.setAlarm(Alarm.CELL_VOLTAGE_HIGH, getAlarmLevel(Util.bits(byteValue, 0, 2)));
battery.setAlarm(Alarm.CELL_VOLTAGE_LOW, getAlarmLevel(Util.bits(byteValue, 2, 2)));
battery.setAlarm(Alarm.PACK_VOLTAGE_HIGH, getAlarmLevel(Util.bits(byteValue, 4, 2)));
battery.setAlarm(Alarm.PACK_VOLTAGE_LOW, getAlarmLevel(Util.bits(byteValue, 6, 2)));
battery.setAlarm(Alarm.CELL_VOLTAGE_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 0, 2)));
battery.setAlarm(Alarm.CELL_VOLTAGE_LOW, getAlarmLevel(BitUtil.bits(byteValue, 2, 2)));
battery.setAlarm(Alarm.PACK_VOLTAGE_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 4, 2)));
battery.setAlarm(Alarm.PACK_VOLTAGE_LOW, getAlarmLevel(BitUtil.bits(byteValue, 6, 2)));

/* 0x01 */
byteValue = msg.data.get(1);
battery.setAlarm(Alarm.CHARGE_TEMPERATURE_HIGH, getAlarmLevel(Util.bits(byteValue, 0, 2)));
battery.setAlarm(Alarm.CHARGE_TEMPERATURE_LOW, getAlarmLevel(Util.bits(byteValue, 2, 2)));
battery.setAlarm(Alarm.DISCHARGE_TEMPERATURE_HIGH, getAlarmLevel(Util.bits(byteValue, 4, 2)));
battery.setAlarm(Alarm.DISCHARGE_TEMPERATURE_LOW, getAlarmLevel(Util.bits(byteValue, 6, 2)));
battery.setAlarm(Alarm.CHARGE_TEMPERATURE_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 0, 2)));
battery.setAlarm(Alarm.CHARGE_TEMPERATURE_LOW, getAlarmLevel(BitUtil.bits(byteValue, 2, 2)));
battery.setAlarm(Alarm.DISCHARGE_TEMPERATURE_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 4, 2)));
battery.setAlarm(Alarm.DISCHARGE_TEMPERATURE_LOW, getAlarmLevel(BitUtil.bits(byteValue, 6, 2)));

/* 0x02 */
byteValue = msg.data.get(2);
battery.setAlarm(Alarm.CHARGE_CURRENT_HIGH, getAlarmLevel(Util.bits(byteValue, 0, 2)));
battery.setAlarm(Alarm.DISCHARGE_CURRENT_HIGH, getAlarmLevel(Util.bits(byteValue, 2, 2)));
battery.setAlarm(Alarm.SOC_HIGH, getAlarmLevel(Util.bits(byteValue, 4, 2)));
battery.setAlarm(Alarm.SOC_LOW, getAlarmLevel(Util.bits(byteValue, 6, 2)));
battery.setAlarm(Alarm.CHARGE_CURRENT_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 0, 2)));
battery.setAlarm(Alarm.DISCHARGE_CURRENT_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 2, 2)));
battery.setAlarm(Alarm.SOC_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 4, 2)));
battery.setAlarm(Alarm.SOC_LOW, getAlarmLevel(BitUtil.bits(byteValue, 6, 2)));

/* 0x03 */
byteValue = msg.data.get(3);
battery.setAlarm(Alarm.CELL_VOLTAGE_DIFFERENCE_HIGH, getAlarmLevel(Util.bits(byteValue, 0, 2)));
battery.setAlarm(Alarm.TEMPERATURE_SENSOR_DIFFERENCE_HIGH, getAlarmLevel(Util.bits(byteValue, 2, 2)));
battery.setAlarm(Alarm.CELL_VOLTAGE_DIFFERENCE_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 0, 2)));
battery.setAlarm(Alarm.TEMPERATURE_SENSOR_DIFFERENCE_HIGH, getAlarmLevel(BitUtil.bits(byteValue, 2, 2)));

/* 0x04 */
byteValue = msg.data.get(4);
battery.setAlarm(Alarm.CHARGE_MODULE_TEMPERATURE_HIGH, Util.bit(byteValue, 0) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.DISCHARGE_MODULE_TEMPERATURE_HIGH, Util.bit(byteValue, 1) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SENSOR_CHARGE_MODULE_TEMPERATURE, Util.bit(byteValue, 2) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SENSOR_DISCHARGE_MODULE_TEMPERATURE, Util.bit(byteValue, 3) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_OTHER, Util.bits(byteValue, 4, 2) != 0 ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_CHARGE_BREAKER, Util.bit(byteValue, 6) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_DISCHARGE_BREAKER, Util.bit(byteValue, 7) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.CHARGE_MODULE_TEMPERATURE_HIGH, BitUtil.bit(byteValue, 0) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.DISCHARGE_MODULE_TEMPERATURE_HIGH, BitUtil.bit(byteValue, 1) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SENSOR_CHARGE_MODULE_TEMPERATURE, BitUtil.bit(byteValue, 2) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SENSOR_DISCHARGE_MODULE_TEMPERATURE, BitUtil.bit(byteValue, 3) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_OTHER, BitUtil.bits(byteValue, 4, 2) != 0 ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_CHARGE_BREAKER, BitUtil.bit(byteValue, 6) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_DISCHARGE_BREAKER, BitUtil.bit(byteValue, 7) ? AlarmLevel.ALARM : AlarmLevel.NONE);

/* 0x05 */
byteValue = msg.data.get(5);

if (battery.getAlarmLevel(Alarm.FAILURE_OTHER) != AlarmLevel.ALARM) {
battery.setAlarm(Alarm.FAILURE_OTHER, Util.bit(byteValue, 0) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_OTHER, BitUtil.bit(byteValue, 0) ? AlarmLevel.ALARM : AlarmLevel.NONE);
}

battery.setAlarm(Alarm.FAILURE_SENSOR_PACK_VOLTAGE, Util.bit(byteValue, 1) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SENSOR_PACK_TEMPERATURE, Util.bit(byteValue, 2) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_EEPROM_MODULE, Util.bit(byteValue, 3) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_CLOCK_MODULE, Util.bit(byteValue, 4) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_PRECHARGE_MODULE, Util.bit(byteValue, 5) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_COMMUNICATION_INTERNAL, Util.bit(byteValue, 6) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_COMMUNICATION_EXTERNAL, Util.bit(byteValue, 7) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SENSOR_PACK_VOLTAGE, BitUtil.bit(byteValue, 1) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SENSOR_PACK_TEMPERATURE, BitUtil.bit(byteValue, 2) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_EEPROM_MODULE, BitUtil.bit(byteValue, 3) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_CLOCK_MODULE, BitUtil.bit(byteValue, 4) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_PRECHARGE_MODULE, BitUtil.bit(byteValue, 5) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_COMMUNICATION_INTERNAL, BitUtil.bit(byteValue, 6) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_COMMUNICATION_EXTERNAL, BitUtil.bit(byteValue, 7) ? AlarmLevel.ALARM : AlarmLevel.NONE);

/* 0x06 */
byteValue = msg.data.get(6);
battery.setAlarm(Alarm.FAILURE_SENSOR_PACK_CURRENT, Util.bit(byteValue, 0) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SENSOR_PACK_CURRENT, BitUtil.bit(byteValue, 0) ? AlarmLevel.ALARM : AlarmLevel.NONE);

if (battery.getAlarmLevel(Alarm.FAILURE_OTHER) != AlarmLevel.ALARM) {
battery.setAlarm(Alarm.FAILURE_OTHER, Util.bit(byteValue, 1) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_OTHER, BitUtil.bit(byteValue, 1) ? AlarmLevel.ALARM : AlarmLevel.NONE);
}

battery.setAlarm(Alarm.FAILURE_SHORT_CIRCUIT_PROTECTION, Util.bit(byteValue, 2) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_NOT_CHARGING_DUE_TO_LOW_VOLTAGE, Util.bit(byteValue, 3) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_SHORT_CIRCUIT_PROTECTION, BitUtil.bit(byteValue, 2) ? AlarmLevel.ALARM : AlarmLevel.NONE);
battery.setAlarm(Alarm.FAILURE_NOT_CHARGING_DUE_TO_LOW_VOLTAGE, BitUtil.bit(byteValue, 3) ? AlarmLevel.ALARM : AlarmLevel.NONE);
}

}
Loading

0 comments on commit 4587028

Please sign in to comment.