From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH 2/2] Add call volume support for hfpmodem
Date: Tue, 10 Nov 2009 23:52:05 -0600 [thread overview]
Message-ID: <200911102352.05641.denkenz@gmail.com> (raw)
In-Reply-To: <1257946350.31013.3.camel@zzhan17-mobl.ccr.corp.intel.com>
[-- Attachment #1: Type: text/plain, Size: 1721 bytes --]
Hi Zhenhua,
> The call volume driver listens the speaker volume and microphone
> gain from the AG. It also allow to synchronze the speaker and
> microphone volume changes with the AG through AT+VGS and AT+VGM.
> +struct cv_data {
> + GAtChat *chat;
> + unsigned char cind_pos[HFP_INDICATOR_LAST];
Useless, remove
> + int cind_val[HFP_INDICATOR_LAST];
Useless, remove
> + unsigned char sp_volume;
> + unsigned char mic_volume;
> +};
<snip>
> +static void hfp_call_volume_initialized(gpointer user_data)
> +{
> + struct ofono_call_volume *cv = user_data;
> + struct cv_data *vd = ofono_call_volume_get_data(cv);
> +
> + DBG("");
> +
> + g_at_chat_register(vd->chat, "+VGS:", vgs_notify, FALSE, cv, NULL);
> + g_at_chat_register(vd->chat, "+VGM:", vgm_notify, FALSE, cv, NULL);
> +
> + ofono_call_volume_register(cv);
> +
> + ofono_call_volume_set_microphone_volume(cv, vd->mic_volume);
> + ofono_call_volume_set_speaker_volume(cv, vd->sp_volume);
Section 4.28.2 of HFP Spec. Don't we need to perform volume level
synchronization here?
> +}
> +
> +static int hfp_call_volume_probe(struct ofono_call_volume *cv,
> + unsigned int vendor, void *data)
> +{
<snip>
> + memcpy(vd->cind_pos, d->cind_pos, HFP_INDICATOR_LAST);
> + memcpy(vd->cind_val, d->cind_val, HFP_INDICATOR_LAST);
Useless
> +
> + ofono_call_volume_set_data(cv, vd);
> +
> + hfp_call_volume_initialized(cv);
> +
> + return 0;
> +}
> +
> +static void hfp_call_volume_remove(struct ofono_call_volume *cv)
> +{
> + struct cv_data *vd = ofono_call_volume_get_data(cv);
Make sure to ofono_call_volume_set_data(cv, NULL) here.
> +
> + g_free(vd);
> +}
> +
Regards,
-Denis
next prev parent reply other threads:[~2009-11-11 5:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-11 13:32 [PATCH 2/2] Add call volume support for hfpmodem Zhenhua Zhang
2009-11-11 5:52 ` Denis Kenzior [this message]
2009-11-11 6:31 ` Zhang, Zhenhua
2009-11-11 6:41 ` Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200911102352.05641.denkenz@gmail.com \
--to=denkenz@gmail.com \
--cc=ofono@ofono.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox