-
Notifications
You must be signed in to change notification settings - Fork 4
Enums & Errors
Maciej Sopyło edited this page Apr 18, 2018
·
1 revision
An enum with various Li-* battery charging modes.
enum class CHARGING_MODE_LI : uint8_t {
STANDARD = 0x00,
DISCHARGE = 0x01,
STORAGE = 0x02,
FAST = 0x03,
BALANCE = 0x04,
};
An enum with various Ni-* battery charging modes.
enum class CHARGING_MODE_NI : uint8_t {
STANDARD = 0x00,
AUTO = 0x01,
DISCHARGE = 0x02,
REPEAK = 0x03,
CYCLE = 0x04,
};
An enum with various lead-acid battery charging modes.
enum class CHARGING_MODE_PB : uint8_t {
CHARGE = 0x00,
DISCHARGE = 0x01,
};
An enum with supported battery types.
enum class BATTERY_TYPE : uint8_t {
LIPO = 0x00,
LIIO = 0x01,
LIFE = 0x02,
LIHV = 0x03,
NIMH = 0x04,
NICD = 0x05,
PB = 0x06,
};
An enum with various states the charger can be in.
UNFINISHED!
enum class STATE : uint8_t {
CHARGING = 0x01,
ERROR_1 = 0x02,
COMPLETE = 0x03,
ERROR_2 = 0x04,
};
All errors inherit from the
b6::ChargingError
base class, overloading themessage()
method with a human-readable error message.
class ChargingError : public std::exception {
public:
virtual std::string message() { return "Charging Error"; };
};
class ErrorConnectionBroken : public ChargingError
class ErrorCellVoltageInvalid : public ChargingError
class ErrorBalanceConnection : public ChargingError
class ErrorNoBattery : public ChargingError
class ErrorCellNumberIncorrect : public ChargingError
class ErrorConnectionMainPort : public ChargingError
class ErrorBatteryFull : public ChargingError
class ErrorChargeNotNeeded : public ChargingError
class ErrorCellHighVoltage : public ChargingError
class ErrorIntTempTooHigh : public ChargingError
class ErrorExtTempTooHigh : public ChargingError
class ErrorDCInTooLow : public ChargingError
class ErrorDCInTooHigh : public ChargingError
class ErrorOverTimeLimit : public ChargingError
class ErrorOverCapacityLimit : public ChargingError
class ErrorReversePolarity : public ChargingError
class ErrorControlFail : public ChargingError
class ErrorBreakDown : public ChargingError
class ErrorInputFail : public ChargingError
class ErrorUnknown : public ChargingError