From 29a2f6a3b46afb00052a24b05232630acad3af70 Mon Sep 17 00:00:00 2001 From: erin_yueh Date: Thu, 21 Feb 2008 05:16:15 +0000 Subject: gsmd: get battery status (Sudharshan S) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@4091 99fdad57-331a-0410-800a-d7fa5415bdb3 --- include/gsmd/usock.h | 14 ++++++++++++++ include/libgsmd/misc.h | 2 ++ 2 files changed, 16 insertions(+) (limited to 'include') diff --git a/include/gsmd/usock.h b/include/gsmd/usock.h index 4263cad..7df22b2 100644 --- a/include/gsmd/usock.h +++ b/include/gsmd/usock.h @@ -139,6 +139,7 @@ enum gsmd_msg_phone { GSMD_PHONE_GET_MODEL = 5, GSMD_PHONE_GET_REVISION = 6, GSMD_PHONE_GET_SERIAL = 7, + GSMD_PHONE_GET_BATTERY = 8, }; enum gsmd_msg_modem { @@ -371,6 +372,14 @@ enum gsmd_toa_reserved { /* Length from 3GPP TS 04.08, Clause 10.5.4.7 */ +/* battery connection status from 3GPP TS 07.07 subclause 8.4 */ +enum gsmd_bat_conn_status { + GSMD_BAT_NORMAL = 0, + GSMD_BAT_NOT_POWERED = 1, + GSMD_BAT_NO_BAT = 2, + GSMD_BAT_POWER_FAULT = 3, +}; + #define GSMD_ADDR_MAXLEN 32 struct gsmd_addr { u_int8_t type; @@ -392,6 +401,11 @@ struct gsmd_voicemail { struct gsmd_addr addr; } __attribute__ ((packed)); +struct gsmd_battery_charge { + enum gsmd_bat_conn_status bcs; + u_int8_t bcl; +} __attribute__ ((packed)); + #define GSMD_ALPHA_MAXLEN 20 /* call status from 3GPP TS 07.07 clause 07.17 */ diff --git a/include/libgsmd/misc.h b/include/libgsmd/misc.h index 02483d3..884e294 100644 --- a/include/libgsmd/misc.h +++ b/include/libgsmd/misc.h @@ -71,4 +71,6 @@ extern int lgsm_get_serial(struct lgsm_handle *lh); extern int lgsm_voicemail_set(struct lgsm_handle *lh, const char *number); /* Get currently configured voice mail number */ extern int lgsm_voicemail_get(struct lgsm_handle *lh); +/* Get Battery Connection status and charge level */ +extern int lgsm_get_battery(struct lgsm_handle *lh); #endif -- cgit v1.2.3