[-]
[+]
|
Changed |
_service:tar_git:ofono.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:ofono.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,6 +2,6 @@
<service name="tar_git">
<param name="url">https://git.merproject.org/mer-core/ofono.git</param>
<param name="branch">master</param>
- <param name="revision">ca1d06c</param>
+ <param name="revision">mer/1.19+git8</param>
</service>
</services>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/Makefile.am
^
|
@@ -575,6 +575,11 @@
builtin_modules += hfp_ag_bluez5
builtin_sources += plugins/hfp_ag_bluez5.c plugins/bluez5.h
+
+if SAILFISHFOS
+builtin_modules += sfos_bt
+builtin_sources += plugins/sfos_bt.c
+endif
endif
if UPOWER
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/configure.ac
^
|
@@ -213,6 +213,10 @@
AM_CONDITIONAL(BLUEZ4, test "${enable_bluetooth}" != "no" && test "${enable_bluez4}" = "yes")
AM_CONDITIONAL(BLUETOOTH, test "${enable_bluetooth}" != "no")
+AC_ARG_ENABLE(sailfishos, AC_HELP_STRING([--enable-sailfishos],
+ [enable sailfishos plugin]), [enable_sailfishos=${enableval}])
+AM_CONDITIONAL(SAILFISHFOS, test "${enable_sailfishos}" = "yes")
+
AC_ARG_ENABLE(nettime, AC_HELP_STRING([--disable-nettime],
[disable Nettime plugin]),
[enable_nettime=${enableval}])
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_config.c
^
|
@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony - RIL-based devices
*
- * Copyright (C) 2015-2016 Jolla Ltd.
+ * Copyright (C) 2015-2017 Jolla Ltd.
*
* 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
@@ -15,9 +15,12 @@
#include "ril_config.h"
+#include <gutil_intarray.h>
+#include <gutil_ints.h>
+
/* Utilities for parsing ril_subscription.conf */
-char* ril_config_get_string(GKeyFile *file, const char *group, const char *key)
+char *ril_config_get_string(GKeyFile *file, const char *group, const char *key)
{
char *val = g_key_file_get_string(file, group, key, NULL);
@@ -29,6 +32,31 @@
return val;
}
+char **ril_config_get_strings(GKeyFile *file, const char *group,
+ const char *key, char delimiter)
+{
+ char *str = ril_config_get_string(file, group, key);
+
+ if (str) {
+ char **strv, **p;
+ char delimiter_str[2];
+
+ delimiter_str[0] = delimiter;
+ delimiter_str[1] = 0;
+ strv = g_strsplit(str, delimiter_str, -1);
+
+ /* Strip whitespaces */
+ for (p = strv; *p; p++) {
+ *p = g_strstrip(*p);
+ }
+
+ g_free(str);
+ return strv;
+ }
+
+ return NULL;
+}
+
gboolean ril_config_get_integer(GKeyFile *file, const char *group,
const char *key, int *out_value)
{
@@ -106,6 +134,51 @@
}
}
+GUtilInts *ril_config_get_ints(GKeyFile *file, const char *group,
+ const char *key)
+{
+ char *value = ril_config_get_string(file, group, key);
+
+ if (value) {
+ char **values = g_strsplit(value, ",", -1);
+ char **ptr = values;
+ GUtilIntArray *array = gutil_int_array_new();
+
+ while (*ptr) {
+ const char *str = *ptr++;
+ char *end = NULL;
+ long ival = strtol(str, &end, 0);
+
+ if (str[0] && !end[0]) {
+ gutil_int_array_append(array, ival);
+ }
+ }
+
+ g_free(value);
+ g_strfreev(values);
+ return gutil_int_array_free_to_ints(array);
+ }
+ return NULL;
+}
+
+char *ril_config_ints_to_string(GUtilInts *ints, char separator)
+{
+ if (ints) {
+ guint i, n;
+ const int *data = gutil_ints_get_data(ints, &n);
+ GString *buf = g_string_new(NULL);
+
+ for (i=0; i<n; i++) {
+ if (buf->len > 0) {
+ g_string_append_c(buf, separator);
+ }
+ g_string_append_printf(buf, "%d", data[i]);
+ }
+ return g_string_free(buf, FALSE);
+ }
+ return NULL;
+}
+
/*
* Local Variables:
* mode: C
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_config.h
^
|
@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony - RIL-based devices
*
- * Copyright (C) 2015-2016 Jolla Ltd.
+ * Copyright (C) 2015-2017 Jolla Ltd.
*
* 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
@@ -22,13 +22,19 @@
#define RILCONF_SETTINGS_GROUP "Settings"
-char* ril_config_get_string(GKeyFile *file, const char *group, const char *key);
+char *ril_config_get_string(GKeyFile *file, const char *group,
+ const char *key);
+char **ril_config_get_strings(GKeyFile *file, const char *group,
+ const char *key, char delimiter);
gboolean ril_config_get_integer(GKeyFile *file, const char *group,
const char *key, int *value);
gboolean ril_config_get_boolean(GKeyFile *file, const char *group,
const char *key, gboolean *value);
gboolean ril_config_get_flag(GKeyFile *file, const char *group,
const char *key, int flag, int *flags);
+GUtilInts *ril_config_get_ints(GKeyFile *file, const char *group,
+ const char *key);
+char *ril_config_ints_to_string(GUtilInts *ints, char separator);
#endif /* RIL_CONFIG_H */
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_constants.h
^
|
@@ -1,11 +1,10 @@
/*
- *
* RIL constants adopted from AOSP's header:
*
* /hardware/ril/reference_ril/ril.h
*
* Copyright (C) 2013 Canonical Ltd.
- * Copyright (C) 2013-2016 Jolla Ltd.
+ * Copyright (C) 2013-2017 Jolla Ltd.
*
* 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
@@ -118,45 +117,68 @@
};
/* See RIL_REQUEST_LAST_CALL_FAIL_CAUSE */
-#define CALL_FAIL_UNOBTAINABLE_NUMBER 1
-#define CALL_FAIL_NORMAL 16
-#define CALL_FAIL_BUSY 17
-#define CALL_FAIL_CONGESTION 34
-#define CALL_FAIL_ACM_LIMIT_EXCEEDED 68
-#define CALL_FAIL_CALL_BARRED 240
-#define CALL_FAIL_FDN_BLOCKED 241
-#define CALL_FAIL_IMSI_UNKNOWN_IN_VLR 242
-#define CALL_FAIL_IMEI_NOT_ACCEPTED 243
-#define CALL_FAIL_DIAL_MODIFIED_TO_USSD 244
-#define CALL_FAIL_DIAL_MODIFIED_TO_SS 245
-#define CALL_FAIL_DIAL_MODIFIED_TO_DIAL 246
-#define CALL_FAIL_CDMA_LOCKED_UNTIL_POWER_CYCLE 1000
-#define CALL_FAIL_CDMA_DROP 1001
-#define CALL_FAIL_CDMA_INTERCEPT 1002
-#define CALL_FAIL_CDMA_REORDER 1003
-#define CALL_FAIL_CDMA_SO_REJECT 1004
-#define CALL_FAIL_CDMA_RETRY_ORDER 1005
-#define CALL_FAIL_CDMA_ACCESS_FAILURE 1006
-#define CALL_FAIL_CDMA_PREEMPTED 1007
-#define CALL_FAIL_CDMA_NOT_EMERGENCY 1008
-#define CALL_FAIL_CDMA_ACCESS_BLOCKED 1009
-#define CALL_FAIL_ERROR_UNSPECIFIED 0xffff
+enum ril_call_fail_cause {
+ CALL_FAIL_UNOBTAINABLE_NUMBER = 1,
+ CALL_FAIL_NO_ROUTE_TO_DESTINATION = 3,
+ CALL_FAIL_CHANNEL_UNACCEPTABLE = 6,
+ CALL_FAIL_OPERATOR_DETERMINED_BARRING = 8,
+ CALL_FAIL_NORMAL = 16,
+ CALL_FAIL_BUSY = 17,
+ CALL_FAIL_NO_USER_RESPONDING = 18,
+ CALL_FAIL_NO_ANSWER_FROM_USER = 19,
+ CALL_FAIL_CALL_REJECTED = 21,
+ CALL_FAIL_NUMBER_CHANGED = 22,
+ CALL_FAIL_DESTINATION_OUT_OF_ORDER = 27,
+ CALL_FAIL_INVALID_NUMBER_FORMAT = 28,
+ CALL_FAIL_FACILITY_REJECTED = 29,
+ CALL_FAIL_RESP_TO_STATUS_ENQUIRY = 30,
+ CALL_FAIL_NORMAL_UNSPECIFIED = 31,
+ CALL_FAIL_CONGESTION = 34,
+ CALL_FAIL_NETWORK_OUT_OF_ORDER = 38,
+ CALL_FAIL_TEMPORARY_FAILURE = 41,
+ CALL_FAIL_SWITCHING_EQUIPMENT_CONGESTION = 42,
+ CALL_FAIL_ACCESS_INFORMATION_DISCARDED = 43,
+ CALL_FAIL_REQUESTED_CIRCUIT_OR_CHANNEL_NOT_AVAILABLE = 44,
+ CALL_FAIL_RESOURCES_UNAVAILABLE_OR_UNSPECIFIED = 47,
+ CALL_FAIL_QOS_UNAVAILABLE = 49,
+ CALL_FAIL_REQUESTED_FACILITY_NOT_SUBSCRIBED = 50,
+ CALL_FAIL_INCOMING_CALLS_BARRED_WITHIN_CUG = 55,
+ CALL_FAIL_BEARER_CAPABILITY_NOT_AUTHORIZED = 57,
+ CALL_FAIL_BEARER_CAPABILITY_UNAVAILABLE = 58,
+ CALL_FAIL_SERVICE_OPTION_NOT_AVAILABLE = 63,
+ CALL_FAIL_BEARER_SERVICE_NOT_IMPLEMENTED = 65,
+ CALL_FAIL_ACM_LIMIT_EXCEEDED = 68,
+ CALL_FAIL_REQUESTED_FACILITY_NOT_IMPLEMENTED = 69,
+ CALL_FAIL_ONLY_DIGITAL_INFORMATION_BEARER_AVAILABLE = 70,
+ CALL_FAIL_SERVICE_OR_OPTION_NOT_IMPLEMENTED = 79,
+ CALL_FAIL_INVALID_TRANSACTION_IDENTIFIER = 81,
+ CALL_FAIL_USER_NOT_MEMBER_OF_CUG = 87,
+ CALL_FAIL_INCOMPATIBLE_DESTINATION = 88,
+ CALL_FAIL_INVALID_TRANSIT_NW_SELECTION = 91,
+ CALL_FAIL_SEMANTICALLY_INCORRECT_MESSAGE = 95,
+ CALL_FAIL_INVALID_MANDATORY_INFORMATION = 96,
+ CALL_FAIL_MESSAGE_TYPE_NON_IMPLEMENTED = 97,
+ CALL_FAIL_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 98,
+ CALL_FAIL_INFORMATION_ELEMENT_NON_EXISTENT = 99,
+ CALL_FAIL_CONDITIONAL_IE_ERROR = 100,
+ CALL_FAIL_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE = 101,
+ CALL_FAIL_RECOVERY_ON_TIMER_EXPIRED = 102,
+ CALL_FAIL_PROTOCOL_ERROR_UNSPECIFIED = 111,
+ CALL_FAIL_INTERWORKING_UNSPECIFIED = 127,
+ CALL_FAIL_CALL_BARRED = 240,
+ CALL_FAIL_FDN_BLOCKED = 241,
+ CALL_FAIL_IMSI_UNKNOWN_IN_VLR = 242,
+ CALL_FAIL_IMEI_NOT_ACCEPTED = 243,
+ CALL_FAIL_DIAL_MODIFIED_TO_USSD = 244,
+ CALL_FAIL_DIAL_MODIFIED_TO_SS = 245,
+ CALL_FAIL_DIAL_MODIFIED_TO_DIAL = 246,
+ CALL_FAIL_ERROR_UNSPECIFIED = 0xffff,
/* Not defined in ril.h but valid 3GPP specific cause values
* for call control. See 3GPP TS 24.008 Annex H. */
-#define CALL_FAIL_NO_ROUTE_TO_DESTINATION 3
-#define CALL_FAIL_CHANNEL_UNACCEPTABLE 6
-#define CALL_FAIL_OPERATOR_DETERMINED_BARRING 8
-#define CALL_FAIL_NO_USER_RESPONDING 18
-#define CALL_FAIL_USER_ALERTING_NO_ANSWER 19
-#define CALL_FAIL_CALL_REJECTED 21
-#define CALL_FAIL_NUMBER_CHANGED 22
-#define CALL_FAIL_ANONYMOUS_CALL_REJECTION 24
-#define CALL_FAIL_PRE_EMPTION 25
-#define CALL_FAIL_DESTINATION_OUT_OF_ORDER 27
-#define CALL_FAIL_INCOMPLETE_NUMBER 28
-#define CALL_FAIL_FACILITY_REJECTED 29
-#define CALL_FAIL_NORMAL_UNSPECIFIED 31
+ CALL_FAIL_ANONYMOUS_CALL_REJECTION = 24,
+ CALL_FAIL_PRE_EMPTION = 25
+};
enum ril_data_call_fail_cause {
PDP_FAIL_NONE = 0,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_network.c
^
|
@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony - RIL-based devices
*
- * Copyright (C) 2015-2016 Jolla Ltd.
+ * Copyright (C) 2015-2017 Jolla Ltd.
*
* 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
@@ -420,13 +420,16 @@
switch (mode) {
case OFONO_RADIO_ACCESS_MODE_ANY:
case OFONO_RADIO_ACCESS_MODE_LTE:
- if (self->settings->enable_4g) {
+ if (self->settings->techs & OFONO_RADIO_ACCESS_MODE_LTE) {
return PREF_NET_TYPE_LTE_GSM_WCDMA;
}
/* no break */
default:
case OFONO_RADIO_ACCESS_MODE_UMTS:
- return PREF_NET_TYPE_GSM_WCDMA_AUTO;
+ if (self->settings->techs & OFONO_RADIO_ACCESS_MODE_UMTS) {
+ return PREF_NET_TYPE_GSM_WCDMA_AUTO;
+ }
+ /* no break */
case OFONO_RADIO_ACCESS_MODE_GSM:
return PREF_NET_TYPE_GSM_ONLY;
}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_plugin.c
^
|
@@ -26,6 +26,7 @@
#include "ril_log.h"
#include <gdbus.h>
+#include <gutil_ints.h>
#include <gutil_strv.h>
#include <gutil_misc.h>
#include <mce_display.h>
@@ -40,6 +41,10 @@
#include "ofono.h"
#include "storage.h"
+#define OFONO_RADIO_ACCESS_MODE_ALL (OFONO_RADIO_ACCESS_MODE_GSM |\
+ OFONO_RADIO_ACCESS_MODE_UMTS |\
+ OFONO_RADIO_ACCESS_MODE_LTE)
+
#define RADIO_GID 1001
#define RADIO_UID 1001
#define RIL_SUB_SIZE 4
@@ -48,7 +53,7 @@
#define RILMODEM_DEFAULT_SOCK "/dev/socket/rild"
#define RILMODEM_DEFAULT_SOCK2 "/dev/socket/rild2"
#define RILMODEM_DEFAULT_SUB "SUB1"
-#define RILMODEM_DEFAULT_4G TRUE /* 4G is on by default */
+#define RILMODEM_DEFAULT_TECHS OFONO_RADIO_ACCESS_MODE_ALL
#define RILMODEM_DEFAULT_SLOT 0xffffffff
#define RILMODEM_DEFAULT_TIMEOUT 0 /* No timeout */
#define RILMODEM_DEFAULT_SIM_FLAGS RIL_SIM_CARD_V9_UICC_SUBSCRIPTION_WORKAROUND
@@ -69,7 +74,8 @@
#define RILCONF_SLOT "slot"
#define RILCONF_SUB "sub"
#define RILCONF_TIMEOUT "timeout"
-#define RILCONF_4G "enable4G"
+#define RILCONF_4G "enable4G" /* Deprecated */
+#define RILCONF_TECHS "technologies"
#define RILCONF_UICC_WORKAROUND "uiccWorkaround"
#define RILCONF_ECCLIST_FILE "ecclistFile"
#define RILCONF_ALLOW_DATA_REQ "allowDataReq"
@@ -77,6 +83,8 @@
#define RILCONF_DATA_CALL_FORMAT "dataCallFormat"
#define RILCONF_DATA_CALL_RETRY_LIMIT "dataCallRetryLimit"
#define RILCONF_DATA_CALL_RETRY_DELAY "dataCallRetryDelay"
+#define RILCONF_LOCAL_HANGUP_REASONS "localHangupReasons"
+#define RILCONF_REMOTE_HANGUP_REASONS "remoteHangupReasons"
#define RIL_STORE "ril"
#define RIL_STORE_GROUP "Settings"
@@ -1106,7 +1114,7 @@
slot->path = g_strdup(path);
slot->name = g_strdup(name);
slot->config.slot = slot_index;
- slot->config.enable_4g = RILMODEM_DEFAULT_4G;
+ slot->config.techs = RILMODEM_DEFAULT_TECHS;
slot->config.empty_pin_query = RILMODEM_DEFAULT_EMPTY_PIN_QUERY;
slot->timeout = RILMODEM_DEFAULT_TIMEOUT;
slot->sim_flags = RILMODEM_DEFAULT_SIM_FLAGS;
@@ -1156,7 +1164,8 @@
char *sock = g_key_file_get_string(file, group, RILCONF_SOCKET, NULL);
if (sock) {
int value;
- char* strval;
+ char *strval;
+ char **strv;
char *sub = ril_config_get_string(file, group, RILCONF_SUB);
slot = ril_plugin_slot_new(NULL, NULL, NULL,
@@ -1184,9 +1193,52 @@
DBG("%s: timeout %d", group, slot->timeout);
}
- ril_config_get_boolean(file, group, RILCONF_4G,
- &slot->config.enable_4g);
- DBG("%s: 4G %s", group, slot->config.enable_4g ? "on" : "off");
+ strv = ril_config_get_strings(file, group, RILCONF_TECHS, ',');
+ if (strv) {
+ char **p;
+
+ slot->config.techs = 0;
+ for (p = strv; *p; p++) {
+ const char *s = *p;
+ enum ofono_radio_access_mode m;
+
+ if (!s[0]) {
+ continue;
+ }
+
+ if (!strcmp(s, "all")) {
+ slot->config.techs =
+ OFONO_RADIO_ACCESS_MODE_ALL;
+ break;
+ }
+
+ if (!ofono_radio_access_mode_from_string(s,
+ &m)) {
+ ofono_warn("Unknown technology %s "
+ "in [%s] section of %s", s,
+ group, RILMODEM_CONF_FILE);
+ continue;
+ }
+
+ if (m == OFONO_RADIO_ACCESS_MODE_ANY) {
+ slot->config.techs =
+ OFONO_RADIO_ACCESS_MODE_ALL;
+ break;
+ }
+
+ slot->config.techs |= m;
+ }
+ g_strfreev(strv);
+ }
+
+ /* "enable4G" is deprecated */
+ value = slot->config.techs;
+ if (ril_config_get_flag(file, group, RILCONF_4G,
+ OFONO_RADIO_ACCESS_MODE_LTE, &value)) {
+ slot->config.techs = value;
+ }
+
+ DBG("%s: technologies 0x%02x", group, slot->config.techs);
if (ril_config_get_boolean(file, group, RILCONF_EMPTY_PIN_QUERY,
&slot->config.empty_pin_query)) {
@@ -1277,6 +1329,27 @@
g_free(slot->ecclist_file);
slot->ecclist_file = NULL;
}
+
+ slot->config.local_hangup_reasons = ril_config_get_ints(file,
+ group, RILCONF_LOCAL_HANGUP_REASONS);
+ strval = ril_config_ints_to_string(
+ slot->config.local_hangup_reasons, ',');
+ if (strval) {
+ DBG("%s: %s %s", group, RILCONF_LOCAL_HANGUP_REASONS,
+ strval);
+ g_free(strval);
+ }
+
+ slot->config.remote_hangup_reasons = ril_config_get_ints(file,
+ group, RILCONF_REMOTE_HANGUP_REASONS);
+ strval = ril_config_ints_to_string(
+ slot->config.remote_hangup_reasons, ',');
+ if (strval) {
+ DBG("%s: %s %s", group, RILCONF_REMOTE_HANGUP_REASONS,
+ strval);
+ g_free(strval);
+ }
+
} else {
DBG("no socket path in %s", group);
}
@@ -1289,6 +1362,8 @@
ril_plugin_shutdown_slot(slot, TRUE);
ril_sim_info_unref(slot->sim_info);
ril_sim_settings_unref(slot->sim_settings);
+ gutil_ints_unref(slot->config.local_hangup_reasons);
+ gutil_ints_unref(slot->config.remote_hangup_reasons);
g_hash_table_destroy(slot->pub.errors);
g_free(slot->path);
g_free(slot->imei);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_radio_settings.c
^
|
@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony - RIL-based devices
*
- * Copyright (C) 2015-2016 Jolla Ltd.
+ * Copyright (C) 2015-2017 Jolla Ltd.
*
* 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
@@ -113,15 +113,11 @@
struct ofono_error error;
struct ril_radio_settings_cbd *cbd = data;
struct ril_radio_settings *rsd = cbd->rsd;
- guint rats = OFONO_RADIO_ACCESS_MODE_GSM | OFONO_RADIO_ACCESS_MODE_UMTS;
- if (cbd->rsd->settings->enable_4g) {
- rats |= OFONO_RADIO_ACCESS_MODE_LTE;
- }
-
- GASSERT(cbd->rsd->source_id);
+ GASSERT(rsd->source_id);
rsd->source_id = 0;
- cbd->cb.available_rats(ril_error_ok(&error), rats, cbd->data);
+ cbd->cb.available_rats(ril_error_ok(&error), rsd->settings->techs,
+ cbd->data);
return G_SOURCE_REMOVE;
}
@@ -132,8 +128,8 @@
struct ril_radio_settings *rsd = ril_radio_settings_get_data(rs);
DBG_(rsd, "");
- ril_radio_settings_later(rsd, ril_radio_settings_query_available_rats_cb,
- cb, data);
+ ril_radio_settings_later(rsd,
+ ril_radio_settings_query_available_rats_cb, cb, data);
}
static gboolean ril_radio_settings_register(gpointer user_data)
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_sim_settings.c
^
|
@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony - RIL-based devices
*
- * Copyright (C) 2016 Jolla Ltd.
+ * Copyright (C) 2016-2017 Jolla Ltd.
*
* 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
@@ -26,8 +26,12 @@
#define RIL_SIM_STORE_GROUP "Settings"
#define RIL_SIM_STORE_PREF_MODE "TechnologyPreference"
-#define RIL_SIM_STORE_PREF_MODE_DEFAULT(self) ((self)->enable_4g ? \
- OFONO_RADIO_ACCESS_MODE_LTE : OFONO_RADIO_ACCESS_MODE_UMTS)
+#define RIL_SIM_STORE_PREF_MODE_DEFAULT(self) (\
+ ((self)->techs & OFONO_RADIO_ACCESS_MODE_LTE) ? \
+ OFONO_RADIO_ACCESS_MODE_LTE : \
+ ((self)->techs & OFONO_RADIO_ACCESS_MODE_UMTS) ? \
+ OFONO_RADIO_ACCESS_MODE_UMTS : \
+ OFONO_RADIO_ACCESS_MODE_GSM)
typedef GObjectClass RilSimSettingsClass;
typedef struct ril_sim_settings RilSimSettings;
@@ -84,8 +88,7 @@
mode_str = g_key_file_get_string(priv->storage,
RIL_SIM_STORE_GROUP, RIL_SIM_STORE_PREF_MODE, NULL);
if (ofono_radio_access_mode_from_string(mode_str, &mode)) {
- if (!self->enable_4g &&
- mode == OFONO_RADIO_ACCESS_MODE_LTE) {
+ if (!(self->techs & mode)) {
mode = OFONO_RADIO_ACCESS_MODE_ANY;
}
} else {
@@ -263,7 +266,7 @@
struct ril_sim_settings *ril_sim_settings_new(const struct ril_slot_config *sc)
{
struct ril_sim_settings *self = g_object_new(RIL_SIM_SETTINGS_TYPE, 0);
- self->enable_4g = sc->enable_4g;
+ self->techs = sc->techs;
self->slot = sc->slot;
self->pref_mode = RIL_SIM_STORE_PREF_MODE_DEFAULT(self);
return self;
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_sim_settings.h
^
|
@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony - RIL-based devices
*
- * Copyright (C) 2016 Jolla Ltd.
+ * Copyright (C) 2016-2017 Jolla Ltd.
*
* 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
@@ -18,16 +18,14 @@
#include "ril_types.h"
-#include <ofono/radio-settings.h>
-
struct ril_sim_settings_priv;
struct ril_sim_settings {
GObject object;
struct ril_sim_settings_priv *priv;
- gboolean enable_4g;
guint slot;
const char *imsi;
+ enum ofono_radio_access_mode techs;
enum ofono_radio_access_mode pref_mode;
};
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_subscription.conf
^
|
@@ -67,9 +67,15 @@
#
#timeout=0
-# Setting this one to false would disable 4G technology selection.
+# Comma-separated list of radio technologies supported by the modem.
+# Valid technologies are "gsm", "umts" and "lte". The special value
+# "all" means that all technologies are supported.
#
-# By default 4G is enabled
+# The default is all
+#
+#technologies=all
+
+# This one is deprecated, use the technologies entry instead (above).
#
#enable4G=true
@@ -142,3 +148,12 @@
# Default is 200 ms
#
#dataCallRetryDelay=200
+
+# Additional local and remote hangup reasons. Remote reasons are checked
+# first. Normally, RIL plugin figures it out automatically. You would only
+# need to define these if your RIL does something unusual.
+#
+# No default
+#
+#remoteHangupReasons=20
+#localHangupReasons=23
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_types.h
^
|
@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony - RIL-based devices
*
- * Copyright (C) 2015-2016 Jolla Ltd.
+ * Copyright (C) 2015-2017 Jolla Ltd.
*
* 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
@@ -23,11 +23,12 @@
#include <grilio_types.h>
#include <gutil_macros.h>
-#include <ofono/types.h>
-
struct ofono_modem;
struct ofono_sim;
+#include <ofono/types.h>
+#include <ofono/radio-settings.h>
+
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
@@ -51,8 +52,10 @@
struct ril_slot_config {
guint slot;
- gboolean enable_4g;
+ enum ofono_radio_access_mode techs;
gboolean empty_pin_query;
+ GUtilInts *local_hangup_reasons;
+ GUtilInts *remote_hangup_reasons;
};
#endif /* RIL_TYPES_H */
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/drivers/ril/ril_voicecall.c
^
|
@@ -1,7 +1,7 @@
/*
* oFono - Open Source Telephony - RIL-based devices
*
- * Copyright (C) 2015-2016 Jolla Ltd.
+ * Copyright (C) 2015-2017 Jolla Ltd.
*
* 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
@@ -21,6 +21,7 @@
#include "common.h"
+#include <gutil_ints.h>
#include <gutil_ring.h>
#define FLAG_NEED_CLIP 1
@@ -43,7 +44,9 @@
ofono_voicecall_cb_t cb;
void *data;
guint timer_id;
- GUtilRing* dtmf_queue;
+ GUtilRing *dtmf_queue;
+ GUtilInts *local_hangup_reasons;
+ GUtilInts *remote_hangup_reasons;
guint send_dtmf_id;
guint clcc_poll_id;
gulong event_id[VOICECALL_EVENT_COUNT];
@@ -60,28 +63,13 @@
};
struct lastcause_req {
- struct ofono_voicecall *vc;
+ struct ril_voicecall *vd;
int id;
};
static void ril_voicecall_send_one_dtmf(struct ril_voicecall *vd);
static void ril_voicecall_clear_dtmf_queue(struct ril_voicecall *vd);
-/*
- * structs ofono_voicecall and voicecall are fully defined
- * in src/voicecall.c; we need (read) access to the
- * call objects, so partially redefine them here.
- */
-struct ofono_voicecall {
- GSList *call_list;
- /* ... */
-};
-
-struct voicecall {
- struct ofono_call *call;
- /* ... */
-};
-
static inline struct ril_voicecall *ril_voicecall_get_data(
struct ofono_voicecall *vc)
{
@@ -166,38 +154,76 @@
}
/* Valid call statuses have value >= 0 */
-static int call_status_with_id(struct ofono_voicecall *vc, int id)
+static int ril_voicecall_status_with_id(struct ofono_voicecall *vc,
+ unsigned int id)
{
- GSList *l;
- struct voicecall *v;
+ struct ofono_call *call = ofono_voicecall_find_call(vc, id);
+
+ return call ? call->status : -1;
+}
+
+/* Tries to parse the payload as a uint followed by a string */
+static int ril_voicecall_parse_lastcause_1(const void *data, guint len)
+{
+ int result = -1;
- GASSERT(vc);
+ if (len > 8) {
+ int code;
+ char *msg = NULL;
+ GRilIoParser rilp;
- for (l = vc->call_list; l; l = l->next) {
- v = l->data;
- if (v->call->id == id) {
- return v->call->status;
+ grilio_parser_init(&rilp, data, len);
+ if (grilio_parser_get_int32(&rilp, &code) && code >= 0 &&
+ (msg = grilio_parser_get_utf8(&rilp)) &&
+ grilio_parser_at_end(&rilp)) {
+ DBG("%d \"%s\"", code, msg);
+ result = code;
}
+ g_free(msg);
}
- return -1;
+ return result;
}
static void ril_voicecall_lastcause_cb(GRilIoChannel *io, int status,
const void *data, guint len, void *user_data)
{
struct lastcause_req *reqdata = user_data;
- struct ofono_voicecall *vc = reqdata->vc;
- int tmp;
+ struct ril_voicecall *vd = reqdata->vd;
+ struct ofono_voicecall *vc = vd->vc;
int id = reqdata->id;
int call_status;
enum ofono_disconnect_reason reason = OFONO_DISCONNECT_REASON_ERROR;
- int last_cause = CALL_FAIL_ERROR_UNSPECIFIED;
- GRilIoParser rilp;
- grilio_parser_init(&rilp, data, len);
- if (grilio_parser_get_int32(&rilp, &tmp) && tmp > 0) {
- grilio_parser_get_int32(&rilp, &last_cause);
+ int last_cause;
+
+ /*
+ * According to ril.h:
+ *
+ * "response" is a "int *"
+ * ((int *)response)[0] is RIL_LastCallFailCause. GSM failure
+ * reasons are mapped to cause codes defined in TS 24.008 Annex H
+ * where possible.
+ *
+ * However some RILs feel free to invent their own formats,
+ * try those first.
+ */
+
+ last_cause = ril_voicecall_parse_lastcause_1(data, len);
+ if (last_cause < 0) {
+ GRilIoParser rilp;
+ int num, code;
+
+ /* Default format described in ril.h */
+ grilio_parser_init(&rilp, data, len);
+ if (grilio_parser_get_int32(&rilp, &num) && num == 1 &&
+ grilio_parser_get_int32(&rilp, &code) &&
+ grilio_parser_at_end(&rilp)) {
+ last_cause = code;
+ } else {
+ ofono_warn("Unable to parse last call fail cause");
+ last_cause = CALL_FAIL_ERROR_UNSPECIFIED;
+ }
}
/*
@@ -208,7 +234,14 @@
* CALL_FAIL_ERROR_UNSPECIFIED, and thus indistinguishable
* from a network failure.
*/
- switch (last_cause) {
+ if (gutil_ints_contains(vd->remote_hangup_reasons, last_cause)) {
+ DBG("hangup cause %d => remote hangup", last_cause);
+ reason = OFONO_DISCONNECT_REASON_REMOTE_HANGUP;
+ } else if (gutil_ints_contains(vd->local_hangup_reasons, last_cause)) {
+ DBG("hangup cause %d => local hangup", last_cause);
+ reason = OFONO_DISCONNECT_REASON_LOCAL_HANGUP;
+ } else {
+ switch (last_cause) {
case CALL_FAIL_UNOBTAINABLE_NUMBER:
case CALL_FAIL_NORMAL:
case CALL_FAIL_BUSY:
@@ -216,19 +249,19 @@
case CALL_FAIL_CHANNEL_UNACCEPTABLE:
case CALL_FAIL_OPERATOR_DETERMINED_BARRING:
case CALL_FAIL_NO_USER_RESPONDING:
- case CALL_FAIL_USER_ALERTING_NO_ANSWER:
+ case CALL_FAIL_NO_ANSWER_FROM_USER:
case CALL_FAIL_CALL_REJECTED:
case CALL_FAIL_NUMBER_CHANGED:
case CALL_FAIL_ANONYMOUS_CALL_REJECTION:
case CALL_FAIL_PRE_EMPTION:
case CALL_FAIL_DESTINATION_OUT_OF_ORDER:
- case CALL_FAIL_INCOMPLETE_NUMBER:
+ case CALL_FAIL_INVALID_NUMBER_FORMAT:
case CALL_FAIL_FACILITY_REJECTED:
reason = OFONO_DISCONNECT_REASON_REMOTE_HANGUP;
break;
case CALL_FAIL_NORMAL_UNSPECIFIED:
- call_status = call_status_with_id(vc, id);
+ call_status = ril_voicecall_status_with_id(vc, id);
if (call_status == CALL_STATUS_ACTIVE ||
call_status == CALL_STATUS_HELD ||
call_status == CALL_STATUS_DIALING ||
@@ -240,7 +273,7 @@
break;
case CALL_FAIL_ERROR_UNSPECIFIED:
- call_status = call_status_with_id(vc, id);
+ call_status = ril_voicecall_status_with_id(vc, id);
if (call_status == CALL_STATUS_DIALING ||
call_status == CALL_STATUS_ALERTING) {
reason = OFONO_DISCONNECT_REASON_REMOTE_HANGUP;
@@ -250,6 +283,7 @@
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/include/voicecall.h
^
|
@@ -172,6 +172,8 @@
int code, int index,
const struct ofono_phone_number *ph);
+struct ofono_call *ofono_voicecall_find_call(struct ofono_voicecall *vc,
+ unsigned int id);
void ofono_voicecall_ringback_tone_notify(struct ofono_voicecall *vc,
const ofono_bool_t playTone);
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/plugins/sfos_bt.c
^
|
@@ -0,0 +1,362 @@
+/*
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2017 Jolla Ltd. 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdint.h>
+#include <glib.h>
+#include <ofono.h>
+#include <gdbus.h>
+
+#define OFONO_API_SUBJECT_TO_CHANGE
+#include <ofono/plugin.h>
+#include <ofono/log.h>
+
+#define SFOS_BT_DBUS_CV_INTERFACE "org.nemomobile.ofono.bluetooth.CallVolume"
+#define HFP_CALL_VOLUME_MAX 15
+
+struct sfos_bt {
+ unsigned int emu_watch;
+ struct ofono_modem *modem;
+ struct ofono_emulator *em;
+ unsigned char speaker_volume;
+ unsigned char microphone_volume;
+};
+
+static GSList *modems;
+static guint modemwatch_id;
+
+static void set_hfp_microphone_volume(struct sfos_bt *sfos_bt,
+ unsigned char gain)
+{
+ char buf[64];
+
+ snprintf(buf, sizeof(buf), "+VGM:%d", (int) gain);
+ ofono_emulator_send_unsolicited(sfos_bt->em, buf);
+}
+
+static void set_hfp_speaker_volume(struct sfos_bt *sfos_bt,
+ unsigned char gain)
+{
+ char buf[64];
+
+ snprintf(buf, sizeof(buf), "+VGS:%d", (int) gain);
+ ofono_emulator_send_unsolicited(sfos_bt->em, buf);
+}
+
+static DBusMessage *cv_set_property(DBusConnection *conn, DBusMessage *msg,
+ void *data)
+{
+ struct sfos_bt *sfos_bt = data;
+ DBusMessageIter iter;
+ DBusMessageIter var;
+ const char *property;
+
+ if (!dbus_message_iter_init(msg, &iter))
+ return __ofono_error_invalid_args(msg);
+
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_STRING)
+ return __ofono_error_invalid_args(msg);
+
+ dbus_message_iter_get_basic(&iter, &property);
+ dbus_message_iter_next(&iter);
+
+ if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_VARIANT)
+ return __ofono_error_invalid_args(msg);
+
+ dbus_message_iter_recurse(&iter, &var);
+
+ if (g_str_equal(property, "SpeakerVolume") == TRUE) {
+ unsigned char gain;
+
+ if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BYTE)
+ return __ofono_error_invalid_args(msg);
+
+ dbus_message_iter_get_basic(&var, &gain);
+
+ if (gain > HFP_CALL_VOLUME_MAX)
+ return __ofono_error_invalid_format(msg);
+
+ if (gain == sfos_bt->speaker_volume)
+ return dbus_message_new_method_return(msg);
+
+ DBG("SpeakerVolume:%d", gain);
+ sfos_bt->speaker_volume = gain;
+ set_hfp_speaker_volume(sfos_bt, gain);
+
+ return dbus_message_new_method_return(msg);
+
+ } else if (g_str_equal(property, "MicrophoneVolume") == TRUE) {
+ unsigned char gain;
+
+ if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BYTE)
+ return __ofono_error_invalid_args(msg);
+
+ dbus_message_iter_get_basic(&var, &gain);
+
+ if (gain > HFP_CALL_VOLUME_MAX)
+ return __ofono_error_invalid_format(msg);
+
+ if (gain == sfos_bt->microphone_volume)
+ return dbus_message_new_method_return(msg);
+
+ DBG("MicrophoneVolume:%d", gain);
+ sfos_bt->microphone_volume = gain;
+ set_hfp_microphone_volume(sfos_bt, gain);
+
+ return dbus_message_new_method_return(msg);
+
+ } else if (g_str_equal(property, "Muted") == TRUE) {
+ unsigned char gain;
+ dbus_bool_t muted;
+
+ /*Remove when supported*/
+ return __ofono_error_not_implemented(msg);
+
+ if (dbus_message_iter_get_arg_type(&var) != DBUS_TYPE_BOOLEAN)
+ return __ofono_error_invalid_args(msg);
+
+ dbus_message_iter_get_basic(&var, &muted);
+
+ if (muted)
+ gain = 0;
+ else
+ gain = 7;/* rather gain = sfos->old_mic_vol */
+
+ if (gain == sfos_bt->microphone_volume)
+ return dbus_message_new_method_return(msg);
+
+ sfos_bt->microphone_volume = gain;
+ set_hfp_microphone_volume(sfos_bt, gain);
+
+ return dbus_message_new_method_return(msg);
+ }
+
+ return __ofono_error_invalid_args(msg);
+}
+
+static const GDBusMethodTable cv_methods[] = {
+ { GDBUS_METHOD("SetProperty",
+ GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
+ NULL, cv_set_property) },
+ { }
+};
+
+static const GDBusSignalTable cv_signals[] = {
+ { GDBUS_SIGNAL("PropertyChanged",
+ GDBUS_ARGS({ "property", "s" }, { "value", "v" })) },
+ { }
+};
+
+int sfos_bt_call_volume_set(struct ofono_modem *modem, unsigned char volume,
+ const char *gain)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ const char *path = ofono_modem_get_path(modem);
+
+ return ofono_dbus_signal_property_changed(conn, path,
+ SFOS_BT_DBUS_CV_INTERFACE,
+ gain,
+ DBUS_TYPE_BYTE, &volume);
+}
+
+static void set_gain(struct ofono_emulator *em,
+ struct ofono_emulator_request *req,
+ void *userdata, const char *gain)
+{
+ struct sfos_bt *sfos_bt = userdata;
+ struct ofono_modem *modem = sfos_bt->modem;
+ struct ofono_error result;
+ unsigned char volume;
+ int val;
+ result.error = 0;
+
+ switch (ofono_emulator_request_get_type(req)) {
+ case OFONO_EMULATOR_REQUEST_TYPE_SET:
+ if (ofono_emulator_request_next_number(req, &val) == FALSE)
+ goto fail;
+
+ if (val < 0 || val > 0xffff || val > HFP_CALL_VOLUME_MAX)
+ goto fail;
+
+ DBG("gain:%d", val);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.19+git8.tar.bz2/ofono/src/voicecall.c
^
|
@@ -3748,6 +3748,15 @@
return __ofono_modem_callid_next(modem);
}
+struct ofono_call *ofono_voicecall_find_call(struct ofono_voicecall *vc,
+ unsigned int id)
+{
+ GSList *l = g_slist_find_custom(vc->call_list, GUINT_TO_POINTER(id),
+ call_compare_by_id);
+
+ return l ? ((struct voicecall *)l->data)->call : NULL;
+}
+
ofono_bool_t __ofono_voicecall_is_busy(struct ofono_voicecall *vc,
enum ofono_voicecall_interaction type)
{
|