[PATCH_v4 0/5] Private network request to ConnMan
by Guillaume Zajac
Hi,
Changelog from v3 is:
- Add private-network source/include
- ConnMan plugin is independant from emulator
- Each application that need VPN will pass a callback as argument
when private network is requested. This callback will contain the
private network settings.
Guillaume Zajac (5):
gatppp: Add new contructor to use external fd
private-network: add callback typedef drivers and settings
private-network: add request/release functions and new feature to
Makefile.am
emulator: add request/release private network calls
connman: add plugin in oFono to request request/release private
network
Makefile.am | 10 +-
gatchat/gatppp.c | 33 +++++-
gatchat/gatppp.h | 1 +
gatchat/ppp.h | 2 +-
gatchat/ppp_net.c | 40 ++++---
include/private-network.h | 59 +++++++++
plugins/connman.c | 297 +++++++++++++++++++++++++++++++++++++++++++++
src/emulator.c | 49 ++++++--
src/ofono.h | 6 +
src/private-network.c | 89 ++++++++++++++
10 files changed, 556 insertions(+), 30 deletions(-)
create mode 100644 include/private-network.h
create mode 100644 plugins/connman.c
create mode 100644 src/private-network.c
5 days, 22 hours
Read/Write EFcfis/EFcphs-cff files
by Jeevaka Badrappan
Hi,
This patch reads and writes the call forwarding unconditional status
from and to the SIM depending on the SIM file availability.
New property needs to be added due to the fact that number won't be
available from the cphs-cff file.
Incase of SIM, EFcphs-cff file holds call forwarding status and it
is represented as a flag. In case of USIM(EFcfis), we have the status
flag and also number.So, adding new property for status and using the
existing VoiceUnconditional with number will work for both SIM and USIM cases.
Other option is to have 2 properties, "VoiceUnconditional" and "Number".
"VoiceUnconditional" will have the status of the call forwarding( "enabled",
"disabled") whereas the "Number" property will have the call forwared number.
offline-online state transitions results in caching the call forwaring status
every time. To avoid this, call forwarding atom is moved to the post sim and
its moved also due to the fact that call forwarding status doesn't change in
roaming.
Regards,
Jeevaka
Jeevaka Badrappan (7):
call-forwarding: Read/Write cfis/cphs-cff
ifx: Move call forwarding to post sim
isigen: Move call forwarding to post sim
plugins/n900: Move call forwarding to post sim
phonesim: Move call forwarding to post sim
doc: Add new property to call forwarding
TODO: Marking the Read/Write EFcfis task as done
TODO | 9 --
doc/call-forwarding-api.txt | 5 +
doc/features.txt | 5 +
plugins/ifx.c | 2 +-
plugins/isigen.c | 2 +-
plugins/n900.c | 2 +-
plugins/phonesim.c | 3 +-
src/call-forwarding.c | 242 ++++++++++++++++++++++++++++++++++++++++++-
8 files changed, 256 insertions(+), 14 deletions(-)
6 days, 2 hours
[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
9 years, 10 months
CDMA SMS Handling
by Rajesh.Nagaiah@elektrobit.com
Hi,
There was a discussion about the CDMA SMS handling and CDMA PDUs in the
IRC channel couple of days before. I would like to highlight the
differences between CDMA and GSM PDU and how we should proceed with this
from my understanding. Let me know your opinion.
Even though oFono supports +CMT and +CMTI, if we feed the incoming CDMA
PDUs to the SMS core it wont get decoded correctly, as there is
substantial differences between the GSM and CDMA SMS PDUs as described
in 3GPP2 specification C.S0015-B Short Message Service (SMS) for
Wideband Spread Spectrum Systems
For eg, the incoming PDU example that was mentioned in the IRC
discussion
+CMT: , 40,
00000210020207028CE95DCC65800601FC08150003168D30010610241830608003061010
04044847
40 - Length of the PDU in bytes
00 - Message Type ( 00 - SMS Point-to-Point)
00 - TeleService Identifier Tag (SMS Parameter Indentifier)
02 - TeleService Identifier Length (SMS Parameter Length)
10 - TeleService Identifier Value - First 8 bits
02 - TeleService Identifier Value - Second 8 bits
TeleService Identifier - 0x1002 - CDMA Messaging Teleservice
(CMT-95)
02 - Originating Address Tag
07 - Originating Address Length
02 - Originating Address 1st 8 Bits
8C - Originating Address 2nd 8 Bits
E9 - Originating Address 3rd 8 Bits
5D - Originating Address 4th 8 Bits
CC - Originating Address 5th 8 Bits
65 - Originating Address 6th 8 Bits
80 - Originating Address 7th 8 Bits
Digit Mode - 1 Bit
Number Mode - 1 Bit
Number Type - 0 or 3 bits
Number Plan - 0 or 4 bits
Number Fields - 8 Bits
Number Field occurrence of CHARi
CHARi - 4 or 8 bits ( 4 - in case of DTMF encoding, 8 - incase
of ASCII encoding)
Reserved - 0-7 bits
Lets take the 1st and 2nd 8 bits
02 - 0000 0010 ( Digit Mode bit - 0, Number Mode bit - 0)
8C - 1000 1100
As Digit mode bit is set to 0, Number Plan and Number Type is void
(0 bits) in this case.
So the remaining 6 bits of 1st 8bits and the first 2 bits of 2nd
8bit is Number fields
Number fields - 00 0010 10 - 0000 1010 - 0x0A (10 digits)
As Digit mode bit is set to 0, each address digit here is
represented as 4bit DTMF digit
0x8C 0xE9 0x5D 0xCC 0x65 0X80
1000 1100 1110 1001 0101 1101 1100 1100 0110 0101 1000 0000
10 0011 0011 1010 0101 0111 0111 0011 0001 1001 0110 0000 00
3 3 0 5 7 7 3 1 9 6 Last 6 bits
are reserved bits
Originating Address - 3305773196
06 - Bearer Reply Option Tag
01 - Bearer Reply Option Length
FC - First 6 bits Reply Sequence number and last 2 bits reserved set to
0
1111 1100 - 111111 REPLY_SEQ
00 Reserved
08 - Bearer Data Tag
15 - Bearer Data Length
00 - Message Indentifier Tag ( Bearer Data Sub parameter )
03 - Message Indentifier Length
16 - Message Type 4 bits Message Id 4 Bits
8D - Message Id 8 Bits
30 - Message Id 4 Bits, UDH Header indicator 1 Bit, Reserved 3 Bits
How Message Identifier value 16 8D 30 was formed ?
Message type ( 4 bits ) - 1( 0001 - Deliver)
Message Identifier ( 16 bits ) - 26835( 0x68D3)
Header Indicator (1 bit) - 0 (UDH not present in User Data
Subparameter)
Reserved ( 3bits) - 0 (000)
01 - User Data Tag ( Bearer Data Sub parameter )
06 - User Data Length
10 - Message Encoding 5 bits ( 0001 0000 ( 00010 = 2 -> 7-bit ASCII )) &
Number Fields 3 bits ( 000)
24 - Number Fields 5 Bits + User char field 1's 3 bits ( 0010 0100 )
18 - User char field 1's remaining 5 bits + User char field 2's 3 bits
(0001 1000)
30 - User char field 2's remaining 5 bits + User char field 3's 3 bits
(0011 0000)
60 - User char field 3's remaining 5 bits + User char field 4's 3 bits
(0110 0000)
80 - User char field 4's remaining 5 bits + Reserved 3 Bits (1000 0000)
Number Fields: 000 00100 - 04 (4 Character fields)
User Char [1] - 100 00011 - 0x83
User Char [2] - 000 00110 - 0x06
User Char [3] - 000 01100 - 0x0C
User Char [4] - 000 10000 - 0x10
Hex 0x83 0x06 0x0C 0x10
Octets 1000 0011 0000 0110 0000 1100 0001 0000
Septets 1000 001 10000 01 100000 1 1000001
Character A(0x41) A(0x41) A(0x41) A(0x41)
Message content: AAAA
Message Encoding - 2 (00010 - 5 bits)
Number Fields - 4 (0000 0100 - 8 bits)
User characters - 0x83 0x06 0x0C 0x10 ( 8 bits each)
00010 0000 0100 1000 0011 0000 0110 0000 1100 0001 0000
0001 0000 - 0x10
0010 0100 - 0x24
0001 1000 - 0x18
0011 0000 - 0x30
0110 0000 - 0x60
1000 0000 - 0x80 (Last 3 bits set to 0's(reserved bit) to complete
the octets)
03 - Message Center Time Stamp Tag ( Bearer Data Sub parameter )
06 - Message Center Time Stamp Length
all date and time fields contain two 4-bit BCD numbers giving the
decimal value of the field.
10 - Year (2010)
10 - Month (10 - October)
04 - Day
04 - Hour
48 - Minutes
47 - Seconds
Time Stamp 04:48:47 04/10/2010
Decoded Information:
Message Type: Deliver (Incoming Message)
Teleservice: CMT-95
Message Identifier: 26835
Originating Address: 3305773196
Message content: AAAA
Message Center Time Stamp: 04:48:47 04/10/2010
As from the above decoding example we can see there is substantial
differences between the GSM and CDMA SMS specifications and so the SMS
atom needs many additions and needs to be heavily modified to support
also CDMA SMS handling. Currently the oFono sms file unit handles the
common and the GSM technology aspects of the SMS stack along with the
smsutils. The SMS atom has the GSM specific members, segmentation and
queuing logic. The smsutils mainly takes care of encoding/decoding of
the PDUs, which is GSM specific. As the segmentation and queuing logic
and the interface is common for both GSM and CDMA, we could reuse this
common code and add the CDMA handling into it and create a new
cdmasmsutils unit to support the CDMA SMS specifics, much like the
smsutils does already for GSM.
BR,
Rajesh
10 years
[PATCH v3] Add basic Telit UC864-G support:
by Bernhard.Guillon@hale.at
From: Bernhard Guillon <Bernhard.Guillon(a)hale.at>
*add a basic plugin based on different ofono plugins
*use Telit specific QSS for SIM-state
*update Makefile
---
Makefile.am | 3 +
plugins/telit.c | 385 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 388 insertions(+), 0 deletions(-)
create mode 100644 plugins/telit.c
diff --git a/Makefile.am b/Makefile.am
index 0a7b6d5..dd4fb8f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -326,6 +326,9 @@ builtin_sources += plugins/nokiacdma.c
builtin_modules += linktop
builtin_sources += plugins/linktop.c
+builtin_modules += telit
+builtin_sources += plugins/telit.c
+
if BLUETOOTH
builtin_modules += bluetooth
builtin_sources += plugins/bluetooth.c plugins/bluetooth.h
diff --git a/plugins/telit.c b/plugins/telit.c
new file mode 100644
index 0000000..5dc3938
--- /dev/null
+++ b/plugins/telit.c
@@ -0,0 +1,385 @@
+/*
+ *
+ * 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
+
+#include <errno.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <unistd.h>
+
+#include <glib.h>
+#include <gatchat.h>
+#include <gattty.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/call-barring.h>
+#include <ofono/call-forwarding.h>
+#include <ofono/call-meter.h>
+#include <ofono/call-settings.h>
+#include <ofono/devinfo.h>
+#include <ofono/message-waiting.h>
+#include <ofono/netreg.h>
+#include <ofono/phonebook.h>
+#include <ofono/sim.h>
+#include <ofono/gprs.h>
+#include <ofono/gprs-context.h>
+#include <ofono/sms.h>
+#include <ofono/ussd.h>
+#include <ofono/voicecall.h>
+
+#include <drivers/atmodem/atutil.h>
+
+static const char *none_prefix[] = { NULL };
+static const char *qss_prefix[] = { "#QSS:", NULL };
+
+struct telit_data {
+ GAtChat *chat;
+ struct ofono_sim *sim;
+};
+
+static void telit_debug(const char *str, void *user_data)
+{
+ const char *prefix = user_data;
+
+ ofono_info("%s%s", prefix, str);
+}
+
+static int telit_probe(struct ofono_modem *modem)
+{
+ struct telit_data *data;
+
+ DBG("%p", modem);
+
+ data = g_try_new0(struct telit_data, 1);
+ if (data == NULL)
+ return -ENOMEM;
+
+ ofono_modem_set_data(modem, data);
+
+ return 0;
+}
+
+static void telit_remove(struct ofono_modem *modem)
+{
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ ofono_modem_set_data(modem, NULL);
+
+ g_free(data);
+}
+
+static gboolean sim_inserted_notify_with_timeout(gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ ofono_sim_inserted_notify(data->sim, TRUE);
+
+ return FALSE;
+}
+
+static void switch_sim_state_status(int status, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ switch (status) {
+ case 0:
+ DBG("SIM not inserted");
+ ofono_sim_inserted_notify(data->sim, FALSE);
+ break;
+ case 1:
+ DBG("SIM inserted");
+ /* We need to sleep a bit */
+ g_timeout_add_seconds(1, sim_inserted_notify_with_timeout,
+ modem);
+ break;
+ case 2:
+ DBG("SIM inserted and PIN unlocked");
+ break;
+ case 3:
+ DBG("SIM inserted and ready");
+ break;
+ default:
+ return;
+ }
+}
+
+static void telit_qss_notify(GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ int status;
+ GAtResultIter iter;
+
+ DBG("%p", modem);
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "#QSS:"))
+ return;
+
+ g_at_result_iter_next_number(&iter, &status);
+
+ switch_sim_state_status(status, modem);
+
+}
+
+static void telit_qss_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ int mode;
+ int status;
+ GAtResultIter iter;
+ g_at_result_iter_init(&iter, result);
+
+ DBG("%p", modem);
+
+ if (!g_at_result_iter_next(&iter, "#QSS:"))
+ return;
+
+ g_at_result_iter_next_number(&iter, &mode);
+ g_at_result_iter_next_number(&iter, &status);
+
+ switch_sim_state_status(status,modem);
+}
+
+static void cfun_enable_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ if (!ok) {
+ g_at_chat_unref(data->chat);
+ data->chat = NULL;
+ return;
+ }
+
+ ofono_modem_set_powered(modem, TRUE);
+
+ /* Enable sim state notification */
+ g_at_chat_send(data->chat, "AT#QSS=1", none_prefix, NULL, NULL, NULL);
+
+ /* Follow sim state */
+ g_at_chat_register(data->chat, "#QSS:", telit_qss_notify,
+ FALSE, modem, NULL);
+
+ /* Query current sim state */
+ g_at_chat_send(data->chat, "AT#QSS?", qss_prefix,
+ telit_qss_cb, modem, NULL);
+}
+
+static void cfun_disable_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ g_at_chat_unref(data->chat);
+ data->chat = NULL;
+
+ if (ok)
+ ofono_modem_set_powered(modem, FALSE);
+}
+
+static GAtChat *open_device(struct ofono_modem *modem,
+ const char *key, char *debug)
+{
+ const char *device;
+ GAtSyntax *syntax;
+ GIOChannel *channel;
+ GAtChat *chat;
+
+ device = ofono_modem_get_string(modem, key);
+ if (device == NULL)
+ return NULL;
+
+ DBG("%s %s", key, device);
+
+ channel = g_at_tty_open(device, NULL);
+ if (channel == NULL)
+ return NULL;
+
+ syntax = g_at_syntax_new_gsmv1();
+ chat = g_at_chat_new(channel, syntax);
+ g_at_syntax_unref(syntax);
+ g_io_channel_unref(channel);
+
+ if (chat == NULL)
+ return NULL;
+
+ if (getenv("OFONO_AT_DEBUG"))
+ g_at_chat_set_debug(chat, telit_debug, debug);
+
+ return chat;
+}
+
+static int telit_enable(struct ofono_modem *modem)
+{
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ data->chat = open_device(modem, "Modem", "Modem: ");
+ if (data->chat == NULL)
+ return -EINVAL;
+
+ /*
+ * Disable command echo and
+ * enable the Extended Error Result Codes
+ */
+ g_at_chat_send(data->chat, "ATE0 +CMEE=1", none_prefix,
+ NULL, NULL, NULL);
+
+ /* Set phone functionality */
+ g_at_chat_send(data->chat, "AT+CFUN=4", none_prefix,
+ cfun_enable_cb, modem, NULL);
+
+ return -EINPROGRESS;
+}
+
+static int telit_disable(struct ofono_modem *modem)
+{
+ struct telit_data *data = ofono_modem_get_data(modem);
+ DBG("%p", modem);
+
+ if (data->chat == NULL)
+ return 0;
+
+ g_at_chat_cancel_all(data->chat);
+ g_at_chat_unregister_all(data->chat);
+
+ /* Power down modem */
+ g_at_chat_send(data->chat, "AT+CFUN=0", none_prefix,
+ cfun_disable_cb, modem, NULL);
+
+ return -EINPROGRESS;
+}
+
+static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_modem_online_cb_t cb = cbd->cb;
+
+ if (ok)
+ CALLBACK_WITH_SUCCESS(cb, cbd->data);
+ else
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
+}
+
+static void telit_set_online(struct ofono_modem *modem, ofono_bool_t online,
+ ofono_modem_online_cb_t cb, void *user_data)
+{
+ struct telit_data *data = ofono_modem_get_data(modem);
+ struct cb_data *cbd = cb_data_new(cb, user_data);
+ char const *command = online ? "AT+CFUN=1" : "AT+CFUN=4";
+
+ DBG("modem %p %s", modem, online ? "online" : "offline");
+
+ g_at_chat_send(data->chat, command, none_prefix,set_online_cb,
+ cbd, g_free);
+}
+
+static void telit_pre_sim(struct ofono_modem *modem)
+{
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ ofono_devinfo_create(modem, 0, "atmodem", data->chat);
+ data->sim = ofono_sim_create(modem, 0, "atmodem", data->chat);
+ ofono_voicecall_create(modem, 0, "atmodem", data->chat);
+}
+
+static void telit_post_sim(struct ofono_modem *modem)
+{
+ struct telit_data *data = ofono_modem_get_data(modem);
+
+ DBG("%p", modem);
+
+ ofono_sms_create(modem, 0, "atmodem", data->chat);
+}
+
+static void telit_post_online(struct ofono_modem *modem)
+{
+ struct telit_data *data = ofono_modem_get_data(modem);
+ struct ofono_message_waiting *mw;
+ struct ofono_gprs *gprs;
+ struct ofono_gprs_context *gc;
+
+ DBG("%p", modem);
+
+ ofono_netreg_create(modem, 0, "atmodem", data->chat);
+ ofono_ussd_create(modem, 0, "atmodem", data->chat);
+ ofono_call_forwarding_create(modem, 0, "atmodem", data->chat);
+ ofono_call_settings_create(modem, 0, "atmodem", data->chat);
+ ofono_call_meter_create(modem, 0, "atmodem", data->chat);
+ ofono_call_barring_create(modem, 0, "atmodem", data->chat);
+
+ gprs = ofono_gprs_create(modem, 0, "atmodem", data->chat);
+ gc = ofono_gprs_context_create(modem, 0, "atmodem", data->chat);
+
+ if (gprs && gc)
+ ofono_gprs_add_context(gprs, gc);
+
+ mw = ofono_message_waiting_create(modem);
+ if (mw)
+ ofono_message_waiting_register(mw);
+}
+
+static struct ofono_modem_driver telit_driver = {
+ .name = "telit",
+ .probe = telit_probe,
+ .remove = telit_remove,
+ .enable = telit_enable,
+ .disable = telit_disable,
+ .set_online = telit_set_online,
+ .pre_sim = telit_pre_sim,
+ .post_sim = telit_post_sim,
+ .post_online = telit_post_online,
+};
+
+static int telit_init(void)
+{
+ return ofono_modem_driver_register(&telit_driver);
+}
+
+static void telit_exit(void)
+{
+ ofono_modem_driver_unregister(&telit_driver);
+}
+
+OFONO_PLUGIN_DEFINE(telit, "telit driver", VERSION,
+ OFONO_PLUGIN_PRIORITY_DEFAULT, telit_init, telit_exit)
--
1.7.0.4
--
Scanned by MailScanner.
10 years, 11 months
[PATCH] ifxmodem: emergency number list support
by Jeevaka Badrappan
---
drivers/ifxmodem/voicecall.c | 95 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 95 insertions(+), 0 deletions(-)
diff --git a/drivers/ifxmodem/voicecall.c b/drivers/ifxmodem/voicecall.c
index 87a48e6..0aa83e4 100644
--- a/drivers/ifxmodem/voicecall.c
+++ b/drivers/ifxmodem/voicecall.c
@@ -42,11 +42,13 @@
#include "ifxmodem.h"
static const char *none_prefix[] = { NULL };
+static const char *xlema_prefix[] = { "+XLEMA:", NULL };
struct voicecall_data {
GSList *calls;
unsigned int local_release;
GAtChat *chat;
+ char **en_list;
};
struct release_id_req {
@@ -786,6 +788,93 @@ static void xcolp_notify(GAtResult *result, gpointer user_data)
ofono_voicecall_notify(vc, call);
}
+static void xlema_notify(GAtResult *result, gpointer user_data)
+{
+ struct ofono_voicecall *vc = user_data;
+ struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+ GAtResultIter iter;
+ int index, total_cnt;
+ const char *number;
+ int count = (vd->en_list == NULL) ? 0 : g_strv_length(vd->en_list);
+
+ g_at_result_iter_init(&iter, result);
+
+ if (!g_at_result_iter_next(&iter, "+XLEMA:"))
+ return;
+
+ if (!g_at_result_iter_next_number(&iter, &index))
+ return;
+
+ if (!g_at_result_iter_next_number(&iter, &total_cnt))
+ return;
+
+ if (!g_at_result_iter_next_string(&iter, &number))
+ return;
+
+ /* Skip the category, valid in simpresent and mcc fields */
+
+ if (vd->en_list == NULL)
+ vd->en_list = g_new0(char *, total_cnt + 1);
+
+ vd->en_list[count] = g_strdup(number);
+
+ if (index != total_cnt)
+ return;
+
+ ofono_voicecall_en_list_notify(vc, vd->en_list);
+
+ g_strfreev(vd->en_list);
+ vd->en_list = NULL;
+}
+
+static void xlema_read(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_voicecall *vc = user_data;
+ struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+ GAtResultIter iter;
+ int num = 0;
+ int index, total_cnt;
+ const char *number;
+
+ if (!ok) {
+ DBG("Emergency number list read failed");
+ return;
+ }
+
+ g_at_result_iter_init(&iter, result);
+
+ while (g_at_result_iter_next(&iter, "+XLEMA:"))
+ num += 1;
+
+ vd->en_list = g_new0(char *, num + 1);
+
+ num = 0;
+ g_at_result_iter_init(&iter, result);
+
+ while (g_at_result_iter_next(&iter, "+XLEMA:")) {
+ if (!g_at_result_iter_next_number(&iter, &index))
+ continue;
+
+ if (!g_at_result_iter_next_number(&iter, &total_cnt))
+ continue;
+
+ if (!g_at_result_iter_next_string(&iter, &number))
+ continue;
+
+ /* Skip the category, valid in simpresent and mcc fields */
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+
+ vd->en_list[num++] = g_strdup(number);
+ }
+
+ ofono_voicecall_en_list_notify(vc, vd->en_list);
+
+ g_strfreev(vd->en_list);
+ vd->en_list = NULL;
+}
+
static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
gpointer user_data)
{
@@ -802,6 +891,10 @@ static void ifx_voicecall_initialized(gboolean ok, GAtResult *result,
g_at_chat_register(vd->chat, "+XCALLSTAT:", xcallstat_notify,
FALSE, vc, NULL);
g_at_chat_register(vd->chat, "+XCOLP:", xcolp_notify, FALSE, vc, NULL);
+ g_at_chat_register(vd->chat, "+XLEMA:", xlema_notify, FALSE, vc, NULL);
+ /* Enable emergency number list notification */
+ g_at_chat_send(vd->chat, "AT+XLEMA=1", xlema_prefix, xlema_read, vc,
+ NULL);
ofono_voicecall_register(vc);
}
@@ -840,6 +933,8 @@ static void ifx_voicecall_remove(struct ofono_voicecall *vc)
g_slist_foreach(vd->calls, (GFunc) g_free, NULL);
g_slist_free(vd->calls);
+ g_strfreev(vd->en_list);
+
ofono_voicecall_set_data(vc, NULL);
g_at_chat_unref(vd->chat);
--
1.7.4.1
10 years, 11 months
[PATCH] isimodem: Improper handling of missed call
by Arun Ravindran
---
drivers/isimodem/voicecall.c | 32 ++++++++++++++++++++++++++++----
1 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/drivers/isimodem/voicecall.c b/drivers/isimodem/voicecall.c
index 333f9b8..c599e39 100644
--- a/drivers/isimodem/voicecall.c
+++ b/drivers/isimodem/voicecall.c
@@ -50,6 +50,7 @@ struct isi_call {
uint8_t id;
uint8_t call_id;
uint8_t status;
+ uint8_t prev_status;
uint8_t mode;
uint8_t mode_info;
uint8_t cause_type;
@@ -314,7 +315,7 @@ static void isi_call_status_sb_proc(struct isi_voicecall *ivc,
if (!g_isi_sb_iter_get_byte(sb, &status, 2))
return;
-
+ call->prev_status = call->status;
call->status = status;
}
@@ -401,10 +402,16 @@ static int isi_call_status_to_clcc(const struct isi_call *call)
return 5;
case CALL_STATUS_MO_RELEASE:
- case CALL_STATUS_MT_RELEASE:
- case CALL_STATUS_TERMINATED:
return 6;
+ case CALL_STATUS_MT_RELEASE:
+ if ((call->prev_status == CALL_STATUS_MT_ALERTING) ||
+ (call->prev_status == CALL_STATUS_COMING) ||
+ (call->prev_status == CALL_STATUS_WAITING))
+ return 4;
+ else
+ return 6;
+
case CALL_STATUS_ACTIVE:
case CALL_STATUS_HOLD_INITIATED:
return 0;
@@ -548,9 +555,26 @@ static void isi_call_notify(struct ofono_voicecall *ovc, struct isi_call *call)
case CALL_STATUS_MO_RELEASE:
case CALL_STATUS_MT_RELEASE:
- case CALL_STATUS_TERMINATED:
+ /*
+ * Core requires the call status to be either incoming
+ * or waiting to identify the disconnected call as missed.
+ * The MT RELEASE is not mapped to any state in +CLCC, but
+ * we need the disconnect reason.
+ */
isi_call_set_disconnect_reason(call);
break;
+ case CALL_STATUS_TERMINATED:
+ DBG("State( CALL_STATUS_TERMINATED ) need not be reported to Core");
+ /*
+ * The call terminated is not reported to core as
+ * these intermediate states are not processed in
+ * the core. We report the call status when it becomes
+ * idle and TERMINATED is not mapped to +CLCC. The disconnect
+ * reason is set, so that the call termination cause
+ * in case of error is available to the core.
+ */
+ isi_call_set_disconnect_reason(call);
+ return;
case CALL_STATUS_ANSWERED:
DBG("State need not be reported to Core");
return;
--
1.7.1
10 years, 11 months
Problem detecting/using wwan0 modem
by ofonoconn@encambio.com
Hello list,
when using distros integrating network-manager, I can connect to the
Internet using my GSM/GPRS/UMTS WWAN modem and would like to be able
to do so with Linux distros (MeeGo) which integrate ofono and
connman. This is not very well documented, so please help.
GOAL
----
I want to be able to select from between eth0, wlan0, and wwan0
from the ofono/connman connection applet in MeeGo.
PROBLEM
-------
Ofono (or connman, not sure which) presents connection options after
detecting that wired and wireless ethernet interfaces exist. In my
netbook, no option to use the F3607gw (labeled Hewlett-Packard below)
WWAN modem device wwan0 is available.
ENVIRONMENT
-----------
$ lsusb
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
[...]
Bus 001 Device 006: ID 03f0:271d Hewlett-Packard
$ ifconfig -a
eth0 Link encap:Ethernet HWaddr 12:34:56:78:9A:BC
[...]
lo Link encap:Local Loopback
[...]
wlan0 Link encap:Ethernet HWaddr 12:34:56:78:9A:BC
[...]
wwan0 Link encap:Ethernet HWaddr 12:34:56:78:9A:BC
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
$ /usr/lib/ofono/test/list-modems
$
$ dmesg | grep wwan
[ 11.385780] cdc_ether 1-5:1.6: wwan0: register 'cdc_ether' at usb-0000:00:1d.7-5, Mobile Broadband Network Device, 02:80:37:ec:02:00
[ 2505.050955] cdc_ether 1-5:1.6: wwan0: unregister 'cdc_ether' usb-0000:00:1d.7-5, Mobile Broadband Network Device
[ 2505.609492] cdc_ether 1-5:1.6: wwan0: register 'cdc_ether' at usb-0000:00:1d.7-5, Mobile Broadband Network Device, 02:80:37:ec:02:00
$ lsmod
Module Size Used by
iptable_nat 3545 0
nf_nat 16042 1 iptable_nat
ath9k 65740 0
ideapad_laptop 3529 0
zaurus 3045 0
battery 8862 0
uvcvideo 50368 0
ath9k_common 1977 1 ath9k
cdc_ether 5744 1 zaurus
cdc_acm 15767 0
serio_raw 3821 0
joydev 8205 0
cdc_wdm 8885 0
ath9k_hw 243316 2 ath9k,ath9k_common
usbnet 19620 2 zaurus,cdc_ether
What could the problem be?
Regards,
Michael
10 years, 11 months
[PATCH v2] emulator: fix CCWA for PTS
by Frédéric Danis
During test TP/TCA/BV-05-I [Terminate Ongoing Call – While Call Waiting]
PTS fails if multiple +CCWA are sent (waiting for 1st phone number when
waiting one becomes incoming, intead of 2nd phone number).
So, send only 1 +CCWA.
Update RING timer management to be started as soon as an incoming call
exists, and retrieve +CLIP info for incoming or waiting call (in case
of waiting call becoming incoming call, call indicator changes before
internal call status is updated)
Force to send +CCWA (if needed) on reception of AT+CCWA=1
---
src/emulator.c | 95 ++++++++++++++++++++++++++++++++++---------------------
1 files changed, 59 insertions(+), 36 deletions(-)
diff --git a/src/emulator.c b/src/emulator.c
index 2e1300e..0826724 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -345,8 +345,9 @@ static struct ofono_call *find_call_with_status(struct ofono_emulator *em,
return __ofono_voicecall_find_call_with_status(vc, status);
}
-static void notify_ccwa(struct ofono_emulator *em)
+static gboolean notify_ccwa(void *user_data)
{
+ struct ofono_emulator *em = user_data;
struct ofono_call *c;
const char *phone;
/*
@@ -355,8 +356,9 @@ static void notify_ccwa(struct ofono_emulator *em)
*/
char str[OFONO_MAX_PHONE_NUMBER_LENGTH + 14 + 1];
- if (!em->ccwa)
- return;
+ if ((em->type == OFONO_EMULATOR_TYPE_HFP && em->slc == FALSE) ||
+ !em->ccwa)
+ goto end;
c = find_call_with_status(em, CALL_STATUS_WAITING);
@@ -367,10 +369,16 @@ static void notify_ccwa(struct ofono_emulator *em)
g_at_server_send_unsolicited(em->server, str);
} else
g_at_server_send_unsolicited(em->server, "+CCWA: \"\",128");
+
+end:
+ em->callsetup_source = 0;
+
+ return FALSE;
}
-static void notify_ring(struct ofono_emulator *em)
+static gboolean notify_ring(void *user_data)
{
+ struct ofono_emulator *em = user_data;
struct ofono_call *c;
const char *phone;
/*
@@ -379,15 +387,25 @@ static void notify_ring(struct ofono_emulator *em)
*/
char str[OFONO_MAX_PHONE_NUMBER_LENGTH + 14 + 1];
+ if (em->type == OFONO_EMULATOR_TYPE_HFP && em->slc == FALSE)
+ return TRUE;
+
g_at_server_send_unsolicited(em->server, "RING");
if (!em->clip)
- return;
+ return TRUE;
c = find_call_with_status(em, CALL_STATUS_INCOMING);
+ /*
+ * In case of waiting call becoming an incoming call, call status
+ * change may not have been done yet, so try to find waiting call too
+ */
if (c == NULL)
- return;
+ c = find_call_with_status(em, CALL_STATUS_WAITING);
+
+ if (c == NULL)
+ return TRUE;
switch (c->clip_validity) {
case CLIP_VALIDITY_VALID:
@@ -400,22 +418,6 @@ static void notify_ring(struct ofono_emulator *em)
g_at_server_send_unsolicited(em->server, "+CLIP: \"\",128");
break;
}
-}
-
-static gboolean send_callsetup_notification(gpointer user_data)
-{
- struct ofono_emulator *em = user_data;
- struct indicator *call_ind;
-
- if (em->type == OFONO_EMULATOR_TYPE_HFP && em->slc == FALSE)
- return TRUE;
-
- call_ind = find_indicator(em, OFONO_EMULATOR_IND_CALL, NULL);
-
- if (call_ind->value == OFONO_EMULATOR_CALL_INACTIVE)
- notify_ring(em);
- else
- notify_ccwa(em);
return TRUE;
}
@@ -672,6 +674,8 @@ static void ccwa_cb(GAtServer *server, GAtServerRequestType type,
struct ofono_emulator *em = user_data;
GAtResultIter iter;
int val;
+ struct indicator *call_ind;
+ struct indicator *cs_ind;
if (em->slc == FALSE)
goto fail;
@@ -691,6 +695,15 @@ static void ccwa_cb(GAtServer *server, GAtServerRequestType type,
if (g_at_result_iter_skip_next(&iter))
goto fail;
+ call_ind = find_indicator(em, OFONO_EMULATOR_IND_CALL, NULL);
+ cs_ind = find_indicator(em, OFONO_EMULATOR_IND_CALLSETUP, NULL);
+
+ if (cs_ind->value == OFONO_EMULATOR_CALLSETUP_INCOMING &&
+ call_ind->value == OFONO_EMULATOR_CALL_ACTIVE &&
+ em->ccwa == FALSE && val == 1)
+ em->callsetup_source = g_timeout_add_seconds(0,
+ notify_ccwa, em);
+
em->ccwa = val;
g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
@@ -1081,7 +1094,10 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
char buf[20];
struct indicator *ind;
struct indicator *call_ind;
+ struct indicator *cs_ind;
+ gboolean call;
gboolean callsetup;
+ gboolean waiting;
ind = find_indicator(em, name, &i);
@@ -1092,16 +1108,20 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
ind->value = value;
call_ind = find_indicator(em, OFONO_EMULATOR_IND_CALL, NULL);
+ cs_ind = find_indicator(em, OFONO_EMULATOR_IND_CALLSETUP, NULL);
- callsetup = g_str_equal(name, OFONO_EMULATOR_IND_CALLSETUP);
+ call = (ind == call_ind);
+ callsetup = (ind == cs_ind);
/*
* When callsetup indicator goes to Incoming and there is an active
* call a +CCWA should be sent before +CIEV
*/
- if (callsetup && value == OFONO_EMULATOR_CALLSETUP_INCOMING &&
- call_ind->value == OFONO_EMULATOR_CALL_ACTIVE)
- send_callsetup_notification(em);
+ waiting = (callsetup && value == OFONO_EMULATOR_CALLSETUP_INCOMING &&
+ call_ind->value == OFONO_EMULATOR_CALL_ACTIVE);
+
+ if (waiting)
+ notify_ccwa(em);
if (em->events_mode == 3 && em->events_ind && em->slc) {
sprintf(buf, "+CIEV: %d,%d", i, ind->value);
@@ -1109,21 +1129,24 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
}
/*
- * Ring timer should be started when callsetup indicator is set to
- * Incoming. If there is no active call, a first RING should be
- * sent just after the +CIEV and should be stopped for all other
- * values of callsetup
+ * Ring timer should be started when:
+ * - callsetup indicator is set to Incoming and there is no active call
+ * (not a waiting call)
+ * - or call indicator is set to inactive while callsetup is already
+ * set to Incoming.
+ * In those cases, a first RING should be sent just after the +CIEV
+ * Ring timer should be stopped for all other values of callsetup
*/
- if (!callsetup)
+ if (!((callsetup && !waiting) ||
+ (call && value == OFONO_EMULATOR_CALL_INACTIVE &&
+ cs_ind->value == OFONO_EMULATOR_CALLSETUP_INCOMING)))
return;
- switch (value) {
+ switch (cs_ind->value) {
case OFONO_EMULATOR_CALLSETUP_INCOMING:
- if (call_ind->value == OFONO_EMULATOR_CALL_INACTIVE)
- send_callsetup_notification(em);
-
+ notify_ring(em);
em->callsetup_source = g_timeout_add_seconds(RING_TIMEOUT,
- send_callsetup_notification, em);
+ notify_ring, em);
break;
default:
if (em->callsetup_source > 0) {
--
1.7.1
10 years, 11 months
Ofono and DUN Client
by Claudio Degioanni
Hi all,
What is the current state of work of bluetooth DUN client on ofono ?
regs
Claudio
10 years, 11 months