[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, 5 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, 7 months
[PATCH v3 0/5] udev rules update
by Philippe Nunes
The modification I did in udevng.c to prevent overiding of the OFONO_LABEL based assignment, could break the default assignment.
I fixed this with this new patch.
Philippe Nunes (5):
udev: Add rules to support ZTE MF668 dongle
udev: Add rules to support ZTE MF190 dongle
udevng.c: tty assignment according OFONO_LABEL should take precedence
udev: Add rules to support Speedup 7300 dongle
udev: Add rules to support SpeedUp 9800 dongle
plugins/ofono.rules | 20 ++++++++++++++++
plugins/udevng.c | 61 +++++++++++++++++++++++++++++++-------------------
2 files changed, 58 insertions(+), 23 deletions(-)
9 years, 2 months
[PATCH 1/4] emulator: add AT+BIA support for HFP
by Frédéric Danis
---
src/emulator.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++-------
1 files changed, 73 insertions(+), 10 deletions(-)
diff --git a/src/emulator.c b/src/emulator.c
index 06ec06c..a907b12 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -60,6 +60,8 @@ struct indicator {
int min;
int max;
gboolean deferred;
+ gboolean active;
+ gboolean mandatory;
};
static void emulator_debug(const char *str, void *data)
@@ -360,7 +362,8 @@ static void notify_deferred_indicators(GAtServer *server, void *user_data)
if (!ind->deferred)
continue;
- if (em->events_mode == 3 && em->events_ind && em->slc) {
+ if (em->events_mode == 3 && em->events_ind && em->slc &&
+ ind->active) {
sprintf(buf, "+CIEV: %d,%d", i, ind->value);
g_at_server_send_unsolicited(em->server, buf);
}
@@ -783,8 +786,60 @@ fail:
}
}
+static void bia_cb(GAtServer *server, GAtServerRequestType type,
+ GAtResult *result, gpointer user_data)
+{
+ struct ofono_emulator *em = user_data;
+
+ switch (type) {
+ case G_AT_SERVER_REQUEST_TYPE_SET:
+ {
+ GAtResultIter iter;
+ GSList *l;
+ struct indicator *ind;
+ int val;
+
+ g_at_result_iter_init(&iter, result);
+ g_at_result_iter_next(&iter, "");
+
+ /* check validity of the request */
+ while (g_at_result_iter_next_number_default(&iter, 0, &val)) {
+ if (val != 0 && val != 1)
+ goto fail;
+ }
+
+ if (g_at_result_iter_skip_next(&iter))
+ goto fail;
+
+ /* request is valid, update the indicator activation status */
+ g_at_result_iter_init(&iter, result);
+ g_at_result_iter_next(&iter, "");
+
+ for (l = em->indicators; l; l = l->next) {
+ ind = l->data;
+
+ if (!g_at_result_iter_next_number_default(&iter,
+ ind->active, &val))
+ break;
+
+ if (!ind->mandatory)
+ ind->active = val;
+ }
+
+ g_at_server_send_final(server, G_AT_SERVER_RESULT_OK);
+ break;
+ }
+
+ default:
+fail:
+ g_at_server_send_final(server, G_AT_SERVER_RESULT_ERROR);
+ break;
+ }
+}
+
static void emulator_add_indicator(struct ofono_emulator *em, const char* name,
- int min, int max, int dflt)
+ int min, int max, int dflt,
+ gboolean mandatory)
{
struct indicator *ind;
@@ -798,6 +853,8 @@ static void emulator_add_indicator(struct ofono_emulator *em, const char* name,
ind->min = min;
ind->max = max;
ind->value = dflt;
+ ind->active = TRUE;
+ ind->mandatory = mandatory;
em->indicators = g_slist_append(em->indicators, ind);
}
@@ -860,15 +917,20 @@ void ofono_emulator_register(struct ofono_emulator *em, int fd)
em);
if (em->type == OFONO_EMULATOR_TYPE_HFP) {
- emulator_add_indicator(em, OFONO_EMULATOR_IND_SERVICE, 0, 1, 0);
- emulator_add_indicator(em, OFONO_EMULATOR_IND_CALL, 0, 1, 0);
+ emulator_add_indicator(em, OFONO_EMULATOR_IND_SERVICE, 0, 1, 0,
+ FALSE);
+ emulator_add_indicator(em, OFONO_EMULATOR_IND_CALL, 0, 1, 0,
+ TRUE);
emulator_add_indicator(em, OFONO_EMULATOR_IND_CALLSETUP, 0, 3,
- 0);
+ 0, TRUE);
emulator_add_indicator(em, OFONO_EMULATOR_IND_CALLHELD, 0, 2,
- 0);
- emulator_add_indicator(em, OFONO_EMULATOR_IND_SIGNAL, 0, 5, 0);
- emulator_add_indicator(em, OFONO_EMULATOR_IND_ROAMING, 0, 1, 0);
- emulator_add_indicator(em, OFONO_EMULATOR_IND_BATTERY, 0, 5, 5);
+ 0, TRUE);
+ emulator_add_indicator(em, OFONO_EMULATOR_IND_SIGNAL, 0, 5, 0,
+ FALSE);
+ emulator_add_indicator(em, OFONO_EMULATOR_IND_ROAMING, 0, 1, 0,
+ FALSE);
+ emulator_add_indicator(em, OFONO_EMULATOR_IND_BATTERY, 0, 5, 5,
+ FALSE);
g_at_server_register(em->server, "+BRSF", brsf_cb, em, NULL);
g_at_server_register(em->server, "+CIND", cind_cb, em, NULL);
@@ -876,6 +938,7 @@ void ofono_emulator_register(struct ofono_emulator *em, int fd)
g_at_server_register(em->server, "+CLIP", clip_cb, em, NULL);
g_at_server_register(em->server, "+CCWA", ccwa_cb, em, NULL);
g_at_server_register(em->server, "+CMEE", cmee_cb, em, NULL);
+ g_at_server_register(em->server, "+BIA", bia_cb, em, NULL);
}
__ofono_atom_register(em->atom, emulator_unregister);
@@ -1149,7 +1212,7 @@ void ofono_emulator_set_indicator(struct ofono_emulator *em,
if (waiting)
notify_ccwa(em);
- if (em->events_mode == 3 && em->events_ind && em->slc) {
+ if (em->events_mode == 3 && em->events_ind && em->slc && ind->active) {
if (!g_at_server_command_pending(em->server)) {
sprintf(buf, "+CIEV: %d,%d", i, ind->value);
g_at_server_send_unsolicited(em->server, buf);
--
1.7.1
9 years, 4 months
Bluetooth HF role
by Mikel Astiz
Hi all,
I'm trying to understand the features currently supported by oFono
regarding the handsfree role in Bluetooth/HFP. My first impression
looking at the source code is that some HFP functionality might be
missing, but I would rather have your confirmation.
Some examples I've found so far are the following:
1. Response and hold (AT+BTRH=0)
2. Redial last number (AT+BLDN)
3. Retrieval of supported Bluetooth features for a certain modem/device
(AT+BRSF)
Could you clarify which (if any) of these features are currently
supported by oFono?
In general, is there any documented list of unsupported features?
Regards,
Mikel
9 years, 4 months
[VPATH PATCH 0/2] Fix Makefile.am when using VPATH
by Pekka.Pessi@nokia.com
Hi,
I noticed there are some problems building with VPATH (if builddir and
srcdir are different from each other). E.g., make checkdist worked only
by accident. The following patches are supposed to fix the problems.
--Pekka
9 years, 4 months
[PATCHv5 0/3] Mobile broadband provider info plugin
by Oleg Zhurakivskyy
Hello,
Please find the mobile broadband provider info plugin ("Internet Access Provider database" TODO item).
If enabled, the plugin reads mobile-broadband-provider-info database entries (PROVIDER_DATABASE) and returns GRPS context settings to oFono provisioning module.
Regards,
Oleg
Oleg Zhurakivskyy (3):
Mobile broadband provider info plugin makefile changes
Mobile broadband provider info plugin autoconf support
Mobile broadband provider info plugin
Makefile.am | 7 +
configure.ac | 19 +-
plugins/mobile-broadband-provider-info.c | 695 ++++++++++++++++++++++++++++++
3 files changed, 715 insertions(+), 6 deletions(-)
create mode 100644 plugins/mobile-broadband-provider-info.c
--
1.7.4.1
9 years, 4 months
[PATCH] Add Direction property to voice call
by Antti Paila
---
doc/voicecall-api.txt | 6 ++++++
src/voicecall.c | 9 +++++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/doc/voicecall-api.txt b/doc/voicecall-api.txt
index 7eb41aa..6870905 100644
--- a/doc/voicecall-api.txt
+++ b/doc/voicecall-api.txt
@@ -110,6 +110,12 @@ Properties string LineIdentification [readonly]
service with their network provider and would like
to know what line the call is coming in on.
+ string Direction [readonly]
+ Indicates whether the call is mobile-originated or
+ mobile-terminated.
+
+ Possible values: "mo", "mt"
+
string Name [readonly]
Contains the Name Identification information returned
diff --git a/src/voicecall.c b/src/voicecall.c
index 2b4c209..833fe09 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -415,6 +415,7 @@ static void append_voicecall_properties(struct voicecall *v,
const char *callerid;
const char *timestr;
const char *name;
+ const char *direction;
ofono_bool_t mpty;
dbus_bool_t emergency_call;
@@ -444,6 +445,14 @@ static void append_voicecall_properties(struct voicecall *v,
ofono_dbus_dict_append(dict, "Name", DBUS_TYPE_STRING, &name);
+ if (call->direction == CALL_DIRECTION_MOBILE_ORIGINATED)
+ direction = "mo";
+ else
+ direction = "mt";
+
+ ofono_dbus_dict_append(dict, "Direction", DBUS_TYPE_STRING,
+ &direction);
+
if (call->status == CALL_STATUS_ACTIVE ||
call->status == CALL_STATUS_HELD ||
(call->status == CALL_STATUS_DISCONNECTED &&
--
1.7.4.1
9 years, 4 months
[PATCHv4 0/3] Mobile broadband provider info plugin
by Oleg Zhurakivskyy
Hello,
Please find the mobile broadband provider info plugin ("Internet Access Provider database" TODO item).
If enabled, the plugin reads mobile-broadband-provider-info database entries (PROVIDER_DATABASE) and returns GRPS context settings to oFono provisioning module.
Regards,
Oleg
Oleg Zhurakivskyy (3):
Mobile broadband provider info plugin makefile changes
Mobile broadband provider info plugin autoconf support
Mobile broadband provider info plugin
Makefile.am | 7 +
configure.ac | 19 +-
plugins/mobile-broadband-provider-info.c | 604 ++++++++++++++++++++++++++++++
3 files changed, 624 insertions(+), 6 deletions(-)
create mode 100644 plugins/mobile-broadband-provider-info.c
--
1.7.4.1
9 years, 4 months
[PATCH v2 0/5] udev rules update
by Philippe Nunes
For Speedup dongles, the aux channel is not necessarily on the last interface (as for Speedup 8000)
So, I kept the actual logic (modem is assigned on the last interface) and I added two rules for Speedup 7300 and Speedup 9800
I modified also udevng.c in order to avoid aux/modem channel assignment according OFONO_LABEL to be overridden by the default assignment.
Note that for ZTE dongles, this overriding can't occur.
Philippe Nunes (5):
udev: Add rules to support ZTE MF668 dongle
udev: Add rules to support ZTE MF190 dongle
udevng.c: tty assignment according OFONO_LABEL should take precedence
udev: Add rules to support Speedup 7300 dongle
udev: Add rules to support SpeedUp 9800 dongle
plugins/ofono.rules | 20 +++++++++++++++++++
plugins/udevng.c | 52 +++++++++++++++++++++++++++++---------------------
2 files changed, 50 insertions(+), 22 deletions(-)
9 years, 4 months