[RFC] HFP support into oFono and BlueZ
by Gustavo F. Padovan
Hi,
These patches implement the new API for the Audio Gateway in BlueZ. It
follows the last version of the HandsfreeGateway and HandsfreeAgent
Intefaces API.
The first two patches is for BlueZ and the other for oFono. You can
test it with using enable-modem and test-voicecall scripts into the
test dir of oFono.
Feel free to test it and send me your comments. We have some bugs yet.
The audio part is not working yet. We are going to work on pulseaudio
this week to get this done soon.
Regards,
--
Gustavo F. Padovan
ProFUSION embedded systems - http://profusion.mobi
8 years, 6 months
Atmodem PPP Link establishment issues
by Arun.Ravindran@elektrobit.com
> Hi,
>
> We are using atmodem plugin and are trying to get the PPP up and
> running. I am able to create and activate context, but the PPP link
> establishment seems to have issues.
>
> The list-context script returns:
>
> [ /generic ]
> [ /generic/primarycontext3 ]
> Username =
> Name = Internet access
> Settings = { Interface=ppp0 Netmask=255.255.255.255
> Method=static DomainNameServers=192.89.123.231,192.89.123.230,
> Address=109.240.91.14 }
> Active = 1
> AccessPointName = internet
> Password =
> Type = internet
>
> But for a PPP link, there needs to be two ip addresses, one local and
> one of the peer. Here in the settings you see only one IP address.
>
> I collected the logs during the PPP link establishment, (frames and a
> brief detail about it)
>
> Sent from Ofono:
> Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x21 0x7d 0x21 0x7d 0x20
> 0x7d 0x2a 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
> 0x58 0x7b 0x7e
> 03 c021 1 (conf req) 1 (id) 0x000a (length) 2 (accm) 6 (length) 0000
> fcs
>
> Recv from Modem:
> Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x21 0x7d 0x21 0x7d 0x20
> 0x7d 0x34 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
> 0x7d 0x25 0x7d 0x26 0xd2 0x8a 0xde 0xd2 0x7d 0x27 0x7d 0x22 0x7d 0x28
> 0x7d 0x22 0xbf 0x7d 0x35 0x7e
> 3 c021 1 (conf req) 1 (id) 0x0034 2 6 0 0 0 0 5(magic num) 6 d2 8a de
> d2 7(protocol compression) 2 (id) 8 (addr, control compres) 2 fcs
>
>
> Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x22 0x7d 0x21 0x7d 0x20
> 0x7d 0x2a 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
> 0x31 0x7d 0x2f 0x7e
> 3 c021 2 (conf ack) 1 (id) 0x000a 2 6 0 0 0 0 fcs
>
> Sent from ofono:
> Frame: 0x7e 0xff 0x7d 0x23 0xc0 0x21 0x7d 0x22 0x7d 0x21 0x7d 0x20
> 0x7d 0x34 0x7d 0x22 0x7d 0x26 0x7d 0x20 0x7d 0x20 0x7d 0x20 0x7d 0x20
> 0x7d 0x25 0x7d 0x26 0xd2 0x8a 0xde 0xd2 0x7d 0x27 0x7d 0x22 0x7d 0x28
> 0x7d 0x22 0x54 0x7c 0x7e
> 3 c021 2 (conf ack) 1 0x0034 2 6 0000 5 6 d2 8a de d2 7 2 8 2 fcs
>
>
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x1 0x0 0x22 0x3 0x6 0x0 0x0 0x0
> 0x0 0x81 0x6 0x0 0x0 0x0 0x0 0x83 0x6 0x0 0x0 0x0 0x0 0x82 0x6 0x0 0x0
> 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0x80 0x52 0x7e
> 3 8021 1 (conf req) 1 (id) 0x0022 (length) 3 (ip) 6 0000 81(dns1) 6
> 0000 83(nbns1) 6 0000 82(dns2) 6 0000 84 (nbns2) 6 0000 fcs
>
> Recv from Modem:
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x1 0x0 0x10 0x81 0x6 0xa 0xb 0xc
> 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x4d 0x4d 0x7e
> 3 8021 3(conf nak) 1 (id) 0x010 81 (dns1) 6 abcd 83 (dns2) 6 abce fcs
>
> Sent from ofono:
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x2 0x0 0x22 0x3 0x6 0x0 0x0 0x0
> 0x0 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x82 0x6 0x0 0x0
> 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0xad 0x7a 0x7e
> 3 8021 1 (conf ack) 2 (id) 0x0022 3 6 0000 81 6 abcd 83 6 abce 82 6
> 0000 84 6 0000 fcs
>
> Recv from Modem:
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x2 0x0 0x10 0x81 0x6 0xa 0xb 0xc
> 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x33 0x95 0x7e
> 3 8021 3(conf nak) 2 (id) 0x010 81 (dns1) 6 abcd 83 (dns2) 6 abce fcs
>
> Sent from ofono:
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x3 0x0 0x22 0x3 0x6 0x0 0x0 0x0
> 0x0 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0x82 0x6 0x0 0x0
> 0x0 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0xce 0x3a 0x7e
> 3 8021 1 (conf req) 3 (id) 0x0022 3 6 0000 81 6 abcd 83 6 abce 82 6
> 0000 84 6 0000 fcs
>
> Recv from Modem:
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x1 0x0 0x4 0x0 0xb7 0x7e
> 3 8021 1 (conf req) 1 (id) 0 4 0 fcs
>
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x4 0x3 0x0 0x10 0x82 0x6 0x0 0x0 0x0
> 0x0 0x84 0x6 0x0 0x0 0x0 0x0 0x34 0xcc 0x7e
> 3 8021 4 (conf reject) 3(id) 0x0010 82 6 0000 84 6 0000 fcs
>
> Sent from ofono:
> Frame: 0xff 0x3 0x80 0x21 0x2 0x1 0x0 0x4 0xcd 0x92 0x7e
> 3 8021 2 (conf ack) 1 (id) 0 4
>
> Frame: 0xff 0x3 0x80 0x21 0x1 0x4 0x0 0x16 0x3 0x6 0x0 0x0 0x0 0x0
> 0x81 0x6 0xa 0xb 0xc 0xd 0x83 0x6 0xa 0xb 0xc 0xe 0xe3 0x9 0x7e
> 3 8021 1 (conf req) 4 (id) 0x0016 3 6 0000 81 6 abcd 83 6 abce fcs
>
> Recv from modem:
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x3 0x4 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
> 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0xc5
> 0xf1 0x7e
> 3 8021 3 (conf nak) 4 (id) 0x0016 3 (ip) 6 6d f0 40 be 81 (dns1) 6 c0
> 59 7b e7 83 (dns2) 6 c0 59 7b e6 fcs
>
> Sent from ofono:
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x1 0x5 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
> 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0x2
> 0x9c 0x7e
> 3 8021 1 (conf req) 5 (id) 0x0016 3 6 6d f0 40 be 81 6 c0 59 7b e7 83
> 6 c0 59 7b e6 fcs
>
> Recv from Modem:
> Frame: 0x7e 0xff 0x3 0x80 0x21 0x2 0x5 0x0 0x16 0x3 0x6 0x6d 0xf0 0x40
> 0xbe 0x81 0x6 0xc0 0x59 0x7b 0xe7 0x83 0x6 0xc0 0x59 0x7b 0xe6 0xf4
> 0x6f 0x7e
> 3 8021 2 (conf ack) 5 (id) 0x0016 3 6 6d f0 40 be 81 6 c0 59 7b e7 83
> 6 c0 59 7b e6 fcs
>
> I could not find any issues in the state transition w.r.t the RFC, but
> I get only one IP address, what is going wrong? Could any one help?
>
>
> ----------------------------------------------------------------------
> -----------------------
>
> Regards
> Arun Ravindran
> Specialist, Elektrobit OYJ
> Keilasatama 5, Espoo
> M: +358403445507
>
----------------------------------------------------------------
Please note: This e-mail may contain confidential information
intended solely for the addressee. If you have received this
e-mail in error, please do not disclose it to anyone, notify
the sender promptly, and delete the message from your system.
Thank you.
10 years, 6 months
oFono v0.22 test report
by Li, Zhigang
Test Objective
--------------------------------------
This is QA regular release testing cycle for oFono released. Our testing focus would be new features exploration and regression testing, to ensure major issues for new features are exposed in timely fashion.
Test Environment
-------------------------------
General Features:
General PC (pre-installed FC12)
- ofono v0.22
- phonesim 1.2
HFP:
Netbook EeePC901
- MeeGo20100424 image
- Sony Ericsson C905, Nokia N95
- ofono v0.22
- Bluez v4.63
GPRS:
- MBM modem
- ofono v0.22
- UNICOM 3G WCDMA network
Modem Emulator:
- test-server tool in ofono
-------------------------------
Test Scope
-------------------------------
The test will do full light functional validation, mainly focus on checking implemented functionality of ofono v0.22 (voice call, message, cell broadcast, phonebook, sim, supplementary service, modem management, voice mail, call volume, call history, message history, GPRS, HFP, USSD) base on phonesim simulator and some hardware devices.
As the dependence of modem, we will do PPP test with gsmdial later.
Test Summary
-------------------------------
During the v0.21 testing, we found the v0.22 release, so switch to v0.22 immediately.
The test result is positive. Most functionalities work well and more stable,
we reported 1 major Bluetooth bug during HFP test, verified 4 bugs, so far, no blocking, critical issues remain.
Executed total 276 test cases during this round of testing, and among them:
Pass: 266
Fail: 10
New Bugs
-------------------------------
Bug 2782 Bluetooth lost connection after unload loopback module in PA.
Open bugs
-------------------------------
2515 nor S5 command not really work in modem emulator
2517 nor Non at command did not handle properly in modem emulator
2519 nor S3 command can not work normally without default value
8898 enh Spend long time on getting fail report of sms
10061 GSM Compliance issue in sim phonebook
9453 enh [Phonesim] To support UCS2 encode in Cell Broadcast Message
9371 nor Modem interface information didn't be updated after modem was removed
868 nor ussd notification display is incorrect with UCS2 character set
872 maj Can not deactivate all contexts
Fixed bugs
-------------------------------
8185 nor Segmentation fault in ste modem which may caused by call history
Verified Bugs
------------------------------
870 can't cancel/response ussd notification
434 Can't input pin code
435 Can't reset the pin code as the same old number
443 can't change the password by gsm string
Details
The every checkpoint would be one or more test case to cover and result is for functionality, besides you may find some functional limitation in comments
------------------------------
Features checkpoints test results comments
Call history Missed call pass
Outgoing call pass
Incoming call pass
Duration pass
Date pass
SMS Send/receive pass
Class0, 1 pass
Set service center address pass
More segments pass
Different character set pass
Voice call Dial pass
Accept pass
Reject pass
Hold pass
Retrieve pass
Release pass
ECT pass
Multiparty call Create pass
Hang up pass
Private chat pass
Hold pass
Sim Phonebook Read pass
Different character set pass
Vcard3.0 pass
SS CF pass
CB pass
CW pass
CLIR/CLIP pass
Setting AOC pass
CF/CB pass
GSM string General strings pass
USSD pass
USSD Send pass
Cancel request pass
Respond pass
Different character set fail #868
Modem Basic function pass
Two modems pass
Abnormal quit fail #9371
Voice mail Get/Set number pass
Message Count pass
Notification pass
CPHS information pass
Networking Basic network information pass
Signal indicator pass
Scan pass
Register pass
SIM file Read IMSI pass
Read/set MSISDN pass
Read Emergency number pass
Read SDN number pass
PIN code pass
PUK pass
Cell broadcast Receive a CB message pass
Receive several CB messages pass
Receive more pages CB message pass
Different language pass
Call volume Set/get volume pass
Mute/unmute pass
Message history Send history pass
Receive history pass
Date pass
HFP Voice call pass
Multiparty call pass
Networking pass
Call volume pass
Audio control pass
GPRS Active context pass
Edit profiles pass
Deactivate context pass
Deactivate all context fail #872
Detach pass
Attach pass
Create context pass
Remove context pass
Modem Emualtor Basic AT command pass
Negative fail #2515,#2517,#2519
-------------------------------
Thanks
Zhigang
10 years, 6 months
[PATCH v3 0/2] Huawei GPRS support
by Kalle Valo
Here's v3 of my Huawei GPRS patches. I followed Marcel's advice and
implemented all Huawei quirks in the huawei plugin. Now the patches
are a lot smaller.
Please comment.
---
Kalle Valo (2):
huawei: add gprs context
huawei: detect SecondaryDevice which is used for events
drivers/atmodem/network-registration.c | 4 +
plugins/huawei.c | 112 +++++++++++++++++++++++++++++++-
plugins/udev.c | 61 +++++++++++++++--
3 files changed, 167 insertions(+), 10 deletions(-)
10 years, 6 months
[PATCH v3] Fix busylooped in ppp_disconnect for huawei modem
by Zhenhua Zhang
Huawei modem closes the modem port after PPP disconnect. So the channel
of gatchat is NULL in ppp_disconnect. In such case, we resume the chat
and it causes huawei_disconnect() get called and the gprs context is
removed later.
Before removing this gprs context, we should reply the pending DBus
message to the client.
---
drivers/atmodem/gprs-context.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
index fea80b0..6589560 100644
--- a/drivers/atmodem/gprs-context.c
+++ b/drivers/atmodem/gprs-context.c
@@ -93,7 +93,6 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
g_at_ppp_unref(gcd->ppp);
gcd->ppp = NULL;
- g_at_chat_resume(gcd->chat);
switch (gcd->state) {
case STATE_ENABLING:
@@ -110,6 +109,12 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
gcd->active_context = 0;
gcd->state = STATE_IDLE;
+ /*
+ * If the channel of gcd->chat is NULL, it might cause
+ * gprs_context_remove get called and the gprs context will be
+ * removed.
+ */
+ g_at_chat_resume(gcd->chat);
}
static gboolean setup_ppp(struct ofono_gprs_context *gc)
@@ -257,7 +262,7 @@ static void at_gprs_context_remove(struct ofono_gprs_context *gc)
DBG("");
- if (gcd->state != STATE_IDLE) {
+ if (gcd->state != STATE_IDLE && gcd->ppp) {
g_at_ppp_unref(gcd->ppp);
g_at_chat_resume(gcd->chat);
}
--
1.7.0.4
10 years, 7 months
[PATCH 1/3] Bluetooth DUN modem prototype
by Gustavo F. Padovan
Add a still dummy DUN code, now it can only creates and removes modems.
The DUN plugin follows the HFP one a lot, the is basics a copy of some
HFP plugin's parts.
---
Makefile.am | 6 ++
drivers/dunmodem/dunmodem.c | 51 +++++++++++
drivers/dunmodem/dunmodem.h | 29 ++++++
plugins/bluetooth.c | 11 +++
plugins/bluetooth.h | 2 +
plugins/dun.c | 202 +++++++++++++++++++++++++++++++++++++++++++
6 files changed, 301 insertions(+), 0 deletions(-)
create mode 100644 drivers/dunmodem/dunmodem.c
create mode 100644 drivers/dunmodem/dunmodem.h
create mode 100644 plugins/dun.c
diff --git a/Makefile.am b/Makefile.am
index e256841..a6f2bff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -179,6 +179,9 @@ builtin_sources += drivers/atmodem/atutil.h \
drivers/hfpmodem/network-registration.c \
drivers/hfpmodem/call-volume.c
+builtin_modules += dunmodem
+builtin_sources += drivers/dunmodem/dunmodem.h drivers/dunmodem/dunmodem.c
+
builtin_modules += mbmmodem
builtin_sources += drivers/atmodem/atutil.h \
drivers/mbmmodem/mbmmodem.h \
@@ -242,6 +245,9 @@ builtin_sources += plugins/bluetooth.c plugins/bluetooth.h
builtin_modules += hfp
builtin_sources += plugins/hfp.c plugins/bluetooth.h
+builtin_modules += dun
+builtin_sources += plugins/dun.c
+
builtin_modules += palmpre
builtin_sources += plugins/palmpre.c
diff --git a/drivers/dunmodem/dunmodem.c b/drivers/dunmodem/dunmodem.c
new file mode 100644
index 0000000..8658bee
--- /dev/null
+++ b/drivers/dunmodem/dunmodem.c
@@ -0,0 +1,51 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2010 Intel Corporation. All rights reserved.
+ * Copyright (C) 2010 Gustavo F. Padovan <gustavo(a)padovan.org>
+ *
+ * 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <glib.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/log.h>
+#include <ofono/modem.h>
+
+#include "dunmodem.h"
+
+static int dunmodem_init(void)
+{
+ return 0;
+}
+
+static void dunmodem_exit(void)
+{
+}
+
+OFONO_PLUGIN_DEFINE(dunmodem, "Dial-up Networking Driver", VERSION,
+ OFONO_PLUGIN_PRIORITY_DEFAULT, dunmodem_init, dunmodem_exit)
+
diff --git a/drivers/dunmodem/dunmodem.h b/drivers/dunmodem/dunmodem.h
new file mode 100644
index 0000000..6bbf7b9
--- /dev/null
+++ b/drivers/dunmodem/dunmodem.h
@@ -0,0 +1,29 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2010 Gustavo F. Padovan <gustavo(a)padovan.org>
+ *
+ * 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+#ifndef __DUN_MODEM_H__
+#define __DUN_MODEM_H__
+
+struct dun_data {
+ char *dun_path;
+};
+
+#endif
+
diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index 5a85eaa..b7ec0d3 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -218,6 +218,9 @@ static void has_uuid(DBusMessageIter *array, gpointer user_data)
if (!strcasecmp(uuid, HFP_AG_UUID))
*profiles |= HFP_AG;
+ if (!strcasecmp(uuid, DUN_GW_UUID))
+ *profiles |= DUN_GW;
+
dbus_message_iter_next(&value);
}
}
@@ -276,6 +279,14 @@ static void device_properties_cb(DBusPendingCall *call, gpointer user_data)
profile->create(path, device_addr, adapter_addr, alias);
}
+ if ((have_uuid & DUN_GW) && device_addr && adapter_addr) {
+ profile = g_hash_table_lookup(uuid_hash, DUN_GW_UUID);
+ if (!profile || !profile->create)
+ goto done;
+
+ profile->create(path, device_addr, adapter_addr, alias);
+ }
+
done:
dbus_message_unref(reply);
}
diff --git a/plugins/bluetooth.h b/plugins/bluetooth.h
index fb0d841..09e6efa 100644
--- a/plugins/bluetooth.h
+++ b/plugins/bluetooth.h
@@ -24,9 +24,11 @@
#define BLUEZ_DEVICE_INTERFACE BLUEZ_SERVICE ".Device"
#define HFP_AG_UUID "0000111F-0000-1000-8000-00805F9B34FB"
+#define DUN_GW_UUID "00001103-0000-1000-8000-00805F9B34FB"
/* Profiles bitfield */
#define HFP_AG 0x01
+#define DUN_GW 0x02
struct bluetooth_profile {
const char *name;
diff --git a/plugins/dun.c b/plugins/dun.c
new file mode 100644
index 0000000..9b4288e
--- /dev/null
+++ b/plugins/dun.c
@@ -0,0 +1,202 @@
+/*
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2010 Intel Corporation. All rights reserved.
+ * Copyright (C) 2010 Gustavo F. Padovan <gustavo(a)padovan.org>
+ *
+ * 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <glib.h>
+#include <ofono.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/log.h>
+#include <ofono/modem.h>
+
+#include <drivers/dunmodem/dunmodem.h>
+
+#include <ofono/dbus.h>
+
+#include "bluetooth.h"
+
+#ifndef DBUS_TYPE_UNIX_FD
+#define DBUS_TYPE_UNIX_FD -1
+#endif
+
+static DBusConnection *connection;
+static GHashTable *modem_hash = NULL;
+
+static int dun_create_modem(const char *device, const char *dev_addr,
+ const char *adapter_addr, const char *alias)
+{
+ struct ofono_modem *modem;
+ struct dun_data *data;
+ char buf[256];
+
+ /* We already have this device in our hash, ignore */
+ if (g_hash_table_lookup(modem_hash, device) != NULL)
+ return -EALREADY;
+
+ ofono_info("Using device: %s, devaddr: %s, adapter: %s",
+ device, dev_addr, adapter_addr);
+
+ strcpy(buf, "dun/");
+ bluetooth_create_path(dev_addr, adapter_addr, buf + 4, sizeof(buf) - 4);
+
+ modem = ofono_modem_create(buf, "dun");
+ if (modem == NULL)
+ return -ENOMEM;
+
+ data = g_try_new0(struct dun_data, 1);
+ if (!data)
+ goto free;
+
+ data->dun_path = g_strdup(device);
+ if (data->dun_path == NULL)
+ goto free;
+
+ ofono_modem_set_data(modem, data);
+ ofono_modem_set_name(modem, alias);
+ ofono_modem_register(modem);
+
+ g_hash_table_insert(modem_hash, g_strdup(device), modem);
+ return 0;
+
+free:
+ g_free(data);
+ ofono_modem_remove(modem);
+
+ return -ENOMEM;
+}
+
+static gboolean dun_remove_each_modem(gpointer key, gpointer value, gpointer user_data)
+{
+ struct ofono_modem *modem = value;
+
+ ofono_modem_remove(modem);
+
+ return TRUE;
+}
+
+static void dun_remove_all_modem()
+{
+ if (modem_hash == NULL)
+ return;
+
+ g_hash_table_foreach_remove(modem_hash, dun_remove_each_modem, NULL);
+}
+
+static void dun_set_alias(const char *device, const char *alias)
+{
+ struct ofono_modem *modem;
+
+ if (!device || !alias)
+ return;
+
+ modem = g_hash_table_lookup(modem_hash, device);
+ if (!modem)
+ return;
+
+ ofono_modem_set_name(modem, alias);
+}
+
+static int dun_probe(struct ofono_modem *modem)
+{
+ DBG("%p", modem);
+ return 0;
+}
+
+static void dun_remove(struct ofono_modem *modem)
+{
+ struct dun_data *data = ofono_modem_get_data(modem);
+
+ g_hash_table_remove(modem_hash, data->dun_path);
+
+ g_free(data->dun_path);
+ g_free(data);
+
+ ofono_modem_set_data(modem, NULL);
+}
+
+static int dun_enable(struct ofono_modem *modem)
+{
+ DBG("%p", modem);
+ return 0;
+}
+
+static int dun_disable(struct ofono_modem *modem)
+{
+ DBG("%p", modem);
+ return 0;
+}
+
+static struct ofono_modem_driver dun_driver = {
+ .name = "dun",
+ .probe = dun_probe,
+ .remove = dun_remove,
+ .enable = dun_enable,
+ .disable = dun_disable,
+};
+
+static struct bluetooth_profile dun_profile = {
+ .name = "dun",
+ .create = dun_create_modem,
+ .remove_all = dun_remove_all_modem,
+ .set_alias = dun_set_alias,
+};
+
+static int dun_init()
+{
+ int err;
+
+ if (DBUS_TYPE_UNIX_FD < 0)
+ return -EBADF;
+
+ connection = ofono_dbus_get_connection();
+
+ err = ofono_modem_driver_register(&dun_driver);
+ if (err < 0)
+ return err;
+
+ err = bluetooth_register_uuid(DUN_GW_UUID, &dun_profile);
+ if (err < 0) {
+ ofono_modem_driver_unregister(&dun_driver);
+ return err;
+ }
+
+ modem_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
+ g_free, NULL);
+
+ return 0;
+}
+
+static void dun_exit()
+{
+ bluetooth_unregister_uuid(DUN_GW_UUID);
+ ofono_modem_driver_unregister(&dun_driver);
+
+ g_hash_table_destroy(modem_hash);
+}
+
+OFONO_PLUGIN_DEFINE(dun, "Dial-up Networking Profile Plugins", VERSION,
+ OFONO_PLUGIN_PRIORITY_DEFAULT, dun_init, dun_exit)
--
1.7.1.1
10 years, 7 months
[patch 00/20] SMS D-Bus support and misc small patches
by Inaky Perez-Gonzalez
From: Inaky Perez-Gonzalez <inaky.perez-gonzalez(a)intel.com>
This (3rd? 4th?) version of the patchset builds the D-Bus support on
top of the new _txq_submit() callback mechanism.
Note there are still a couple of opens that need discussion:
- the message ID is generated based on the contents of the message --
thus, the current way doesn't work. We need the caller to
_txq_submit() to generate it. It's been left out of the STK
stc.c:handle_command_send_sms() because I am not sure what is the
right way to do it -- need feedback on that.
- The generation of the SMS message ID based on contents still has
shortcomings: if we submit two messages with the same content and
destination number, the ID is the same [sms.c:sms_msg_send()]. What
other factor would make sense to add? time?
The following changes since commit 94344e967b4cd3edd65aa5254ef4b4f5dd037e69:
Denis Kenzior (1):
TODO: Major updates to STK related tasks
are available in the git repository at:
git://gitorious.org/~inakypg/ofono/ofono-inakypg.git master
Patches follow for reviewing convenience.
Inaky Perez-Gonzalez (20):
bug.h: Add BUILD_BUG_ON() and friends for compile-time assert checking
write_file: make transaction-safe
manpage: explain debugging options to -d
SMS: introduce message ID API
introduce DECLARE_SMS_ADDR_STR()
_assembly_encode_address: export and rename
SMS: implement SHA256-based message IDs [incomplete]
sms: document the org.ofono.SMSMessage D-Bus interface
SMS: document handle_sms_status_report()
sms_text_prepare: document @use_delivery_reports
SMS: rename create_tx_queue_entry() to tx_queue_entry_new()
struct tx_queue_entry: add a destructor
SMS: encapsulate D-Bus specific data in 'struct sms_msg_dbus_data'
SMS: introduce bare state machine and transitions
SMS: introduce Wait-for-Status-Report state and infrastructure
SMS: introduce a state change callback for TX messages
SMS: export outgoing messages over D-Bus
SMS: send D-Bus SMS-MSG::PropertyChanged signals when message changes status
SMS: introduce sms_msg_cancel and its D-Bus wrapper
SMS: Implement D-Bus SMS-MSG::GetProperties
HACKING | 10 +
Makefile.am | 5 +-
doc/ofonod.8 | 5 +-
doc/sms-api.txt | 49 ++++-
src/bug.h | 50 ++++
src/ofono.h | 42 +++-
src/sms.c | 598 ++++++++++++++++++++++++++++++++++------
src/smsutil.c | 206 ++++++++++++++-
src/smsutil.h | 122 ++++++++
src/stk.c | 24 ++-
src/storage.c | 42 ++-
test/test-sms-msg-cancel | 173 ++++++++++++
test/test-sms-msg-state-change | 24 ++
unit/test-sms-msg-id.c | 212 ++++++++++++++
14 files changed, 1449 insertions(+), 113 deletions(-)
create mode 100644 src/bug.h
create mode 100755 test/test-sms-msg-cancel
create mode 100755 test/test-sms-msg-state-change
create mode 100644 unit/test-sms-msg-id.c
10 years, 7 months
[PATCH] sim: allow partial reads of tranparent files
by Kristen Carlson Accardi
Implement ofono_sim_read_bytes(). For transparent files, this
will read num_bytes from a specified offset of a given fileid.
---
include/sim.h | 5 +++++
src/sim.c | 27 ++++++++++++++++++++++++---
2 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/include/sim.h b/include/sim.h
index 36a99b9..15cd6b8 100644
--- a/include/sim.h
+++ b/include/sim.h
@@ -198,6 +198,11 @@ int ofono_sim_read(struct ofono_sim *sim, int id,
enum ofono_sim_file_structure expected,
ofono_sim_file_read_cb_t cb, void *data);
+int ofono_sim_read_bytes(struct ofono_sim *sim, int id,
+ enum ofono_sim_file_structure expected,
+ unsigned short offset, int num_bytes,
+ ofono_sim_file_read_cb_t cb, void *data);
+
int ofono_sim_write(struct ofono_sim *sim, int id,
ofono_sim_file_write_cb_t cb,
enum ofono_sim_file_structure structure, int record,
diff --git a/src/sim.c b/src/sim.c
index 2514e7b..63dea19 100644
--- a/src/sim.c
+++ b/src/sim.c
@@ -60,6 +60,8 @@ struct sim_file_op {
int id;
gboolean cache;
enum ofono_sim_file_structure structure;
+ unsigned short offset;
+ int num_bytes;
int length;
int record_length;
int current;
@@ -1434,7 +1436,7 @@ static void sim_op_retrieve_cb(const struct ofono_error *error,
return;
}
- cb(1, op->length, op->current, data, op->record_length, op->userdata);
+ cb(1, len, op->current, data, op->record_length, op->userdata);
if (op->cache && imsi) {
char *path = g_strdup_printf(SIM_CACHE_PATH,
@@ -1472,7 +1474,16 @@ static gboolean sim_op_retrieve_next(gpointer user)
return FALSE;
}
- sim->driver->read_file_transparent(sim, op->id, 0, op->length,
+ if (op->num_bytes < 0)
+ op->num_bytes = op->length;
+
+ if (op->offset + op->num_bytes > op->length) {
+ sim_op_error(sim);
+ return FALSE;
+ }
+
+ sim->driver->read_file_transparent(sim, op->id, op->offset,
+ op->num_bytes,
sim_op_retrieve_cb, sim);
break;
case OFONO_SIM_FILE_STRUCTURE_FIXED:
@@ -1723,8 +1734,9 @@ static gboolean sim_op_next(gpointer user_data)
return FALSE;
}
-int ofono_sim_read(struct ofono_sim *sim, int id,
+int ofono_sim_read_bytes(struct ofono_sim *sim, int id,
enum ofono_sim_file_structure expected_type,
+ unsigned short offset, int num_bytes,
ofono_sim_file_read_cb_t cb, void *data)
{
struct sim_file_op *op;
@@ -1755,6 +1767,8 @@ int ofono_sim_read(struct ofono_sim *sim, int id,
op->cb = cb;
op->userdata = data;
op->is_read = TRUE;
+ op->offset = offset;
+ op->num_bytes = num_bytes;
g_queue_push_tail(sim->simop_q, op);
@@ -1764,6 +1778,13 @@ int ofono_sim_read(struct ofono_sim *sim, int id,
return 0;
}
+int ofono_sim_read(struct ofono_sim *sim, int id,
+ enum ofono_sim_file_structure expected_type,
+ ofono_sim_file_read_cb_t cb, void *data)
+{
+ return ofono_sim_read_bytes(sim, id, expected_type, 0, -1, cb, data);
+}
+
int ofono_sim_write(struct ofono_sim *sim, int id,
ofono_sim_file_write_cb_t cb,
enum ofono_sim_file_structure structure, int record,
--
1.7.1.1
10 years, 7 months
USSD support in ofono-0.25
by s s
Is USSD support is available and functional in ofono latest version?
I found the support in SupplementaryServices interface and I am able to read
the properties from this interface, but I am getting error when try to call
"Initiate" method,
from the definition of "Initiate" method in ussd.c found that out arguments
are "sv". below is the test code.
gchar *str=NULL;
GValue val={0,};
g_value_init(&val,G_TYPE_STRING);
dbus_g_proxy_call (proxy,
"Initiate",&error,G_TYPE_STRING,"*#43#",G_TYPE_INVALID,G_TYPE_STRING,&str,G_TYPE_VALUE,&val,
G_TYPE_INVALID);
if above code is executed , the error is
" GLib-GObject-WARNING **: gvalue.c:185: cannot initialize GValue with type
`GValueArray_gchararray+GHashTable_gchararray+GValue__', the value has
already been initialized as `gchararray'
Couldn't convert argument, expected "GValue" "
and in generate_cw_ss_query_reply callback , message signature is "(sa{sv})"
so tried with
GArray *list;
GHashTable *OUT_arg0=NULL;
dbus_g_proxy_call (proxy,
"Initiate",&error,G_TYPE_STRING,"*#43#",G_TYPE_INVALID,
dbus_g_type_get_struct ("GValueArray",
G_TYPE_STRING,
dbus_g_type_get_map ("GHashTable",
G_TYPE_STRING, G_TYPE_VALUE),G_TYPE_INVALID),
&OUT_arg0, G_TYPE_INVALID);
but it is returning error " Expected D-BUS struct, got type code 's'"
can any body please tell me the correct return types.
in both cases ofono is getting response from phonesim.
and no proper documentation is available for USSD support .
can anybody please help?
thanks
sk.
10 years, 7 months
[PATCH 1/6] Add STK agent utilities and logic.
by Andrzej Zaborowski
---
Makefile.am | 2 +-
src/stkagent.c | 299 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
src/stkagent.h | 47 +++++++++
3 files changed, 347 insertions(+), 1 deletions(-)
create mode 100644 src/stkagent.c
create mode 100644 src/stkagent.h
diff --git a/Makefile.am b/Makefile.am
index e256841..0e9086b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -270,7 +270,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) \
src/storage.c src/cbs.c src/watch.c src/call-volume.c \
src/gprs.c src/idmap.h src/idmap.c \
src/radio-settings.c src/stkutil.h src/stkutil.c \
- src/nettime.c
+ src/nettime.c src/stkagent.c src/stkagent.h
src_ofonod_LDADD = $(builtin_libadd) @GLIB_LIBS@ @DBUS_LIBS@ @CAPNG_LIBS@ -ldl
diff --git a/src/stkagent.c b/src/stkagent.c
new file mode 100644
index 0000000..d49fec3
--- /dev/null
+++ b/src/stkagent.c
@@ -0,0 +1,299 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2010 Intel Corporation. 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#define _GNU_SOURCE
+#include <stdint.h>
+#include <string.h>
+
+#include <glib.h>
+#include <gdbus.h>
+
+#include "ofono.h"
+
+#include "stkagent.h"
+
+typedef void (*stk_agent_request_return)(struct stk_agent *agent,
+ enum stk_agent_result result,
+ DBusMessage *reply);
+
+struct stk_agent {
+ char *path;
+ char *bus;
+ DBusMessage *msg;
+ DBusPendingCall *call;
+ guint disconnect_watch;
+ guint cmd_send_source;
+ stk_agent_request_return cmd_cb;
+ int cmd_timeout;
+ stk_agent_generic_cb user_cb;
+ void *user_data;
+ ofono_bool_t is_default;
+ GDestroyNotify destroy_notify;
+ void *destroy_data;
+};
+
+#define OFONO_NAVIGATION_PREFIX OFONO_SERVICE ".Error"
+#define OFONO_NAVIGATION_GOBACK OFONO_NAVIGATION_PREFIX ".GoBack"
+#define OFONO_NAVIGATION_TERMINATED OFONO_NAVIGATION_PREFIX ".EndSession"
+
+static void stk_agent_request_send_cancel(struct stk_agent *agent)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ DBusMessage *message;
+
+ message = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_SIM_APP_INTERFACE,
+ "Cancel");
+ if (message == NULL)
+ return;
+
+ dbus_message_set_no_reply(message, TRUE);
+
+ g_dbus_send_message(conn, message);
+}
+
+static void stk_agent_request_end(struct stk_agent *agent)
+{
+ agent->cmd_cb = NULL;
+
+ if (agent->cmd_send_source) {
+ g_source_remove(agent->cmd_send_source);
+ agent->cmd_send_source = 0;
+ }
+
+ if (agent->msg) {
+ dbus_message_unref(agent->msg);
+ agent->msg = NULL;
+ }
+
+ if (agent->call) {
+ dbus_pending_call_cancel(agent->call);
+ dbus_pending_call_unref(agent->call);
+ agent->call = NULL;
+ }
+}
+
+ofono_bool_t stk_agent_busy(struct stk_agent *agent)
+{
+ return agent->cmd_cb != NULL;
+}
+
+ofono_bool_t stk_agent_matches(struct stk_agent *agent,
+ const char *path, const char *sender)
+{
+ return !strcmp(agent->path, path) && !strcmp(agent->bus, sender);
+}
+
+void stk_agent_set_destroy_watch(struct stk_agent *agent, GDestroyNotify notify,
+ void *user_data)
+{
+ agent->destroy_notify = notify;
+ agent->destroy_data = user_data;
+}
+
+void stk_agent_request_cancel(struct stk_agent *agent)
+{
+ if (!stk_agent_busy(agent))
+ return;
+
+ agent->cmd_cb(agent, STK_AGENT_RESULT_CANCEL, NULL);
+
+ stk_agent_request_end(agent);
+
+ stk_agent_request_send_cancel(agent);
+}
+
+static void stk_agent_request_terminate(struct stk_agent *agent)
+{
+ agent->cmd_cb(agent, STK_AGENT_RESULT_TERMINATE, NULL);
+
+ stk_agent_request_end(agent);
+}
+
+void stk_agent_remove(struct stk_agent *agent)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ if (agent->disconnect_watch) {
+ DBusMessage *message;
+
+ if (stk_agent_busy(agent)) {
+ stk_agent_request_terminate(agent);
+
+ stk_agent_request_send_cancel(agent);
+ }
+
+ message = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_SIM_APP_INTERFACE,
+ "Release");
+ if (message) {
+ dbus_message_set_no_reply(message, TRUE);
+
+ g_dbus_send_message(conn, message);
+ }
+
+ g_dbus_remove_watch(conn, agent->disconnect_watch);
+ agent->disconnect_watch = 0;
+ } else {
+ if (stk_agent_busy(agent))
+ stk_agent_request_terminate(agent);
+ }
+
+ if (agent->destroy_notify)
+ agent->destroy_notify(agent->destroy_data);
+
+ g_free(agent->path);
+ g_free(agent->bus);
+ g_free(agent);
+}
+
+static void stk_agent_request_reply_handle(DBusPendingCall *call, void *data)
+{
+ struct stk_agent *agent = data;
+ DBusError err;
+ DBusMessage *reply = dbus_pending_call_steal_reply(call);
+ enum stk_agent_result result = STK_AGENT_RESULT_OK;
+
+ dbus_error_init(&err);
+ if (dbus_set_error_from_message(&err, reply)) {
+ ofono_error("SimAppAgent %s replied with error %s, %s",
+ agent->path, err.name, err.message);
+
+ if (g_str_equal(err.name, DBUS_ERROR_NO_REPLY))
+ result = STK_AGENT_RESULT_TIMEOUT;
+ if (g_str_equal(err.name, OFONO_NAVIGATION_GOBACK))
+ result = STK_AGENT_RESULT_BACK;
+ else
+ result = STK_AGENT_RESULT_TERMINATE;
+
+ dbus_error_free(&err);
+ }
+
+ agent->cmd_cb(agent, result, reply);
+
+ stk_agent_request_end(agent);
+
+ dbus_message_unref(reply);
+
+ if (result != STK_AGENT_RESULT_TERMINATE)
+ return;
+
+ if (agent->is_default)
+ return;
+
+ stk_agent_remove(agent);
+}
+
+static gboolean stk_agent_request_send(gpointer user_data)
+{
+ struct stk_agent *agent = user_data;
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ agent->cmd_send_source = 0;
+
+ if (dbus_connection_send_with_reply(conn, agent->msg, &agent->call,
+ agent->cmd_timeout) == FALSE ||
+ agent->call == NULL) {
+ ofono_error("Couldn't send a method call");
+
+ stk_agent_request_terminate(agent);
+
+ return FALSE;
+ }
+
+ dbus_pending_call_set_notify(agent->call,
+ stk_agent_request_reply_handle,
+ agent, NULL);
+
+ return FALSE;
+}
+
+static gboolean stk_agent_request_start(struct stk_agent *agent,
+ const char *method,
+ stk_agent_request_return cb,
+ stk_agent_generic_cb user_cb,
+ void *user_data, int timeout)
+{
+ if (agent == NULL) {
+ cb(agent, STK_AGENT_RESULT_TERMINATE, NULL);
+
+ return FALSE;
+ }
+
+ agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_SIM_APP_INTERFACE,
+ method);
+ if (agent->msg == NULL) {
+ ofono_error("Couldn't make a DBusMessage");
+
+ cb(agent, STK_AGENT_RESULT_TERMINATE, NULL);
+
+ return FALSE;
+ }
+
+ if (stk_agent_busy(agent))
+ stk_agent_request_cancel(agent);
+
+ agent->cmd_cb = cb;
+ agent->cmd_timeout = timeout;
+ agent->user_cb = user_cb;
+ agent->user_data = user_data;
+
+ agent->cmd_send_source = g_timeout_add(0, stk_agent_request_send,
+ agent);
+
+ return TRUE;
+}
+
+static void stk_agent_disconnect_cb(DBusConnection *conn, void *user_data)
+{
+ struct stk_agent *agent = user_data;
+
+ ofono_debug("Agent exited without calling Unregister");
+
+ agent->disconnect_watch = 0;
+
+ stk_agent_remove(user_data);
+}
+
+struct stk_agent *stk_agent_new(const char *path, const char *sender,
+ ofono_bool_t is_default)
+{
+ struct stk_agent *agent = g_try_new0(struct stk_agent, 1);
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ if (!agent)
+ return NULL;
+
+ agent->path = g_strdup(path);
+ agent->bus = g_strdup(sender);
+ agent->is_default = is_default;
+
+ agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender,
+ stk_agent_disconnect_cb,
+ agent, NULL);
+
+ return agent;
+}
diff --git a/src/stkagent.h b/src/stkagent.h
new file mode 100644
index 0000000..bcb0f15
--- /dev/null
+++ b/src/stkagent.h
@@ -0,0 +1,47 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2010 Intel Corporation. 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
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ */
+
+enum stk_agent_result {
+ STK_AGENT_RESULT_OK,
+ STK_AGENT_RESULT_BACK,
+ STK_AGENT_RESULT_TERMINATE,
+ STK_AGENT_RESULT_HELP,
+ STK_AGENT_RESULT_TIMEOUT,
+ STK_AGENT_RESULT_CANCEL,
+};
+
+typedef void (*stk_agent_generic_cb)(enum stk_agent_result result,
+ void *user_data);
+
+struct stk_agent;
+
+struct stk_agent *stk_agent_new(const char *path, const char *sender,
+ ofono_bool_t is_default);
+
+void stk_agent_remove(struct stk_agent *agent);
+
+ofono_bool_t stk_agent_busy(struct stk_agent *agent);
+ofono_bool_t stk_agent_matches(struct stk_agent *agent,
+ const char *path, const char *sender);
+void stk_agent_set_destroy_watch(struct stk_agent *agent, GDestroyNotify notify,
+ void *user_data);
+
+void stk_agent_request_cancel(struct stk_agent *agent);
--
1.7.1.86.g0e460.dirty
10 years, 7 months