From 0ca88b36e73e15f505d9543705bf1d332c412189 Mon Sep 17 00:00:00 2001 From: Denis Kenzior Date: Mon, 19 Oct 2009 16:58:13 -0500 Subject: Refactor: Don't store indicator names We already know the indicators we're interested in from the specification, malloc/free-ing the indicator names is thus pointless. Instead save off the indicator index positions in an array. Parse the current values instead of storing the unparsed list. --- drivers/hfpmodem/hfp.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'drivers/hfpmodem/hfp.h') diff --git a/drivers/hfpmodem/hfp.h b/drivers/hfpmodem/hfp.h index 831dd5ed..97e5d47f 100644 --- a/drivers/hfpmodem/hfp.h +++ b/drivers/hfpmodem/hfp.h @@ -34,12 +34,22 @@ #define AG_FEATURE_ENHANCED_CALL_CONTROL 0x80 #define AG_FEATURE_EXTENDED_RES_CODE 0x100 +enum hfp_indicator { + HFP_INDICATOR_SERVICE = 0, + HFP_INDICATOR_CALL, + HFP_INDICATOR_CALLSETUP, + HFP_INDICATOR_CALLHELD, + HFP_INDICATOR_SIGNAL, + HFP_INDICATOR_ROAM, + HFP_INDICATOR_BATTCHG, + HFP_INDICATOR_LAST +}; + struct hfp_data { GAtChat *chat; - int ag_features; - char **cind_names; - int *cind_values; - int cind_length; + guint ag_features; + guint8 cind_pos[HFP_INDICATOR_LAST]; + gint cind_val[HFP_INDICATOR_LAST]; }; extern void hfp_voicecall_init(); -- cgit v1.2.3