ALBattery API

NAOqi Sensors - Overview | API


See also

naoBattery Hardware.

Namespace : AL


#include <alproxies/albatteryproxy.h>

Method list

As any module, this module inherits methods from ALModule API. It also has the following specific methods:

class ALBatteryProxy

Methods

void ALBatteryProxy::enablePowerMonitoring(bool enable)

Enables or disables power monitoring.

Parameters:
  • enable
    Choose True to enable the power monitoring and its notifications.
    Choose False to disable the power monitoring and its notifications.
int ALBatteryProxy::getBatteryCharge()

Get battery charge.

Returns: Return the battery charge in percent.

Events

Event: "BatteryPowerPluggedChanged"
callback(std::string eventName, bool plugged, std::string subscriberIdentifier)

Raised when the charger is plugged and unplugged.

Caution: some battery models do not provide information whether the power is plugged or not. In this case, we determine power plugged state with electric current. Unfortunately when the battery is fully charged, the charger stops supplying current. So this event is not raised when battery is fully charged.

For further details see: Battery Hardware.

Parameters:
  • eventName (std::string) – “BatteryPowerPluggedChanged”
  • plugged – True if plugged-in, false otherwise.
  • subscriberIdentifier (std::string) –
Event: "BatteryChargeCellVoltageMinChanged"
callback(std::string eventName, int voltage, std::string subscriberIdentifier)

Raised when the Minimum cell voltage of the battery changes.

Parameters:
  • eventName (std::string) – “BatteryChargeCellVoltageMinChanged”
  • voltage – The minimum cell voltage.
  • subscriberIdentifier (std::string) –
Event: "BatteryChargingFlagChanged"
callback(std::string eventName, bool charging, std::string subscriberIdentifier)

Raised when the flag “battery is charging” changes.

Parameters:
  • eventName (std::string) – “BatteryChargingFlagChanged”
  • charging – True when the battery is charging, false otherwise.
  • subscriberIdentifier (std::string) –
Event: "BatteryFullChargedFlagChanged"
callback(std::string eventName, bool fullyCharged, std::string subscriberIdentifier)

Raised when the flag “battery is fully charged” changes.

Parameters:
  • eventName (std::string) – “BatteryFullChargedFlagChanged”
  • fullyCharged – True when the battery is fully charged, false otherwise.
  • subscriberIdentifier (std::string) –
Event: "BatteryDisChargingFlagChanged"
callback(std::string eventName, bool isDischarging, std::string subscriberIdentifier)

Raised when the flag “battery is discharging” changes.

Parameters:
  • eventName (std::string) – “BatteryDisChargingFlagChanged”
  • isDischarging – True when the battery is discharging, false otherwise.
  • subscriberIdentifier (std::string) –
Event: "BatteryChargeChanged"
callback(std::string eventName, int percentage, std::string subscriberIdentifier)

Raised when the battery level percentage changes.

Parameters:
  • eventName (std::string) – “BatteryChargeChanged”
  • percentage – The percent of the battery that remains.
  • subscriberIdentifier (std::string) –
Event: "BatteryEmpty"
callback(std::string eventName, std::string message, std::string subscriberIdentifier)

Raised when the battery is empty.

Parameters:
  • eventName (std::string) – “BatteryEmpty”
  • message – System message.
  • subscriberIdentifier (std::string) –
Event: "BatteryLowDetected"
callback(std::string eventName, bool status, std::string subscriberIdentifier)

Raised when the battery level is low.

Parameters:
  • eventName (std::string) – “BatteryLowDetected”
  • status – True if battery level is low.
  • subscriberIdentifier (std::string) –
Event: "BatteryNearlyEmpty"
callback(std::string eventName, std::string message, std::string subscriberIdentifier)

Raised when the battery is nearly empty and needs charging.

Parameters:
  • eventName (std::string) – “BatteryNearlyEmpty”
  • message – System message.
  • subscriberIdentifier (std::string) –
Event: "BatteryNotDetected"
callback(std::string eventName, bool status, std::string subscriberIdentifier)

Raised when the battery is not detected.

Parameters:
  • eventName (std::string) – “BatteryNotDetected”
  • status – True if battery is not detected.
  • subscriberIdentifier (std::string) –