Skip to content

Commit

Permalink
Merge branch 'jb44852_battery_state' into 'master'
Browse files Browse the repository at this point in the history
Add charger state D-Bus constants

See merge request mer-core/mce-dev!12
  • Loading branch information
spiiroin committed Oct 8, 2019
2 parents 64c420a + b1bad1c commit 4990e63
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
26 changes: 26 additions & 0 deletions include/mce/dbus-names.h
Expand Up @@ -847,6 +847,32 @@
*/
# define MCE_BATTERY_STATUS_SIG "battery_status_ind"

/** Query current battery state
*
* @since mce 1.104.0
*
* @return string: current battery state, one of:
* - #MCE_BATTERY_STATE_UNKNOWN
* - #MCE_BATTERY_STATE_CHARGING
* - #MCE_BATTERY_STATE_DISCHARGING
* - #MCE_BATTERY_STATE_NOT_CHARGING
* - #MCE_BATTERY_STATE_FULL
*/
#define MCE_BATTERY_STATE_GET "get_battery_state"

/** Signal that indicates that battery state has changed
*
* @since mce 1.104.0
*
* @param battery_state string: current battery state, one of:
* - #MCE_BATTERY_STATE_UNKNOWN
* - #MCE_BATTERY_STATE_CHARGING
* - #MCE_BATTERY_STATE_DISCHARGING
* - #MCE_BATTERY_STATE_NOT_CHARGING
* - #MCE_BATTERY_STATE_FULL
*/
#define MCE_BATTERY_STATE_SIG "battery_state_ind"

/** Query current battery level
*
* @since mce 1.86.0
Expand Down
51 changes: 51 additions & 0 deletions include/mce/mode-names.h
Expand Up @@ -485,6 +485,8 @@
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/** @name Battery Status Constants
*
* These values match legacy maemo (bme) battery status values.
*
*@{
*/
Expand Down Expand Up @@ -521,6 +523,55 @@

/*@}*/

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/** @name Battery State Constants
*
* These values match linux power supply device status values.
*
*@{
*/

/** Battery state is not known
*
* @since mce 1.104.0
*/
# define MCE_BATTERY_STATE_UNKNOWN "unknown"

/** Battery is currently discharging
*
* Charger is disconnected, battery is discharging.
*
* @since mce 1.104.0
*/
# define MCE_BATTERY_STATE_DISCHARGING "discharging"

/** Battery is currently charging
*
* Charger is connected, battery is charging.
*
* @since mce 1.104.0
*/
# define MCE_BATTERY_STATE_CHARGING "charging"

/** Battery is not getting charged
*
* Charger is connected, battery is not getting charged.
*
* @since mce 1.104.0
*/
# define MCE_BATTERY_STATE_NOT_CHARGING "not_charging"

/** Battery is fully charged
*
* Charger is connected, battery is full.
*
* @since mce 1.104.0
*/
# define MCE_BATTERY_STATE_FULL "full"

/*@}*/

/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
/** @name Battery Level Constants
Expand Down

0 comments on commit 4990e63

Please sign in to comment.