[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
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
8 years, 8 months
[PATCH 1/2 v2] netreg: Add CPHS CSP implementation
by Aki Niemi
---
src/network.c | 122 ++++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 96 insertions(+), 26 deletions(-)
diff --git a/src/network.c b/src/network.c
index bf61472..07f9cdf 100644
--- a/src/network.c
+++ b/src/network.c
@@ -42,7 +42,8 @@
enum network_registration_mode {
NETWORK_REGISTRATION_MODE_AUTO = 0,
- NETWORK_REGISTRATION_MODE_MANUAL = 1,
+ NETWORK_REGISTRATION_MODE_AUTO_ONLY = 1,
+ NETWORK_REGISTRATION_MODE_MANUAL = 2,
};
#define SETTINGS_STORE "netreg"
@@ -98,6 +99,8 @@ static const char *registration_mode_to_string(int mode)
switch (mode) {
case NETWORK_REGISTRATION_MODE_AUTO:
return "auto";
+ case NETWORK_REGISTRATION_MODE_AUTO_ONLY:
+ return "auto-only";
case NETWORK_REGISTRATION_MODE_MANUAL:
return "manual";
}
@@ -143,6 +146,42 @@ static char **network_operator_technologies(struct network_operator_data *opd)
return techs;
}
+static void registration_status_callback(const struct ofono_error *error,
+ int status, int lac, int ci, int tech,
+ void *data)
+{
+ struct ofono_netreg *netreg = data;
+
+ if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
+ DBG("Error during registration status query");
+ return;
+ }
+
+ ofono_netreg_status_notify(netreg, status, lac, ci, tech);
+}
+
+static void init_register(const struct ofono_error *error, void *data)
+{
+ struct ofono_netreg *netreg = data;
+
+ if (netreg->driver->registration_status == NULL)
+ return;
+
+ netreg->driver->registration_status(netreg,
+ registration_status_callback, netreg);
+}
+
+static void enforce_auto_only(struct ofono_netreg *netreg)
+{
+ if (netreg->mode != NETWORK_REGISTRATION_MODE_MANUAL)
+ return;
+
+ if (netreg->driver->register_auto == NULL)
+ return;
+
+ netreg->driver->register_auto(netreg, init_register, netreg);
+}
+
static void set_registration_mode(struct ofono_netreg *netreg, int mode)
{
DBusConnection *conn;
@@ -152,6 +191,9 @@ static void set_registration_mode(struct ofono_netreg *netreg, int mode)
if (netreg->mode == mode)
return;
+ if (mode == NETWORK_REGISTRATION_MODE_AUTO_ONLY)
+ enforce_auto_only(netreg);
+
netreg->mode = mode;
if (netreg->settings) {
@@ -170,20 +212,6 @@ static void set_registration_mode(struct ofono_netreg *netreg, int mode)
"Mode", DBUS_TYPE_STRING, &strmode);
}
-static void registration_status_callback(const struct ofono_error *error,
- int status, int lac, int ci, int tech,
- void *data)
-{
- struct ofono_netreg *netreg = data;
-
- if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
- DBG("Error during registration status query");
- return;
- }
-
- ofono_netreg_status_notify(netreg, status, lac, ci, tech);
-}
-
static void register_callback(const struct ofono_error *error, void *data)
{
struct ofono_netreg *netreg = data;
@@ -211,15 +239,6 @@ out:
registration_status_callback, netreg);
}
-static void init_register(const struct ofono_error *error, void *data)
-{
- struct ofono_netreg *netreg = data;
-
- if (netreg->driver->registration_status)
- netreg->driver->registration_status(netreg,
- registration_status_callback, netreg);
-}
-
static struct network_operator_data *
network_operator_create(const struct ofono_network_operator *op)
{
@@ -586,6 +605,9 @@ static DBusMessage *network_operator_register(DBusConnection *conn,
struct network_operator_data *opd = data;
struct ofono_netreg *netreg = opd->netreg;
+ if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO_ONLY)
+ return __ofono_error_access_denied(msg);
+
if (netreg->pending)
return __ofono_error_busy(msg);
@@ -828,6 +850,9 @@ static DBusMessage *network_register(DBusConnection *conn,
{
struct ofono_netreg *netreg = data;
+ if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO_ONLY)
+ return __ofono_error_access_denied(msg);
+
if (netreg->pending)
return __ofono_error_busy(msg);
@@ -947,6 +972,9 @@ static DBusMessage *network_scan(DBusConnection *conn,
{
struct ofono_netreg *netreg = data;
+ if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO_ONLY)
+ return __ofono_error_access_denied(msg);
+
if (netreg->pending)
return __ofono_error_busy(msg);
@@ -1364,7 +1392,7 @@ static void init_registration_status(const struct ofono_error *error,
signal_strength_callback, netreg);
}
- if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO &&
+ if (netreg->mode != NETWORK_REGISTRATION_MODE_MANUAL &&
(status == NETWORK_REGISTRATION_STATUS_NOT_REGISTERED ||
status == NETWORK_REGISTRATION_STATUS_DENIED ||
status == NETWORK_REGISTRATION_STATUS_UNKNOWN)) {
@@ -1574,6 +1602,44 @@ static void sim_spn_read_cb(int ok, int length, int record,
}
}
+static void sim_csp_read_cb(int ok, int length, int record,
+ const unsigned char *data,
+ int record_length, void *user_data)
+{
+ struct ofono_netreg *netreg = user_data;
+ int i;
+
+ if (!ok)
+ return;
+
+ if (length < 18 || record_length < 18 || length < record_length)
+ return;
+
+ /*
+ * According to CPHS 4.2, EFcsp is an array of two-byte service
+ * entries, each consisting of a one byte service group
+ * identifier followed by 8 bits; each bit is indicating
+ * availability of a specific service or feature.
+ *
+ * The PLMN mode bit, if present, indicates whether manual
+ * operator selection should be disabled or enabled. When
+ * unset, the device is forced to automatic mode; when set,
+ * manual selection is to be enabled. The latter is also the
+ * default.
+ */
+ for (i = 0; i < record_length / 2; i++) {
+
+ if (data[i * 2] != SIM_CSP_ENTRY_VALUE_ADDED_SERVICES)
+ continue;
+
+ if ((data[i * 2 + 1] & 0x80) != 0)
+ return;
+
+ set_registration_mode(netreg,
+ NETWORK_REGISTRATION_MODE_AUTO_ONLY);
+ }
+}
+
int ofono_netreg_get_location(struct ofono_netreg *netreg)
{
if (netreg == NULL)
@@ -1769,7 +1835,8 @@ static void netreg_load_settings(struct ofono_netreg *netreg)
mode = g_key_file_get_integer(netreg->settings, SETTINGS_GROUP,
"Mode", NULL);
- if (mode >= 0 && mode <= 1)
+ if (mode == NETWORK_REGISTRATION_MODE_AUTO ||
+ mode == NETWORK_REGISTRATION_MODE_MANUAL)
netreg->mode = mode;
g_key_file_set_integer(netreg->settings, SETTINGS_GROUP,
@@ -1816,6 +1883,9 @@ void ofono_netreg_register(struct ofono_netreg *netreg)
ofono_sim_read(netreg->sim, SIM_EFSPN_FILEID,
OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
sim_spn_read_cb, netreg);
+ ofono_sim_read(netreg->sim, SIM_EF_CPHS_CSP_FILEID,
+ OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
+ sim_csp_read_cb, netreg);
}
__ofono_atom_register(netreg->atom, netreg_unregister);
--
1.7.1
9 years, 10 months
Enabling/disabling the GPS part of a Huawei EM770W
by Florian Mayer (Mayer Electronics)
Hello folks,
is it possible to enable / disable the GPS part of a Huawei EM770W 3G
modem through a DBUS command? It is done with the command AT^WPDGP and
AT^WPEND on the modem (tested it on PCUI port). Or is it possible to
send generic AT commands through DBUS?
Regards
Florian Mayer
9 years, 10 months
Trouble using Huwei E160G
by Claudio Degioanni
Hi,
I want use 3G huawei key E160G for connect to internet using ofono,
I have some troubles activating the pdp context, I use the Active property
to activate the internet connection but return "GPRS is not attached"
Step to reprodure
1) Plug 3G key E160
2) Listing the modem attached
$ ./list-modems
[ /huawei0 ]
Lockdown = 0
Interfaces =
Powered = 0
Features =
Online = 0
3) Enable the modem
$ ./enable-modem
Connecting modem /huawei0...
4) Putting the modem online
$ ./online-modem
Setting modem /huawei0 online...
5) Enabling the gprs
$ ./enable-gprs
Connecting modem /huawei0.
5) Activate the connection context 1 (adding the apn), but ofono
respond with
"Active" "GPRS is not attached"
Some suggestions ?
I have attached the log of ofono launched with debug option.
regs,
Claudio
9 years, 11 months
Motorola Modem H24 gprs connection
by Ostermann, Christophe
Hi,
After having successfully enabled sms and voice call with modem h24 from
motorola. I am now trying to setup a gprs connection.
In fact Motorola has a specific set of AT command AT+MIPxxx to setup
gprs connection by using an internal TCP/UDP IP stack.
Can you confirm that the right approach is to write a new gprs-context.c
?
When a gprs cantext has properly established connection, does ofono
create a network interface?
BR
christophe
----------
Christophe Ostermann
Software Engineer
Devices Engineering
SICPA Security Solutions SA
Av. de Florissant 41, 1008 Prilly, Switzerland
Tel +41 21 627 59 70 Direct +41 21 627 63 68
Fax +41 21 620 06 22
christophe.ostermann(a)sicpa.com
<mailto:christophe.christophe.ostermann@sicpa.com> www.sicpa.com
<http://www.sicpa.com/>
This message was delivered through encrypted mechanism.
The information in this email and any attachments is confidential
and intended solely for the use of the individual(s) to whom it is
addressed or otherwise directed.
Please note that any views or opinions presented in this email are
solely those of the author and do not necessarily represent those
of the Company.
Finally, the recipient should check this email and any attachments
for the presence of viruses.
The Company accepts no liability for any damage caused by any virus
transmitted by this email.
9 years, 11 months
[PATCH 1/2] stk: Check if terminal is busy before SIM Refresh.
by Andrzej Zaborowski
---
src/stk.c | 94 ++++++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 71 insertions(+), 23 deletions(-)
diff --git a/src/stk.c b/src/stk.c
index 780e0c2..01e14db 100644
--- a/src/stk.c
+++ b/src/stk.c
@@ -1924,51 +1924,52 @@ static void send_ussd_callback(int error, int dcs, const unsigned char *msg,
}
}
-static gboolean handle_command_send_ussd(const struct stk_command *cmd,
- struct stk_response *rsp,
- struct ofono_stk *stk)
+static gboolean ss_is_busy(struct ofono_modem *modem)
{
- struct ofono_modem *modem = __ofono_atom_get_modem(stk->atom);
- static unsigned char busy_on_ss_result[] = { 0x03 };
- static unsigned char busy_on_ussd_result[] = { 0x08 };
struct ofono_atom *atom;
- struct ofono_ussd *ussd;
- int err;
atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_CALL_FORWARDING);
if (atom && __ofono_atom_get_registered(atom)) {
struct ofono_call_forwarding *cf = __ofono_atom_get_data(atom);
- if (__ofono_call_forwarding_is_busy(cf)) {
- ADD_ERROR_RESULT(rsp->result,
- STK_RESULT_TYPE_TERMINAL_BUSY,
- busy_on_ss_result);
+ if (__ofono_call_forwarding_is_busy(cf))
return TRUE;
- }
}
atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_CALL_BARRING);
if (atom && __ofono_atom_get_registered(atom)) {
struct ofono_call_barring *cb = __ofono_atom_get_data(atom);
- if (__ofono_call_barring_is_busy(cb)) {
- ADD_ERROR_RESULT(rsp->result,
- STK_RESULT_TYPE_TERMINAL_BUSY,
- busy_on_ss_result);
+ if (__ofono_call_barring_is_busy(cb))
return TRUE;
- }
}
atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_CALL_SETTINGS);
if (atom && __ofono_atom_get_registered(atom)) {
struct ofono_call_settings *cs = __ofono_atom_get_data(atom);
- if (__ofono_call_settings_is_busy(cs)) {
- ADD_ERROR_RESULT(rsp->result,
- STK_RESULT_TYPE_TERMINAL_BUSY,
- busy_on_ss_result);
+ if (__ofono_call_settings_is_busy(cs))
return TRUE;
- }
+ }
+
+ return FALSE;
+}
+
+static gboolean handle_command_send_ussd(const struct stk_command *cmd,
+ struct stk_response *rsp,
+ struct ofono_stk *stk)
+{
+ struct ofono_modem *modem = __ofono_atom_get_modem(stk->atom);
+ static unsigned char busy_on_ss_result[] = { 0x03 };
+ static unsigned char busy_on_ussd_result[] = { 0x08 };
+ struct ofono_atom *atom;
+ struct ofono_ussd *ussd;
+ int err;
+
+ if (ss_is_busy(modem)) {
+ ADD_ERROR_RESULT(rsp->result, STK_RESULT_TYPE_TERMINAL_BUSY,
+ busy_on_ss_result);
+ return TRUE;
}
atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_USSD);
@@ -2029,6 +2030,11 @@ static gboolean handle_command_refresh(const struct stk_command *cmd,
struct ofono_error failure = { .type = OFONO_ERROR_TYPE_FAILURE };
struct ofono_sim *sim = NULL;
struct ofono_atom *sim_atom;
+ struct ofono_ussd *ussd = NULL;
+ struct ofono_atom *ussd_atom;
+ struct ofono_voicecall *vc = NULL;
+ struct ofono_atom *vc_atom;
+ uint8_t addnl_info[1];
int err;
GSList *l;
@@ -2098,6 +2104,48 @@ static gboolean handle_command_refresh(const struct stk_command *cmd,
return TRUE;
}
+ if (rsp != NULL) {
+ ussd_atom = __ofono_modem_find_atom(
+ __ofono_atom_get_modem(stk->atom),
+ OFONO_ATOM_TYPE_USSD);
+ if (ussd_atom)
+ ussd = __ofono_atom_get_data(ussd_atom);
+
+ if (ussd && __ofono_ussd_is_busy(ussd)) {
+ addnl_info[0] = STK_RESULT_ADDNL_ME_PB_USSD_BUSY;
+
+ ADD_ERROR_RESULT(rsp->result,
+ STK_RESULT_TYPE_TERMINAL_BUSY,
+ addnl_info);
+ return TRUE;
+ }
+
+ vc_atom = __ofono_modem_find_atom(
+ __ofono_atom_get_modem(stk->atom),
+ OFONO_ATOM_TYPE_VOICECALL);
+ if (vc_atom)
+ vc = __ofono_atom_get_data(vc_atom);
+
+ if (vc && __ofono_voicecall_is_busy(vc,
+ OFONO_VOICECALL_INTERACTION_NONE)) {
+ addnl_info[0] = STK_RESULT_ADDNL_ME_PB_BUSY_ON_CALL;
+
+ ADD_ERROR_RESULT(rsp->result,
+ STK_RESULT_TYPE_TERMINAL_BUSY,
+ addnl_info);
+ return TRUE;
+ }
+
+ if (ss_is_busy(__ofono_atom_get_modem(stk->atom))) {
+ addnl_info[0] = STK_RESULT_ADDNL_ME_PB_SS_BUSY;
+
+ ADD_ERROR_RESULT(rsp->result,
+ STK_RESULT_TYPE_TERMINAL_BUSY,
+ addnl_info);
+ return TRUE;
+ }
+ }
+
/*
* For now we can handle the Refresh types that don't require
* a SIM reset except if that part of the task has been already
--
1.7.1.86.g0e460.dirty
9 years, 11 months
[PATCH] cf: Reregister CallForwarding atom on EF-CFIS refresh.
by Andrzej Zaborowski
---
src/call-forwarding.c | 47 +++++++++++++++--------------------------------
1 files changed, 15 insertions(+), 32 deletions(-)
diff --git a/src/call-forwarding.c b/src/call-forwarding.c
index 84d3067..7ce6dd4 100644
--- a/src/call-forwarding.c
+++ b/src/call-forwarding.c
@@ -74,6 +74,7 @@ static void get_query_next_cf_cond(struct ofono_call_forwarding *cf);
static void set_query_next_cf_cond(struct ofono_call_forwarding *cf);
static void ss_set_query_next_cf_cond(struct ofono_call_forwarding *cf);
static void cf_unregister_ss_controls(struct ofono_call_forwarding *cf);
+static void call_forwarding_unregister(struct ofono_atom *atom);
struct cf_ss_request {
int ss_type;
@@ -1368,41 +1369,21 @@ static void sim_cfis_changed(int id, void *userdata)
{
struct ofono_call_forwarding *cf = userdata;
- if (cf->flags & CALL_FORWARDING_FLAG_CACHED)
- goto done;
-
- if (((cf->flags & CALL_FORWARDING_FLAG_CPHS_CFF) ||
- cf->cfis_record_id > 0) && is_cfu_enabled(cf, NULL)) {
- DBusConnection *conn = ofono_dbus_get_connection();
- const char *path = __ofono_atom_get_path(cf->atom);
- ofono_bool_t status = FALSE;
-
- ofono_dbus_signal_property_changed(conn, path,
- OFONO_CALL_FORWARDING_INTERFACE,
- "ForwardingFlagOnSim",
- DBUS_TYPE_BOOLEAN, &status);
- }
-
-done:
- cf->cfis_record_id = 0;
- cf->flags &= ~CALL_FORWARDING_FLAG_CPHS_CFF;
+ if (!(cf->flags & CALL_FORWARDING_FLAG_CACHED))
+ return;
/*
- * TODO: remove forwarding rules in
- * cf->cf_conditions[CALL_FORWARDING_TYPE_UNCONDITIONAL] that
- * originate from EFcfis before adding the new rules?
+ * If the values are cached it's because at least one client
+ * requested them and we need to notify them about this
+ * change. However the authoritative source of current
+ * Call-Forwarding settings is the network operator and the
+ * query can take a noticeable amount of time. Instead of
+ * sedning PropertyChanged, we reregister the Call Forwarding
+ * atom. The client will invoke GetProperties only if it
+ * is still interested.
*/
-
- if (__ofono_sim_service_available(cf->sim,
- SIM_UST_SERVICE_CFIS,
- SIM_SST_SERVICE_CFIS) == TRUE)
- ofono_sim_read(cf->sim_context, SIM_EFCFIS_FILEID,
- OFONO_SIM_FILE_STRUCTURE_FIXED,
- sim_cfis_read_cb, cf);
- else
- ofono_sim_read(cf->sim_context, SIM_EF_CPHS_CFF_FILEID,
- OFONO_SIM_FILE_STRUCTURE_TRANSPARENT,
- sim_cphs_cff_read_cb, cf);
+ call_forwarding_unregister(cf->atom);
+ ofono_call_forwarding_register(cf);
}
static void sim_read_cf_indicator(struct ofono_call_forwarding *cf)
@@ -1465,6 +1446,8 @@ static void call_forwarding_unregister(struct ofono_atom *atom)
if (cf->ussd_watch)
__ofono_modem_remove_atom_watch(modem, cf->ussd_watch);
+
+ cf->flags = 0;
}
static void call_forwarding_remove(struct ofono_atom *atom)
--
1.7.1.86.g0e460.dirty
9 years, 11 months
[RFC PATCH 0/9] Emergency Mode
by Jeevaka Badrappan
Hi,
Following patch is a proposal for emergency mode. Test has been done
with the phonesim.
Listed down few important cases to give an overview of the state
changes that happen in each case.
Case 1: SIM Present, No PIN required, modem in offline state
- Modem set to online mode(UI triggered)
Post online atoms created
- Dial request received with emergency number
- Emergency mode activated
- Dial request sent to modem
- Emergency call is active
- Call ended
Emergency mode deactivated.
- Modem remains in online mode. Post online
atoms are present.
Case 2: SIM Present and PIN required
- Modem set to online mode(UI triggered)
Post SIM and Post online atoms not created
- Dial request received with emergency number
- Emergency mode activated
- Dial request sent to modem
- Emergency call is active
- Call ended
Emergency mode deactivated.
- Modem remains in online mode. Post sim
and post online atoms are not present/created.
Case 3: SIM Present and PIN required(Dial request cancelled by user)
- Modem set to online mode(UI triggered)
Post SIM and Post online atoms not created
- Dial request received with emergency number
- Emergency mode activated
- Dial request sent to modem
- Dial request cancelled by user
Emergency mode deactivated.
- Modem remains in online mode.
- User enters the right pin
- Modem remains in online mode. Post sim
and post online atoms are created.
Case 4: SIM Not Present(PIN disabled SIM inserted)
- Modem set to online mode(UI triggered)
Post SIM and Post online atoms not created
- Dial request received with emergency number
- Emergency mode activated
- Emergency call is active
- SIM inserted and SIM ready received(NO PIN required).
- Post sim and post online atoms are created.
- Call ended
Emergency mode deactivated.
- Modem remains in online mode. Post sim and post
online atoms are present.
Case 5: SIM Not Present(PIN enabled SIM inserted)
- Modem set to online mode(UI triggered)
Post SIM and Post online atoms not created
- Dial request received with emergency number
- Emergency mode activated
- Emergency call is active
- SIM Inserted(PIN required).
- Call ended
Emergency mode deactivated.
- Modem remains in online mode. Post sim
and post online atoms are not created.
Regards,
Jeevaka
Jeevaka Badrappan (9):
dbus: Add __ofono_error_emergency_active
include: add ofono_modem_get_emergency_mode api
modem: add ofono_modem_get_emergency_mode api
modem: add Emergency property
modem: add increment/decrement emergency mode api
modem: modem state decoupled from rf state
modem: restrict operations allowed in emergency
voicecall: generalise emergency call check
voicecall: add emergency mode handling
include/modem.h | 2 +
src/dbus.c | 7 +++
src/modem.c | 135 ++++++++++++++++++++++++++++++++++++++++++++----------
src/ofono.h | 4 ++
src/voicecall.c | 34 ++++++++++----
5 files changed, 147 insertions(+), 35 deletions(-)
9 years, 11 months
[PATCH 0/1] isimodem: fix network registration for older modems
by Mika Liljeberg
Hi,
Here's a patch to fix network registration with older ISI modems.
Verified with N95.
Claudio, could you give this a spin and let me know if this fixes
the problem for your 6760?
Br,
MikaL
[PATCH 1/1] isimodem: fix network registration for older modems
drivers/isimodem/network-registration.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
9 years, 11 months