* [PATCH v5] hfp_hf: BT address exposed through Serial property
@ 2011-11-02 13:45 Mikel Astiz
2011-11-01 23:52 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Mikel Astiz @ 2011-11-02 13:45 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2292 bytes --]
The devinfo atom is created in pre_sim (instead of probe).
---
plugins/hfp_hf.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/plugins/hfp_hf.c b/plugins/hfp_hf.c
index ba06434..7a3567e 100644
--- a/plugins/hfp_hf.c
+++ b/plugins/hfp_hf.c
@@ -4,6 +4,7 @@
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
* Copyright (C) 2010 ProFUSION embedded systems
+ * Copyright (C) 2011 BMW Car IT GmbH. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@ -38,6 +39,7 @@
#include <ofono/plugin.h>
#include <ofono/log.h>
#include <ofono/modem.h>
+#include <ofono/devinfo.h>
#include <ofono/netreg.h>
#include <ofono/voicecall.h>
#include <ofono/call-volume.h>
@@ -62,6 +64,7 @@ static GHashTable *modem_hash = NULL;
struct hfp_data {
struct hfp_slc_info info;
char *handsfree_path;
+ char *handsfree_address;
DBusMessage *slc_msg;
gboolean agent_registered;
DBusPendingCall *call;
@@ -230,6 +233,10 @@ static int hfp_hf_probe(const char *device, const char *dev_addr,
if (data->handsfree_path == NULL)
goto free;
+ data->handsfree_address = g_strdup(dev_addr);
+ if (data->handsfree_address == NULL)
+ goto free;
+
ofono_modem_set_data(modem, data);
ofono_modem_set_name(modem, alias);
ofono_modem_register(modem);
@@ -239,6 +246,10 @@ static int hfp_hf_probe(const char *device, const char *dev_addr,
return 0;
free:
+ if (data != NULL) {
+ g_free(data->handsfree_path);
+ }
+
g_free(data);
ofono_modem_remove(modem);
@@ -358,6 +369,7 @@ static void hfp_remove(struct ofono_modem *modem)
g_hash_table_remove(modem_hash, data->handsfree_path);
+ g_free(data->handsfree_address);
g_free(data->handsfree_path);
g_free(data);
@@ -474,6 +486,7 @@ static void hfp_pre_sim(struct ofono_modem *modem)
DBG("%p", modem);
+ ofono_devinfo_create(modem, 0, "hfpmodem", data->handsfree_address);
ofono_voicecall_create(modem, 0, "hfpmodem", &data->info);
ofono_netreg_create(modem, 0, "hfpmodem", &data->info);
ofono_call_volume_create(modem, 0, "hfpmodem", &data->info);
--
1.7.6.4
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH v5] hfp_hf: BT address exposed through Serial property
2011-11-02 13:45 [PATCH v5] hfp_hf: BT address exposed through Serial property Mikel Astiz
@ 2011-11-01 23:52 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-11-01 23:52 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 561 bytes --]
Hi Mikel,
On 11/02/2011 08:45 AM, Mikel Astiz wrote:
> The devinfo atom is created in pre_sim (instead of probe).
> ---
> plugins/hfp_hf.c | 13 +++++++++++++
> 1 files changed, 13 insertions(+), 0 deletions(-)
>
Patch has been applied, I did fix up a minor style violation in a follow
on commit:
> @@ -239,6 +246,10 @@ static int hfp_hf_probe(const char *device, const char *dev_addr,
> return 0;
>
> free:
> + if (data != NULL) {
> + g_free(data->handsfree_path);
> + }
> +
The brackets are not needed...
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-02 13:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-02 13:45 [PATCH v5] hfp_hf: BT address exposed through Serial property Mikel Astiz
2011-11-01 23:52 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.