On 04/05/2013 03:56 PM, Vinicius Costa Gomes wrote:
On 12:32 Fri 05 Apr, Denis Kenzior wrote:
>> +int ofono_handsfree_get_codecs(unsigned char *buffer, int buffer_len)
>> + int len;
>> + if (agent == NULL)
>> + return -EIO;
>> + len = MIN(buffer_len, agent->codecs_len);
>> + memcpy(buffer, agent->codecs, len);
>> + return len;
> Do we really want to memcpy here or return a const unsigned char
> array? Also, right now we explicitly only support CVSD and mSBC, so
> this is overkill.
As we can assume that we always support CVSD, one idea is to have something
like ofono_handsfree_audio_has_msbc() instead of the get_codecs() function.
How does it sound?
I tend to like this better. Perhaps we can name this function a more
generic 'has_wideband()' instead. In case we want to provide support
for custom codecs in the future.
>> static void agent_free(struct agent *agent)
>> if (agent->watch> 0)