[pulseaudio-discuss] [RFCv0 09/21] bluetooth: Register/Unregister Handsfree Audio Agent with oFono

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Thu May 29 02:59:16 PDT 2014


On Tue, 2014-02-04 at 19:03 -0300, jprvita at gmail.com wrote:
> +static void hf_audio_agent_register(hf_audio_agent_data *hfdata) {
> +    DBusMessage *m;
> +    unsigned char codecs[2];
> +    const unsigned char *pcodecs = codecs;

s/unsigned char/uint8_t/

>  static DBusMessage *hf_audio_agent_release(DBusConnection *c, DBusMessage *m, void *data) {
> -    DBusMessage *r = dbus_message_new_error(m, "org.ofono.Error.NotImplemented", "Operation is not implemented");
> +    DBusMessage *r;
> +    const char *sender;
> +    hf_audio_agent_data *hfdata = data;
> +
> +    pa_assert(hfdata);
> +
> +    sender = dbus_message_get_sender(m);
> +    if (!pa_streq(hfdata->ofono_bus_id, sender)) {

hfdata->ofono_bus_id may be NULL.

> +        pa_assert_se(r = dbus_message_new_error(m, "org.ofono.Error.NotAllowed", "Operation is not allowed by this sender"));
> +        return r;
> +    }
> +
> +    r = dbus_message_new_error(m, "org.ofono.Error.NotImplemented", "Operation is not implemented");
>      return r;
>  }
>  
>  static DBusMessage *hf_audio_agent_new_connection(DBusConnection *c, DBusMessage *m, void *data) {
> -    DBusMessage *r = dbus_message_new_error(m, "org.ofono.Error.NotImplemented", "Operation is not implemented");
> +    DBusMessage *r;
> +    const char *sender;
> +    hf_audio_agent_data *hfdata = data;
> +
> +    pa_assert(hfdata);
> +
> +    sender = dbus_message_get_sender(m);
> +    if (!pa_streq(hfdata->ofono_bus_id, sender)) {

hfdata->ofono_bus_id may be NULL.

-- 
Tanu



More information about the pulseaudio-discuss mailing list