[PATCH 0/8] HFP 1.6 codec selection
by Vinicius Costa Gomes
Hi,
This series adds support for selecting the codec inside the card.
We still don't set the SCO socket options because the API for that is
still being discussed. The patches for that are ready, they can be
sent as a RFC if desired.
The main question with this series is how to notify the audio card
that its selected codec has changed (PATCH 1/8). It was chosen to do
it this way to avoid adding knowledge of ofono_handsfree_card to the
hfpmodem.
Cheers,
Claudio Takahasi (5):
hfp_hf_bluez5: Register codec watcher
hfp_hf_bluez5: Set the audio codec in the card
handsfree-audio: Send the selected codec
handsfree-audio: Set CVSD as default in the card
handsfree-audio: Enable wideband speech if defer is enabled
Vinicius Costa Gomes (3):
hfpmodem: Add codec watcher register
include: ofono_handsfree_card_select_codec()
handsfree-audio: Implement ofono_handsfree_card_select_codec()
drivers/hfpmodem/slc.c | 62 +++++++++++++++++++++++++++++++++++++++++++++++
drivers/hfpmodem/slc.h | 4 +++
include/handsfree-audio.h | 2 ++
plugins/hfp_hf_bluez5.c | 15 ++++++++++++
src/handsfree-audio.c | 31 +++++++++++++++++++-----
5 files changed, 108 insertions(+), 6 deletions(-)
--
1.8.2
7 years, 9 months
[PATCH 1/6] hfp_hf_bluez5: Add audio card .connect() for HFP 1.6
by Vinicius Costa Gomes
---
plugins/hfp_hf_bluez5.c | 30 +++++++++++++++++++++++++++++-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index ac6189d..d4a9b23 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -324,11 +324,39 @@ static void hfp16_card_remove(struct ofono_handsfree_card *card)
}
+static void bcc_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_handsfree_card_connect_cb_t cb = cbd->cb;
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ cb(&error, cbd->data);
+}
+
static void hfp16_card_connect(struct ofono_handsfree_card *card,
ofono_handsfree_card_connect_cb_t cb,
void *data)
{
- CALLBACK_WITH_FAILURE(cb, data);
+ struct hfp *hfp = ofono_handsfree_card_get_data(card);
+ struct hfp_slc_info *info = &hfp->info;
+
+ if ((info->hf_features & HFP_HF_FEATURE_CODEC_NEGOTIATION &&
+ info->ag_features & HFP_AG_FEATURE_CODEC_NEGOTIATION)) {
+ struct cb_data *cbd = cb_data_new(cb, data);
+
+ g_at_chat_send(info->chat, "AT+BCC", NULL, bcc_cb, cbd, g_free);
+ return;
+ }
+
+ /*
+ * If any side (remote or local) doesn't support codec negotiation,
+ * fallback to direct SCO connection. Calling connect_sco()
+ * hands the connection responsibility to the core, so no need
+ * to call the callback
+ */
+ ofono_handsfree_card_connect_sco(card);
}
static struct ofono_handsfree_card_driver hfp16_hf_driver = {
--
1.8.2
7 years, 9 months
[PATCH 0/3] Telit plugin rework for HE910
by Jonas Bonn
This series provides functional support for the Telit HE910 modem
by reworking the initialization sequence. Though this series has
been tested only on an HE910 device, it seems that this control flow
should work fine for older devices as well given that they share the
same documentation and, presumably, use essentially the same firmware.
Best regards,
Jonas Bonn
South Pole AB
Christopher Vogl (1):
udevng: support telit modems using cdc-acm driver
Jonas Bonn (2):
telit: allow plugin to be compiled without BT support
telit: rework for HE910
Makefile.am | 9 ++--
configure.ac | 3 ++
plugins/telit.c | 156 ++++++++++++++++++++++++++++++++++++++++++++++---------
plugins/udevng.c | 14 +++--
4 files changed, 152 insertions(+), 30 deletions(-)
--
1.8.1.2
7 years, 9 months
Setting up the Telit HE910 and Option GTM382
by Etienne Mabille
I am trying to have two modems working at the same time with ofono : one is
the Telit HE910, and the other one is the Option GTM382.
Both of them work fine when plugged alone, but if I use them both at the
same time,the initialization seems to stop during the telit_enable phase.
I am using ofono-1.3, I applied the several patches released in the
meantime to support the Telit modems including the latest
series patches "Telit plugin rework for HE910".
Here is the debug log from ofono :
ofonod[1789]: src/modem.c:ofono_modem_create() name: (null), type: telit
ofonod[1789]: plugins/udevng.c:setup_telit()
/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-6
ofonod[1789]: plugins/udevng.c:setup_telit() /dev/ttyACM1 2/2/1 00 (null)
Telit Wireless Module Modem
ofonod[1789]: plugins/udevng.c:setup_telit() /dev/ttyACM2 2/2/1 02 (null)
(null)
ofonod[1789]: plugins/udevng.c:setup_telit() /dev/ttyACM3 2/2/1 04 (null)
(null)
ofonod[1789]: plugins/udevng.c:setup_telit() /dev/ttyACM4 2/2/1 06 (null)
(null)
ofonod[1789]: plugins/udevng.c:setup_telit() /dev/ttyACM5 2/2/1 08 (null)
(null)
ofonod[1789]: plugins/udevng.c:setup_telit() /dev/ttyACM6 2/2/1 0a (null)
(null)
ofonod[1789]: plugins/udevng.c:setup_telit() /dev/ttyACM7 2/2/1 0c (null)
(null)
ofonod[1789]: plugins/udevng.c:setup_telit() modem=/dev/ttyACM1
aux=/dev/ttyACM4 gps=(null) diag=/dev/ttyACM2
ofonod[1789]: src/modem.c:set_modem_property() modem 0x8d27150 property
Modem
ofonod[1789]: src/modem.c:set_modem_property() modem 0x8d27150 property Aux
ofonod[1789]: src/modem.c:set_modem_property() modem 0x8d27150 property GPS
ofonod[1789]: src/modem.c:ofono_modem_register() 0x8d27150
ofonod[1789]: plugins/telit.c:telit_probe() 0x8d27150
ofonod[1789]: src/modem.c:emit_modem_added() 0x8d27150
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27150 property
NetworkInterface
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27150 property
SysPath
ofonod[1789]: src/modem.c:__ofono_modem_append_properties() Ifname (null)
ofonod[1789]: src/modem.c:call_modemwatches() 0x8d27150 added:1
ofonod[1789]: plugins/smart-messaging.c:modem_watch() modem: 0x8d27150,
added: 1
ofonod[1789]: plugins/push-notification.c:modem_watch() modem: 0x8d27150,
added: 1
ofonod[1789]: plugins/udevng.c:create_modem()
/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1
ofonod[1789]: plugins/udevng.c:create_modem() driver=hso
ofonod[1789]: src/modem.c:ofono_modem_create() name: (null), type: hso
ofonod[1789]: plugins/udevng.c:setup_hso()
/sys/devices/pci0000:00/0000:00:1d.7/usb1/1-1
ofonod[1789]: plugins/udevng.c:setup_hso() /dev/ttyHS0 255/255/255 00
(null) Diagnostic
ofonod[1789]: plugins/udevng.c:setup_hso() /dev/ttyHS1 255/255/255 01
(null) GPS
ofonod[1789]: plugins/udevng.c:setup_hso() /dev/ttyHS2 255/255/255 02
(null) GPS Control
ofonod[1789]: plugins/udevng.c:setup_hso() /dev/ttyHS3 255/255/255 03
(null) Application
ofonod[1789]: plugins/udevng.c:setup_hso() /dev/ttyHS4 255/255/255 06
(null) Control
ofonod[1789]: plugins/udevng.c:setup_hso() /dev/ttyHS5 255/255/255 09
(null) Modem
ofonod[1789]: plugins/udevng.c:setup_hso() control=/dev/ttyHS4
application=/dev/ttyHS3 modem=/dev/ttyHS5 network=(null)
ofonod[1789]: src/modem.c:set_modem_property() modem 0x8d27718 property
Control
ofonod[1789]: src/modem.c:set_modem_property() modem 0x8d27718 property
Application
ofonod[1789]: src/modem.c:set_modem_property() modem 0x8d27718 property
Modem
ofonod[1789]: src/modem.c:set_modem_property() modem 0x8d27718 property
NetworkInterface
ofonod[1789]: src/modem.c:ofono_modem_register() 0x8d27718
ofonod[1789]: plugins/hso.c:hso_probe() 0x8d27718
ofonod[1789]: src/modem.c:emit_modem_added() 0x8d27718
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27718 property
NetworkInterface
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27718 property
SysPath
ofonod[1789]: src/modem.c:__ofono_modem_append_properties() Ifname (null)
ofonod[1789]: src/modem.c:call_modemwatches() 0x8d27718 added:1
ofonod[1789]: plugins/smart-messaging.c:modem_watch() modem: 0x8d27718,
added: 1
ofonod[1789]: plugins/push-notification.c:modem_watch() modem: 0x8d27718,
added: 1
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27718 property
NetworkInterface
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27718 property
SysPath
ofonod[1789]: src/modem.c:__ofono_modem_append_properties() Ifname (null)
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27150 property
NetworkInterface
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27150 property
SysPath
ofonod[1789]: src/modem.c:__ofono_modem_append_properties() Ifname (null)
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27718 property
NetworkInterface
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27718 property
SysPath
ofonod[1789]: src/modem.c:__ofono_modem_append_properties() Ifname (null)
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27150 property
NetworkInterface
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27150 property
SysPath
ofonod[1789]: src/modem.c:__ofono_modem_append_properties() Ifname (null)
ofonod[1789]: plugins/telit.c:telit_enable() 0x8d27150
ofonod[1789]: src/modem.c:get_modem_property() modem 0x8d27150 property
Modem
ofonod[1789]: plugins/telit.c:open_device() Modem /dev/ttyACM1
I also used gdbserver to find out where the problem is. Here is the
backtrace from where i think the failure is :
│230 }
│231 }
│232
>│233 fd = open(tty, O_RDWR | O_NOCTTY |
O_NONBLOCK); /* the open function fails and returns -1 */
│234 if (fd < 0)
│235 return -1;
│236
│237 tcflush(fd, TCIOFLUSH);
#0 open_device (tty=0x8d27e08 "/dev/ttyACM1", options=0x8d1dbb0) at
gatchat/gattty.c:233
#1 g_at_tty_open (tty=0x8d27e08 "/dev/ttyACM1", options=0x8d1dbb0) at
gatchat/gattty.c:248
#2 0x080bd823 in open_device (modem=<value optimized out>, key=<value
optimized out>, debug=0x81227a8 "Modem: ")
at plugins/telit.c:210
#3 0x080bd8f3 in telit_enable (modem=0x8d27150) at plugins/telit.c:386
#4 0x080c0982 in set_powered (modem=0x8d27150, powered=1) at
src/modem.c:885
#5 0x080c19fc in modem_set_property (conn=0x8d1f178, msg=0x8d2bca0,
data=0x8d27150) at src/modem.c:1097
#6 0x08054e14 in process_message (connection=0x8d1f178,
message=0xbf834460, method=0x8d2b614,
iface_user_data=0x8d27150) at gdbus/object.c:224
#7 0xb77e12b2 in ?? ()
#8 0xb77d6544 in ?? ()
#9 0x08053bd0 in message_dispatch (data=0xb77f8ff4) at gdbus/mainloop.c:80
#10 0xb782d829 in ?? ()
#11 0xb782cf7d in ?? ()
#12 0xb782efee in ?? ()
#13 0xb783003e in ?? ()
#14 0x080bf1ff in main (argc=1, argv=0xbf834a54) at src/main.c:260
Here is what I have got so far...
I don't understand why this open fails when the Option is plugged in since
they don't use the same device ports (ttyACM? for HE910, and ttyHS? for
GTM382)
Thanks in advance for your help,
Etienne Mabille
7 years, 9 months
[PATCH 1/5] hfp_hf_bluez5: Add extracting version
by Vinicius Costa Gomes
From: Claudio Takahasi <claudio.takahasi(a)openbossa.org>
This patch parses and reads the profile "Version" that comes in the fd
dictionary of the NewConnection method. "Version" is input for Audio Card
registration.
---
plugins/hfp_hf_bluez5.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index f068c70..a6cc156 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -350,6 +350,45 @@ static ofono_bool_t device_path_compare(struct ofono_modem *modem,
return g_str_equal(path, value);
}
+static int get_version(DBusMessageIter *iter, uint16_t *version)
+{
+ DBusMessageIter dict, entry, valiter;
+ const char *key;
+ uint16_t value;
+
+ /* Points to dict */
+ dbus_message_iter_recurse(iter, &dict);
+
+ /* For each entry in this dict */
+ while (dbus_message_iter_get_arg_type(&dict) != DBUS_TYPE_INVALID) {
+ /* I want to access the entry's contents */
+ dbus_message_iter_recurse(&dict, &entry);
+
+ if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_STRING)
+ return -EINVAL;
+
+ /* If the current key isn't "Version", keep looking */
+ dbus_message_iter_get_basic(&entry, &key);
+ if (!g_str_equal("Version", key)) {
+ dbus_message_iter_next(&dict);
+ continue;
+ }
+
+ dbus_message_iter_next(&entry);
+ if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_VARIANT)
+ return -EINVAL;
+
+ dbus_message_iter_recurse(&entry, &valiter);
+ dbus_message_iter_get_basic(&valiter, &value);
+ break;
+ }
+
+ if (version)
+ *version = value;
+
+ return 0;
+}
+
static DBusMessage *profile_new_connection(DBusConnection *conn,
DBusMessage *msg, void *user_data)
{
@@ -360,6 +399,7 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
DBusMessageIter entry;
const char *device;
char local[18], remote[18];
+ uint16_t version = HFP_VERSION_1_5;
int fd, err;
DBG("Profile handler NewConnection");
@@ -380,6 +420,13 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
if (fd < 0)
goto invalid;
+ dbus_message_iter_next(&entry);
+ if (dbus_message_iter_get_arg_type(&entry) != DBUS_TYPE_ARRAY)
+ goto invalid;
+
+ if (get_version(&entry, &version) < 0)
+ goto invalid;
+
modem = ofono_modem_find(device_path_compare, (void *) device);
if (modem == NULL) {
close(fd);
@@ -388,7 +435,7 @@ static DBusMessage *profile_new_connection(DBusConnection *conn,
"Unknown Bluetooth device");
}
- err = service_level_connection(modem, fd, HFP_VERSION_LATEST);
+ err = service_level_connection(modem, fd, version);
if (err < 0 && err != -EINPROGRESS) {
close(fd);
return g_dbus_create_error(msg, BLUEZ_ERROR_INTERFACE
--
1.8.2
7 years, 9 months
Re: SAGEM HiloNC v2 Driver
by Freedreamer
Hi Denis,
first of all thanks 4 your reply.
>
> 2013/3/26 Denis Kenzior <denkenz(a)gmail.com>
>
>> Hi Marco,
>>
>>
>> On 03/26/2013 04:07 AM, Freedreamer wrote:
>>
>>> Hi Everybody,
>>>
>>> I'm developing a driver for an embedded system which uses a sagem HiloNC
>>> v2 and I really should need your help. It's my will to commit everything
>>> when shall be ready and working.
>>> First of all I will tell you what i did..I created a plugin sagem.c
>>> ,added a new Vendor , modified makefile & other stuff and seems to work
>>> properly. I started from calypso driver 'cause the modem is based on a
>>> Uart and I needed the MUX over that.
>>> With a very raw/dirty code I was able to use PPP/SMS/net service over
>>> virtual com.. Very good work dude! :)
>>>
>>> Now I would like to clean up my code and get a better understanding of
>>> the stack. Unfortunately I saw that functions/modules are not always
>>> commented so I have to ask u a lot of questions (maybe also trivial):
>>>
>>> 1) AT cmds sent with "g_at_chat_send" are always async , is that right ?
>>> Is there any chance to get them sync ?
>>>
>>
>> There is not, we do not want to encourage any sort of blocking behavior
>> in the daemon. Remember there are potentially multiple modems being
>> operated on and we do not use threads.
>>
>
Ok get it, i thought there were pthreads somewhere.
>> 2) in enable fnc the modem is powered but The sim is not ready so
>>> sometimes It hangs up...Do I have to to poll the sim status until is
>>> ready , or the driver will do that by itself ?
>>>
>>
>> oFono never polls for anything. It is the driver's responsibility to do
>> that in the best possible way for the hardware. Also, powering on the
>> modem is separate from the sim being ready. The general flow is this:
>>
>> -Enable modem
>> -Wait for the modem to power on and use ofono_modem_set_powered when that
>> happens successfully / fails.
>> - Figure out if the SIM is inserted and signal using
>> ofono_sim_inserted_notify. Do this step only once the SIM is ready to be
>> queried for its PIN status and perform any I/O on SIM files that are always
>> accessible (e.g. ICCID)
>>
>
Ok. If Sim not "ready" , sending a signal prematurely could stuck anyhow
the stack ? 'cause it should explain a lot of thing..
>
>>
>> 3) could u explain me what should I really do in virtual fnc set_online
>>> / post_online ? i tried to stub them but they have not never been
>>> called...
>>>
>>
>> oFono has 3 basic states:
>> - Off
>> - Radio Off, Sim On
>> - Radio On, Sim On
>>
>> set_online turns radio on / off
>> post_online populates the atoms that are available in radio 'On' state.
>>
>>
>>
This is what i thought but I do not understand why I don't see the trace
log I put inside them...usually are called before pre_sim fn? are related
to any signal i have to manage/post ?
>
>> 4) unfortunately this modem has a SIM detection URC but it reset itself
>>> every time the status changes... so i should call the disable function
>>> and the enable again in order to have the MUX working... how can i do
>>> that?
>>>
>>
>> I'm not following. Care to elaborate?
>>
>>
>>
I've managing vendor URC for sim detection right now but i have
problems.For instance if I remove it when ofonod is ready the Hilonc sends
an URC to notify sim status changed but after that it reboots itself(2 sec
later)... what i did is to notify the stack that the SIM has been removed
and modem is powered off . I thought that after calling set_powered fnc the
stack should have called my driver virtual disable function in order to
properly close the MUX .. but it's not..
>
>
>> 5) I created and started the MUX as the first thing in enable fnc but is
>>> that right ? sometimes seems that the modem hangs up if just powered up.
>>> Put a delay but don't like it very much as a solution...moreover when I
>>> power up the modem all the URC have been lost 'cause the MUX has not
>>> been created yet..
>>>
>>
>> That is what we do for most devices with a MUX, put it into MUX state
>> right away after basic initialization. The devices we have can be queried
>> for their state in addition to URCs, so it works out very well.
>>
>>
right now i've been using custom URC in the first power up phase to
understand modem status. I manually set them but theoretically I should
check the values saved on the modem every power cycle. What I was thinking
was to test every time the values saved and enabling them if they were not
.After that I should call an AT+cfun=1,1 in order to reset the modem and
force it to send me again the needed URCs . What do u think ?
Thanks again
Marco
Regards,
>> -Denis
>
>
7 years, 9 months
[PATCH 1/5] hfp_hf_bluez5: Add a card driver for HFP 1.6
by Vinicius Costa Gomes
This is just the skeleton of a Handsfree Audio Card for the HF side of
HFP 1.6.
---
plugins/hfp_hf_bluez5.c | 37 +++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/plugins/hfp_hf_bluez5.c b/plugins/hfp_hf_bluez5.c
index ff8afba..e2fa70c 100644
--- a/plugins/hfp_hf_bluez5.c
+++ b/plugins/hfp_hf_bluez5.c
@@ -60,6 +60,8 @@
#define HFP_EXT_PROFILE_PATH "/bluetooth/profile/hfp_hf"
+#define HFP16_HF_DRIVER "hfp16-hf-driver"
+
struct hfp {
struct hfp_slc_info info;
DBusMessage *msg;
@@ -310,6 +312,31 @@ static struct ofono_modem_driver hfp_driver = {
.post_sim = hfp_post_sim,
};
+static int hfp16_card_probe(struct ofono_handsfree_card *card,
+ unsigned int vendor, void *data)
+{
+ return 0;
+}
+
+static void hfp16_card_remove(struct ofono_handsfree_card *card)
+{
+
+}
+
+static void hfp16_card_connect(struct ofono_handsfree_card *card,
+ ofono_handsfree_card_connect_cb_t cb,
+ void *data)
+{
+
+}
+
+static struct ofono_handsfree_card_driver hfp16_hf_driver = {
+ .name = HFP16_HF_DRIVER,
+ .probe = hfp16_card_probe,
+ .remove = hfp16_card_remove,
+ .connect = hfp16_card_connect,
+};
+
static ofono_bool_t device_path_compare(struct ofono_modem *modem,
void *userdata)
{
@@ -616,6 +643,13 @@ static int hfp_init(void)
return -EIO;
}
+ err = ofono_handsfree_card_driver_register(&hfp16_hf_driver);
+ if (err < 0) {
+ g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
+ BLUEZ_PROFILE_INTERFACE);
+ return err;
+ }
+
err = ofono_modem_driver_register(&hfp_driver);
if (err < 0) {
g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
@@ -647,6 +681,9 @@ static void hfp_exit(void)
bt_unregister_profile(conn, HFP_EXT_PROFILE_PATH);
g_dbus_unregister_interface(conn, HFP_EXT_PROFILE_PATH,
BLUEZ_PROFILE_INTERFACE);
+
+ ofono_handsfree_card_driver_unregister(&hfp16_hf_driver);
+
ofono_modem_driver_unregister(&hfp_driver);
g_dbus_client_unref(bluez);
--
1.8.2
7 years, 9 months
[PATCH 00/13] Add support for BlueZ 5 Profile1 API to dundee
by Paulo Borges
This series implements support for BlueZ 5 to dundee. It uses the
org.bluez.Profile1 API to register an external profile.
While the interface between BlueZ and dundee has changed, the interfaces
"org.ofono.dundee.Device" and "org.ofono.dundee.Manager" remains
unchanged.
Paulo Borges (13):
dundee: Rename dundee BlueZ 4 support
dundee: Start BlueZ 5 support
bluez5: Add DUN_UUID
dundee: Initial GDBusClient for BlueZ 5
dundee: Add mechanism to store bluetooth devices
dundee: Add tracking of bluetooth devices
dundee: Listen to devices property changes
dundee: Add dundee device driver skeleton
dundee: Register/unregister dundee device
dundee: Add BlueZ Profile handler
dundee: Add support for driver connect
dundee: Add dundee disconnect function
dundee: Handle Profile connect and disconnect
Makefile.am | 16 +-
dundee/bluetooth.c | 297 -----------------------------------
dundee/bluez4.c | 297 +++++++++++++++++++++++++++++++++++
dundee/bluez5.c | 445 ++++++++++++++++++++++++++++++++++++++++++++++++++++
dundee/device.c | 14 +-
dundee/dundee.h | 5 +
plugins/bluez5.h | 1 +
7 files changed, 769 insertions(+), 306 deletions(-)
delete mode 100644 dundee/bluetooth.c
create mode 100644 dundee/bluez4.c
create mode 100644 dundee/bluez5.c
--
1.7.9.5
7 years, 9 months
[PATCH 1/2] modem: Support modem property "AlwaysOnline"
by Forest Bond
From: Forest Bond <forest.bond(a)rapidrollout.com>
This can be set by the modem driver to indicate that the device is
always in the online state when it is enabled. This is useful for
modem drivers that handle both CDMA and GSM devices.
---
src/modem.c | 20 ++++++++++++++------
1 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/src/modem.c b/src/modem.c
index 0f12f5a..49913a9 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -595,6 +595,17 @@ static gboolean modem_has_sim(struct ofono_modem *modem)
return FALSE;
}
+static gboolean modem_is_always_online(struct ofono_modem *modem)
+{
+ if (modem->driver->set_online == NULL)
+ return TRUE;
+
+ if (ofono_modem_get_boolean(modem, "AlwaysOnline") == TRUE)
+ return TRUE;
+
+ return FALSE;
+}
+
static void common_online_cb(const struct ofono_error *error, void *data)
{
struct ofono_modem *modem = data;
@@ -702,11 +713,8 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user)
case OFONO_SIM_STATE_READY:
modem_change_state(modem, MODEM_STATE_OFFLINE);
- /*
- * If we don't have the set_online method, also proceed
- * straight to the online state
- */
- if (modem->driver->set_online == NULL)
+ /* Modem is always online, proceed to online state. */
+ if (modem_is_always_online(modem) == TRUE)
set_online(modem, TRUE);
if (modem->online == TRUE)
@@ -745,7 +753,7 @@ static DBusMessage *set_property_online(struct ofono_modem *modem,
if (ofono_modem_get_emergency_mode(modem) == TRUE)
return __ofono_error_emergency_active(msg);
- if (driver->set_online == NULL)
+ if (modem_is_always_online(modem) == TRUE)
return __ofono_error_not_implemented(msg);
modem->pending = dbus_message_ref(msg);
--
1.7.0.4
7 years, 9 months
[PATCH 2/2] huawei: Use AlwaysOnline for CDMA modems
by Forest Bond
From: Forest Bond <forest.bond(a)rapidrollout.com>
---
plugins/huawei.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/plugins/huawei.c b/plugins/huawei.c
index 5d8875a..59995b3 100644
--- a/plugins/huawei.c
+++ b/plugins/huawei.c
@@ -447,6 +447,13 @@ static void sysinfo_enable_cb(gboolean ok, GAtResult *result,
g_at_chat_send(data->pcui, "AT^CVOICE=?", cvoice_prefix,
cvoice_support_cb, modem, NULL);
+ /* For CDMA we use AlwaysOnline so we leave the modem online. */
+ if (data->have_gsm == FALSE && data->have_cdma == TRUE) {
+ ofono_modem_set_boolean(modem, "AlwaysOnline", TRUE);
+ ofono_modem_set_powered(modem, TRUE);
+ return;
+ }
+
if (g_at_chat_send(data->pcui, data->offline_command, none_prefix,
cfun_offline, modem, NULL) > 0)
return;
--
1.7.0.4
7 years, 9 months