From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v3 13/15] hfpmodem: devinfo atom added to export BT address
Date: Thu, 20 Oct 2011 20:40:29 -0500 [thread overview]
Message-ID: <4EA0CD8D.6000201@gmail.com> (raw)
In-Reply-To: <1319128700-15841-14-git-send-email-mikel.astiz@bmw-carit.de>
[-- Attachment #1: Type: text/plain, Size: 2705 bytes --]
Hi Mikel,
<snip>
> +
> +struct devinfo_data {
> + char *device_address;
> + guint register_event_id;
Please use register_source here
> +};
> +
> +static void hfp_query_manufacturer(struct ofono_devinfo *info,
> + ofono_devinfo_query_cb_t cb,
> + void *data)
> +{
> + CALLBACK_WITH_FAILURE(cb, "", data);
> +}
> +
> +static void hfp_query_model(struct ofono_devinfo *info,
> + ofono_devinfo_query_cb_t cb,
> + void *data)
> +{
> + CALLBACK_WITH_FAILURE(cb, "", data);
> +}
> +
> +static void hfp_query_revision(struct ofono_devinfo *info,
> + ofono_devinfo_query_cb_t cb,
> + void *data)
> +{
> + CALLBACK_WITH_FAILURE(cb, "", data);
> +}
> +
Please omit these functions, the devinfo atom should handle the absence
of these gracefully.
> +static void hfp_query_serial(struct ofono_devinfo *info,
> + ofono_devinfo_query_cb_t cb,
> + void *data)
> +{
> + struct devinfo_data *dev = ofono_devinfo_get_data(info);
> + CALLBACK_WITH_SUCCESS(cb, dev->device_address, data);
> +}
> +
> +static gboolean hfp_devinfo_register(gpointer user_data)
> +{
> + struct ofono_devinfo *info = user_data;
> + struct devinfo_data *dd = ofono_devinfo_get_data(info);
> +
> + dd->register_event_id = 0;
> +
> + ofono_devinfo_register(info);
> +
> + return FALSE;
> +}
> +
> +static int hfp_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
> + void *user)
> +{
> + struct hfp_devinfo_params *devinfo_params = user;
> + struct devinfo_data *dd;
> +
> + dd = g_new0(struct devinfo_data, 1);
> + dd->device_address = g_strdup(devinfo_params->device_address);
> +
> + ofono_devinfo_set_data(info, dd);
> +
> + dd->register_event_id = g_idle_add(hfp_devinfo_register, info);
> + return 0;
> +}
> +
> +static void hfp_devinfo_remove(struct ofono_devinfo *info)
> +{
> + struct devinfo_data *dd = ofono_devinfo_get_data(info);
> +
> + ofono_devinfo_set_data(info, NULL);
> + if (dd == NULL)
> + return;
> +
> + if (dd->register_event_id != 0)
> + g_source_remove(dd->register_event_id);
> +
> + g_free(dd->device_address);
> + g_free(dd);
> +}
> +
> +static struct ofono_devinfo_driver driver = {
> + .name = "hfpmodem",
> + .probe = hfp_devinfo_probe,
> + .remove = hfp_devinfo_remove,
> + .query_manufacturer = hfp_query_manufacturer,
> + .query_model = hfp_query_model,
> + .query_revision = hfp_query_revision,
> + .query_serial = hfp_query_serial
> +};
> +
> +void hfp_devinfo_init(void)
> +{
> + ofono_devinfo_driver_register(&driver);
> +}
> +
> +void hfp_devinfo_exit(void)
> +{
> + ofono_devinfo_driver_unregister(&driver);
> +}
<snip>
Regards,
-Denis
next prev parent reply other threads:[~2011-10-21 1:40 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-20 16:38 [PATCH v3 00/15] Bluetooth HFP-specific extensions Mikel Astiz
2011-10-20 16:38 ` [PATCH v3 01/15] hfpmodem: Support for +BSIR unsol. result codes Mikel Astiz
2011-10-20 17:58 ` Denis Kenzior
2011-10-20 16:38 ` [PATCH v3 02/15] doc: Voice recognition function added in Handsfree Mikel Astiz
2011-10-21 1:33 ` Denis Kenzior
2011-10-20 16:38 ` [PATCH v3 03/15] include: Voice recognition in handsfree public api Mikel Astiz
2011-10-21 1:27 ` Denis Kenzior
2011-10-20 16:38 ` [PATCH v3 04/15] handsfree: Implement voice recognition function Mikel Astiz
2011-10-21 1:32 ` Denis Kenzior
2011-10-20 16:38 ` [PATCH v3 05/15] hfpmodem: Support for AT+BVRA Mikel Astiz
2011-10-20 16:38 ` [PATCH v3 06/15] doc: Handsfree exposes supported AG features Mikel Astiz
2011-10-21 1:36 ` Denis Kenzior
2011-10-20 16:38 ` [PATCH v3 07/15] include: AG features added to handsfree public api Mikel Astiz
2011-10-21 1:38 ` Denis Kenzior
2011-10-20 16:38 ` [PATCH v3 08/15] handsfree: Supported AG features exposed in D-Bus Mikel Astiz
2011-10-20 16:38 ` [PATCH v3 09/15] hfpmodem: Report features supported by AG Mikel Astiz
2011-10-20 16:38 ` [PATCH v3 10/15] hfpmodem: Avoid segfault in network-registration Mikel Astiz
2011-10-20 17:59 ` Denis Kenzior
2011-10-20 16:38 ` [PATCH v3 11/15] hfpmodem: Avoid segfault in call-volume Mikel Astiz
2011-10-20 16:38 ` [PATCH v3 12/15] hfpmodem: Avoid segfault in handsfree Mikel Astiz
2011-10-20 16:38 ` [PATCH v3 13/15] hfpmodem: devinfo atom added to export BT address Mikel Astiz
2011-10-21 1:40 ` Denis Kenzior [this message]
2011-10-20 16:38 ` [PATCH v3 14/15] hfp_hf: BT address exposed through Serial property Mikel Astiz
2011-10-21 1:42 ` Denis Kenzior
2011-10-20 16:38 ` [PATCH v3 15/15] hfpmodem: minor whitespace fix Mikel Astiz
2011-10-20 17:58 ` 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=4EA0CD8D.6000201@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