-
Notifications
You must be signed in to change notification settings - Fork 5
Documentation
This page contains documentation of the b6::Device
class.
Initializes
libusb
, unloads the kernel driver if necessary (GNU/Linux only), claims the charger's USB interface and requests information about the charger (core type, hw version, etc...).
Releases the charger's USB interface, re-attaches the kernel driver if necessary and frees
libusb
.
b6::SysInfo
b6::Device::getSysInfo()
Reads current system settings from the charger.
name | type | description |
---|---|---|
@returns | b6::SysInfo |
system settings saved in the charger |
b6::ChargeInfo
b6::Device::getChargeInfo()
Reads current charging information from the charger.
Keep in mind that this method will throw if an error occurs during charging!
name | type | description |
---|---|---|
@returns | b6::ChargeInfo |
current charge information |
@throws | b6::ChargingError |
throws an error if any occurs during charging |
b6::ChargeProfile
b6::Device::getDefaultChargeProfile(
b6::BATTERY_TYPE
type)
Gets a sane (in my opinion) default charging profile for a battery type.
name | type | description |
---|---|---|
type |
b6::BATTERY_TYPE |
type of battery that will be charged |
@returns | b6::ChargeProfile |
default charging profile for type
|
Stops the charging process.
void b6::Device::startCharging(
b6::ChargeProfile
profile)
Starts the charging process using the specified profile.
name | type | description |
---|---|---|
profile |
b6::ChargeProfile |
the profile with charging settings to use |
Sets time between cycles used for Ni-* battery cycling. Returns false if the value is outside the supported range.
name | type | SI unit | range | description |
---|---|---|---|---|
cycleTime |
int |
minutes | 1-60 | time between Ni-* battery cycles |
@returns | bool |
whether the setting was successful |
Sets the safety time limit settings. Returns false if the value is outside the supported range.
name | type | SI unit | range | description |
---|---|---|---|---|
enabled |
bool |
whether to enable the limit | ||
limit |
int |
minutes | 1-720 | time limit |
@returns | bool |
whether the setting was successful |
Sets the safety capacity limit settings. Returns false if the value is outside the supported range.
name | type | SI unit | range | description |
---|---|---|---|---|
enabled |
bool |
whether to enable the limit | ||
limit |
int |
mAh | 100-50000 | capacity limit |
@returns | bool |
whether the setting was successful |
Sets the safety temperature limit settings. Returns false if the value is outside the supported range.
name | type | SI unit | range | description |
---|---|---|---|---|
limit |
int |
°C | 20-80 | temperature limit |
@returns | bool |
whether the setting was successful |
Sets buzzer settings.
name | type | SI unit | range | description |
---|---|---|---|---|
system |
bool |
system buzzer (charging error, etc...) | ||
key |
bool |
key buzzer | ||
@returns | bool |
whether the setting was successful |
Returns the core type/version of the charger (basically the model).
name | type | description |
---|---|---|
@returns | std::string |
charger core type/version |
I have no idea what this is.
name | type | description |
---|---|---|
@returns | int |
no idea |
Presumably gets the UI language id. Returns 1 for English.
name | type | description |
---|---|---|
@returns | int |
language id |
I have no idea what this is. Not the serial number displayed in the charger's UI.
name | type | description |
---|---|---|
@returns | int |
no idea |
Returns hardware revision number.
name | type | description |
---|---|---|
@returns | double |
hardware version |
Returns the firmware version.
name | type | description |
---|---|---|
@returns | double |
firmware version |
I have no idea what this is.
name | type | description |
---|---|---|
@returns | bool |
no idea |
Returns the maximum number of cells the charger supports (6 or 8).
name | type | description |
---|---|---|
@returns | int |
maximum number of cells supported by the charger |
static bool b6::Device::isBatteryLi(
b6::BATTERY_TYPE
type)
Checks whether the provided battery type is a Li-* battery.
name | type | description |
---|---|---|
type |
b6::BATTERY_TYPE |
battery type to check |
@returns | bool |
whether type is a Li-* battery |
static bool b6::Device::isBatteryNi(
b6::BATTERY_TYPE
type)
Checks whether the provided battery type is a Ni-* battery.
name | type | description |
---|---|---|
type |
b6::BATTERY_TYPE |
battery type to check |
@returns | bool |
whether type is a Ni-* battery |