[PATCH 2/2] Add call volume support for hfpmodem

Zhang, Zhenhua zhenhua.zhang at intel.com
Tue Nov 10 22:31:49 PST 2009


Hi Denis,

Denis Kenzior wrote:
> Hi Zhenhua,
> 
>> +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? 

Good catch. I add the sync code in attached.
 
>> +}
>> +
>> +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

Fixed by remove cind_pos, cind_val from struct cv_data.

>> +
>> +	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.

I don't see ofono_call_volume_set_data(cv, NULL) or ofono_voicecall_set_data(vc, NULL)
from atmodem either. Anyway, I add the code in hfp_call_volume_remove.

>> +
>> +	g_free(vd);
>> +}
>> +
> 
> Regards,
> -Denis
> _______________________________________________
> ofono mailing list
> ofono at ofono.org
> http://lists.ofono.org/listinfo/ofono



Regards,
Zhenhua

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-call-volume-support-for-hfpmodem.patch
Type: application/octet-stream
Size: 8937 bytes
Desc: 0002-Add-call-volume-support-for-hfpmodem.patch
URL: <http://lists.ofono.org/pipermail/ofono/attachments/20091111/9be76078/attachment-0001.obj>


More information about the ofono mailing list