[-]
[+]
|
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.monich.net/git/ofono.git</param>
<param name="branch">master</param>
- <param name="revision">40ec15a3</param>
+ <param name="revision">25c11d66</param>
</service>
</services>
\ No newline at end of file
|
[-]
[+]
|
Deleted |
_service:tar_git:ofono-1.26+git1.tar.bz2/ofono/doc/sim900-modem.txt
^
|
@@ -1,12 +0,0 @@
-SIM900 modem usage
-===================
-
-To enable SIM900 module support you need to put the following
-udev rule into appropriate file in /{etc,lib}/udev/rules.d:
-
-KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900"
-
-On the i-Tetra tracking device, the SIM900 is accessed
-via N_GSM mux device. We use ofono as SMS message
-service and incoming voice calls service, so we
-use /dev/gsmtty1 provided by N_GSM mux.
|
[-]
[+]
|
Deleted |
_service:tar_git:ofono-1.26+git1.tar.bz2/upstream/doc/sim900-modem.txt
^
|
@@ -1,12 +0,0 @@
-SIM900 modem usage
-===================
-
-To enable SIM900 module support you need to put the following
-udev rule into appropriate file in /{etc,lib}/udev/rules.d:
-
-KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900"
-
-On the i-Tetra tracking device, the SIM900 is accessed
-via N_GSM mux device. We use ofono as SMS message
-service and incoming voice calls service, so we
-use /dev/gsmtty1 provided by N_GSM mux.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/ChangeLog
^
|
@@ -1,3 +1,8 @@
+ver 1.27:
+ Add support for handling SIMCom based SIM800 modems.
+ Add support for SIM lock state with xmm7xxx modems.
+ Add support for coexistence feature with xmm7xxx modems.
+
ver 1.26:
Fix issue with AT callback handler and GPRS.
Fix issue with handling EUTRAN SMS only states.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/configure.ac
^
|
@@ -1,5 +1,5 @@
AC_PREREQ(2.60)
-AC_INIT(ofono, 1.26)
+AC_INIT(ofono, 1.27)
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
AC_CONFIG_HEADERS(config.h)
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/doc/intel-lte-coex-api.txt
^
|
@@ -0,0 +1,137 @@
+LTE Coexistence hierarchy
+=========================
+
+Service org.ofono
+Interface org.ofono.intel.LteCoexistence
+Object path [variable prefix]/{modem0,modem1,...}
+
+Methods dict GetProperties()
+
+ Returns all coexistence configuration properties.
+
+ void SetProperty(string property, variant value)
+
+ Changes the value of the specified property. Only
+ properties that are listed as Read-write are changeable.
+ On success a PropertyChanged signal will be emitted.
+
+ Possible Errors: [service].Error.InProgress
+ [service].Error.InvalidArguments
+ [service].Error.Failed
+
+ void RegisterAgent(object path)
+
+ Registers an agent which will be called whenever the
+ modem initiates LTE Coexistence information.
+
+ Possible Errors: [service].Error.InProgress
+ [service].Error.InvalidArguments
+ [service].Error.InvalidFormat
+ [service].Error.Failed
+
+ void UnregisterAgent(object path)
+
+ Unregisters an agent.
+
+ Possible Errors: [service].Error.InvalidArguments
+ [service].Error.Failed
+
+ a(a{sv}) GetPlmnHistory()
+ Requests for LTE Plmn history list stored in NVM to
+ retrieve geo location history like MobileNetworkCode,
+ MobileCountryCode, LteBandsFDD, LteBandsTDD,
+ ChannelBandwidth.
+
+ Refer to the sections below for which property types
+ are available, their valid value ranges and
+ applicability to different cell types.
+
+Signals PropertyChanged(string property, variant value)
+
+ This signal indicates a changed value of the given
+ property.
+
+Properties string Band [readwrite]
+
+ Frequency band in which the modem is operating when
+ using "lte" mode.
+
+ boolean BTActive [readwrite]
+
+ Contains whether BT Coex is activated or not.
+
+ boolean WLANActive [readwrite]
+
+ Contains whether WLAN Coex is activated or not.
+
+ string WLANBandwidth [readwrite]
+
+ Contains the frequency WLAN Coex is activated on, when
+ "CoexWLANActive" is active.
+
+ The possible values are:
+ - "20MHz"
+ - "40MHz"
+ - "80MHz"
+
+LTECoexistenceAgent Hierarchy [experimental]
+=============================
+
+Service unique name
+Interface org.ofono.intel.LteCoexistenceAgent
+Object path freely definable
+
+Methods void ReceiveBluetoothNotification(array{byte} notification,
+ dict info) [noreply]
+
+ Requests the agent to process Bluetooth related LTE
+ Coexistence information. The dictionary info contains
+ vector table with modem recommended Safe Tx/Rx band and
+ range information.The properties involved are
+ 'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and
+ 'SafeVector'.
+
+ Possible Errors: None
+
+ void ReceiveWiFiNotification(array{byte} notification,
+ dict info) [noreply]
+
+ Requests the agent to process WiFi related LTE
+ Coexistence information. The dictionary info contains
+ vector table with modem recommended SafeTx/Rx band and
+ range information. The properties involved are
+ 'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and
+ 'SafeVector'.
+
+ Possible Errors: None
+
+ void Release() [noreply]
+
+ Agent is being released, possibly because of oFono
+ terminating, Coex interface is being torn down or modem
+ off. No UnregisterAgent call is needed.
+
+LTE Plmn history params
+=======================
+uint16 MobileNetworkCode [readonly, optional]
+
+ Contains the MNC of the cell.
+
+uint16 MobileCountryCode [readonly, optional]
+
+ Contains the MCC of the cell.
+
+uint32 LteBandsFDD [readonly, optional]
+
+ Contains the Lte FDD band. Valid range of values is 1 to 32 as per
+ 3GPP 36.101 Section 5.5.
+
+uint32 LteBandsTDD [readonly, optional]
+
+ Contains the Lte TDD band. Valid range of values is 33 to 64 as per
+ 3GPP 36.101 Section 5.5.
+
+byte ChannelBandwidth [readonly, optional]
+
+ Contains the Channel bandwidth. Valid range of values is 0 to 6 as per
+ 3GPP 36.101 Section 5.6.
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/doc/simcom-modem.txt
^
|
@@ -0,0 +1,22 @@
+SIM900 modem usage
+===================
+
+To enable SIM900 module support you need to put the following
+udev rule into appropriate file in /{etc,lib}/udev/rules.d:
+
+KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900"
+
+On the i-Tetra tracking device, the SIM900 is accessed
+via N_GSM mux device. We use ofono as SMS message
+service and incoming voice calls service, so we
+use /dev/gsmtty1 provided by N_GSM mux.
+
+SIM800 modem usage
+==================
+
+When using sim800 modem, the udev rule is the same as the
+sim900 rule :
+
+KERNEL=="ttyS3", ENV{OFONO_DRIVER}="sim900"
+
+Because the SIM800 and SIM900 code are the merged into one driver.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/drivers/qmimodem/gprs-context.c
^
|
@@ -88,6 +88,7 @@
char* straddr;
char* apn;
const char *dns[3] = { NULL, NULL, NULL };
+ char dns_buf[2][INET_ADDRSTRLEN];
DBG("");
@@ -131,14 +132,14 @@
if (qmi_result_get_uint32(result,
QMI_WDS_RESULT_PRIMARY_DNS, &ip_addr)) {
addr.s_addr = htonl(ip_addr);
- dns[0] = inet_ntoa(addr);
+ dns[0] = inet_ntop(AF_INET, &addr, dns_buf[0], sizeof(dns_buf[0]));
DBG("Primary DNS: %s", dns[0]);
}
if (qmi_result_get_uint32(result,
QMI_WDS_RESULT_SECONDARY_DNS, &ip_addr)) {
addr.s_addr = htonl(ip_addr);
- dns[1] = inet_ntoa(addr);
+ dns[1] = inet_ntop(AF_INET, &addr, dns_buf[1], sizeof(dns_buf[1]));
DBG("Secondary DNS: %s", dns[1]);
}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/include/netreg.h
^
|
@@ -3,7 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
- * Copyright (C) 2015-2021 Jolla Ltd.
+ * Copyright (C) 2015-2022 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
@@ -32,7 +32,7 @@
struct ofono_modem;
struct ofono_netreg;
-enum ofono_netreg_status {
+enum ofono_netreg_status { /* Since mer/1.24+git2 */
OFONO_NETREG_STATUS_NONE = -1,
/* 27.007 Section 7.2 <stat> */
OFONO_NETREG_STATUS_NOT_REGISTERED = 0,
@@ -41,9 +41,10 @@
OFONO_NETREG_STATUS_DENIED = 3,
OFONO_NETREG_STATUS_UNKNOWN = 4,
OFONO_NETREG_STATUS_ROAMING = 5,
- OFONO_NETREG_STATUS_REGISTERED_SMS_EUTRAN = 6,
- OFONO_NETREG_STATUS_ROAMING_SMS_EUTRAN = 7,
-}; /* Since mer/1.24+git2 */
+ /* Since mer/1.26+git1 */
+ OFONO_NETREG_STATUS_REGISTERED_SMS_EUTRAN = 6,
+ OFONO_NETREG_STATUS_ROAMING_SMS_EUTRAN = 7
+};
/* 27.007 Section 7.3 <stat> */
enum ofono_operator_status {
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/plugins/sim900.c
^
|
@@ -24,6 +24,7 @@
#endif
#include <errno.h>
+#include <string.h>
#include <stdlib.h>
#include <glib.h>
#include <gatchat.h>
@@ -60,13 +61,66 @@
static const char *none_prefix[] = { NULL };
+enum type {
+ SIMCOM_UNKNOWN,
+ SIM800,
+ SIM900,
+};
+
struct sim900_data {
GIOChannel *device;
GAtMux *mux;
GAtChat * dlcs[NUM_DLC];
guint frame_size;
+ enum type modem_type;
};
+static void mux_ready_notify(GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct sim900_data *data = ofono_modem_get_data(modem);
+ struct ofono_gprs *gprs = NULL;
+ struct ofono_gprs_context *gc;
+
+ ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
+ data->dlcs[SMS_DLC]);
+
+ gprs = ofono_gprs_create(modem, 0, "atmodem", data->dlcs[GPRS_DLC]);
+ if (gprs == NULL)
+ return;
+
+ gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM,
+ "atmodem", data->dlcs[GPRS_DLC]);
+ if (gc)
+ ofono_gprs_add_context(gprs, gc);
+}
+
+static void check_model(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ GAtResultIter iter;
+ char const *model;
+ struct sim900_data *data = ofono_modem_get_data(modem);
+
+ DBG("");
+
+ g_at_result_iter_init(&iter, result);
+
+ while (g_at_result_iter_next(&iter, NULL)) {
+ if (!g_at_result_iter_next_unquoted_string(&iter, &model))
+ continue;
+
+ DBG("setting type %s", model);
+
+ if (strstr(model, "SIM800"))
+ data->modem_type = SIM800;
+ else if (strstr(model, "SIM900"))
+ data->modem_type = SIM800;
+ else
+ data->modem_type = SIMCOM_UNKNOWN;
+ }
+}
+
static int sim900_probe(struct ofono_modem *modem)
{
struct sim900_data *data;
@@ -233,6 +287,14 @@
}
}
+ if (data->modem_type == SIM800) {
+ for (i = 0; i<NUM_DLC; i++) {
+ g_at_chat_register(data->dlcs[i], "SMS Ready",
+ mux_ready_notify, FALSE,
+ modem, NULL);
+ }
+ }
+
ofono_modem_set_powered(modem, TRUE);
return;
@@ -294,6 +356,8 @@
return -EINVAL;
g_at_chat_send(data->dlcs[SETUP_DLC], "ATE0", NULL, NULL, NULL, NULL);
+ g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CGMM", NULL,
+ check_model, modem, NULL);
/* For obtain correct sms service number */
g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CSCS=\"GSM\"", NULL,
@@ -353,18 +417,24 @@
DBG("%p", modem);
- ofono_phonebook_create(modem, 0, "atmodem", data->dlcs[VOICE_DLC]);
- ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
+ if (data->modem_type == SIM900) {
+ ofono_phonebook_create(modem, 0, "atmodem",
+ data->dlcs[VOICE_DLC]);
+ ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
data->dlcs[SMS_DLC]);
- gprs = ofono_gprs_create(modem, 0, "atmodem", data->dlcs[GPRS_DLC]);
- if (gprs == NULL)
- return;
-
- gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM_SIM900,
- "atmodem", data->dlcs[GPRS_DLC]);
- if (gc)
- ofono_gprs_add_context(gprs, gc);
+ gprs = ofono_gprs_create(modem, 0, "atmodem",
+ data->dlcs[GPRS_DLC]);
+ if (gprs == NULL)
+ return;
+
+ gc = ofono_gprs_context_create(modem,
+ OFONO_VENDOR_SIMCOM_SIM900,
+ "atmodem",
+ data->dlcs[GPRS_DLC]);
+ if (gc)
+ ofono_gprs_add_context(gprs, gc);
+ }
}
static void sim900_post_online(struct ofono_modem *modem)
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/plugins/xmm7xxx.c
^
|
@@ -57,16 +57,904 @@
#include <drivers/atmodem/atutil.h>
#include <drivers/atmodem/vendor.h>
+#include "ofono.h"
+#include "gdbus.h"
+
+#define OFONO_COEX_INTERFACE OFONO_SERVICE ".intel.LteCoexistence"
+#define OFONO_COEX_AGENT_INTERFACE OFONO_SERVICE ".intel.LteCoexistenceAgent"
+
+#define NET_BAND_LTE_INVALID 0
+#define NET_BAND_LTE_1 101
+#define NET_BAND_LTE_43 143
+#define BAND_LEN 20
+#define MAX_BT_SAFE_VECTOR 15
+#define MAX_WL_SAFE_VECTOR 13
+
static const char *none_prefix[] = { NULL };
static const char *xsimstate_prefix[] = { "+XSIMSTATE:", NULL };
+static const char *xnvmplmn_prefix[] = { "+XNVMPLMN:", NULL };
+
+struct bt_coex_info {
+ int safe_tx_min;
+ int safe_tx_max;
+ int safe_rx_min;
+ int safe_rx_max;
+ int safe_vector[MAX_BT_SAFE_VECTOR];
+ int num_safe_vector;
+};
+
+struct wl_coex_info {
+ int safe_tx_min;
+ int safe_tx_max;
+ int safe_rx_min;
+ int safe_rx_max;
+ int safe_vector[MAX_BT_SAFE_VECTOR];
+ int num_safe_vector;
+};
+
+struct coex_agent {
+ char *path;
+ char *bus;
+ guint disconnect_watch;
+ ofono_bool_t remove_on_terminate;
+ ofono_destroy_func removed_cb;
+ void *removed_data;
+ DBusMessage *msg;
+};
struct xmm7xxx_data {
GAtChat *chat; /* AT chat */
struct ofono_sim *sim;
ofono_bool_t have_sim;
ofono_bool_t sms_phonebook_added;
+ unsigned int netreg_watch;
+};
+
+/* Coex Implementation */
+enum wlan_bw {
+ WLAN_BW_UNSUPPORTED = -1,
+ WLAN_BW_20MHZ = 0,
+ WLAN_BW_40MHZ = 1,
+ WLAN_BW_80MHZ = 2,
+};
+
+struct plmn_hist {
+ unsigned short mnc;
+ unsigned short mcc;
+ unsigned long tdd;
+ unsigned long fdd;
+ unsigned char bw;
+};
+
+struct xmm7xxx_coex {
+ GAtChat *chat;
+ struct ofono_modem *modem;
+
+ DBusMessage *pending;
+ ofono_bool_t bt_active;
+ ofono_bool_t wlan_active;
+ enum wlan_bw wlan_bw;
+ char *lte_band;
+
+ ofono_bool_t pending_bt_active;
+ ofono_bool_t pending_wlan_active;
+ enum wlan_bw pending_wlan_bw;
+
+ struct coex_agent *session_agent;
+};
+
+static ofono_bool_t coex_agent_matches(struct coex_agent *agent,
+ const char *path, const char *sender)
+{
+ return !strcmp(agent->path, path) && !strcmp(agent->bus, sender);
+}
+
+static void coex_agent_set_removed_notify(struct coex_agent *agent,
+ ofono_destroy_func destroy,
+ void *user_data)
+{
+ agent->removed_cb = destroy;
+ agent->removed_data = user_data;
+}
+
+static void coex_agent_send_noreply(struct coex_agent *agent,
+ const char *method)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ DBusMessage *message;
+
+ message = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_COEX_INTERFACE,
+ method);
+ if (message == NULL)
+ return;
+
+ dbus_message_set_no_reply(message, TRUE);
+ g_dbus_send_message(conn, message);
+}
+
+static void coex_agent_send_release(struct coex_agent *agent)
+{
+ coex_agent_send_noreply(agent, "Release");
+}
+
+static void coex_agent_free(struct coex_agent *agent)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ if (agent->disconnect_watch) {
+ coex_agent_send_release(agent);
+
+ g_dbus_remove_watch(conn, agent->disconnect_watch);
+ agent->disconnect_watch = 0;
+ }
+
+ if (agent->removed_cb)
+ agent->removed_cb(agent->removed_data);
+
+ g_free(agent->path);
+ g_free(agent->bus);
+ g_free(agent);
+}
+
+static void coex_agent_disconnect_cb(DBusConnection *conn, void *user_data)
+{
+ struct coex_agent *agent = user_data;
+
+ ofono_debug("Agent exited without calling Unregister");
+
+ agent->disconnect_watch = 0;
+
+ coex_agent_free(agent);
+}
+
+static struct coex_agent *coex_agent_new(const char *path, const char *sender,
+ ofono_bool_t remove_on_terminate)
+{
+ struct coex_agent *agent = g_try_new0(struct coex_agent, 1);
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ DBG("");
+ if (agent == NULL)
+ return NULL;
+
+ agent->path = g_strdup(path);
+ agent->bus = g_strdup(sender);
+
+ agent->remove_on_terminate = remove_on_terminate;
+
+ agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender,
+ coex_agent_disconnect_cb,
+ agent, NULL);
+
+ return agent;
+}
+
+static int coex_agent_coex_wlan_notify(struct coex_agent *agent,
+ const struct wl_coex_info wlan_info)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ DBusMessageIter wl_args, wl_dict, wl_array;
+ const dbus_int32_t *pwl_array = wlan_info.safe_vector;
+ dbus_int32_t value;
+
+ agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_COEX_AGENT_INTERFACE,
+ "ReceiveWiFiNotification");
+ if (agent->msg == NULL)
+ return -ENOMEM;
+
+ dbus_message_iter_init_append(agent->msg, &wl_args);
+
+ dbus_message_iter_open_container(&wl_args, DBUS_TYPE_ARRAY,
+ DBUS_TYPE_INT32_AS_STRING, &wl_array);
+ dbus_message_iter_append_fixed_array(&wl_array, DBUS_TYPE_INT32,
+ &pwl_array, MAX_WL_SAFE_VECTOR);
+
+ dbus_message_iter_close_container(&wl_args, &wl_array);
+
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/src/ofono.conf
^
|
@@ -29,6 +29,7 @@
<allow send_interface="org.ofono.HandsfreeAudioAgent"/>
<allow send_interface="org.ofono.VoiceCallAgent"/>
<allow send_interface="org.ofono.NetworkMonitorAgent"/>
+ <allow send_interface="org.ofono.intel.LteCoexistenceAgent"/>
</policy>
<policy at_console="true">
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/ofono/test/change-pin
^
|
@@ -10,7 +10,7 @@
pin_type = sys.argv[2]
old_pin = sys.argv[3]
new_pin = sys.argv[4]
-elif len(sys.argv) == 3:
+elif len(sys.argv) == 4:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
modems = manager.GetModems()
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/.gitignore
^
|
@@ -22,8 +22,7 @@
missing
stamp-h1
autom4te.cache
-test-driver
-test-suite.log
+ell
ofono.pc
include/ofono
@@ -48,9 +47,11 @@
unit/test-rilmodem-cs
unit/test-rilmodem-gprs
unit/test-rilmodem-sms
+unit/test-mbim
unit/test-*.log
unit/test-*.trs
-unit/test-mbim
+test-driver
+test-suite.log
tools/huawei-audio
tools/auto-enable
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/AUTHORS
^
|
@@ -137,3 +137,5 @@
Florent Beillonnet <florent.beillonnet@gmail.com>
Martin Hundebøll <martin@geanix.com>
Julien Tournier <tournier.julien@gmail.com>
+Nandini Rebello <nandini.rebello@intel.com>
+Giacinto Cifelli <gciofono@gmail.com>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/ChangeLog
^
|
@@ -1,3 +1,21 @@
+ver 1.27:
+ Add support for handling SIMCom based SIM800 modems.
+ Add support for SIM lock state with xmm7xxx modems.
+ Add support for coexistence feature with xmm7xxx modems.
+
+ver 1.26:
+ Fix issue with AT callback handler and GPRS.
+ Fix issue with handling EUTRAN SMS only states.
+ Fix issue with handling MBIM strings on big endian.
+ Fix issue with missing char and SMS national language.
+ Fix issue with unsolicited notifications of +CGAUTH/+CGDCONT.
+ Add support for setting "none" authentication method.
+ Add support for SMS and phonebook with xmm7xxx modems.
+ Add support for voice features and Gemalto modems.
+ Add support for Bengali and Gujrati SMS alphabets.
+ Add support for 8 additional languages for GSM 7 bit
+ Add support for using internal Embedded Linux library.
+
ver 1.25:
Fix issue with handling GPRS context release.
Fix issue with GPRS context shutdown and Huawei modems.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/Makefile.am
^
|
@@ -3,6 +3,56 @@
noinst_LTLIBRARIES =
+if EXTERNAL_ELL
+ell_cflags = @ELL_CFLAGS@
+ell_ldadd = @ELL_LIBS@
+ell_dependencies =
+ell_built_sources =
+else
+ell_cflags =
+ell_ldadd = ell/libell-internal.la
+ell_dependencies = $(ell_ldadd)
+ell_built_sources = ell/internal ell/ell.h
+
+noinst_LTLIBRARIES += ell/libell-internal.la
+
+ell_headers = ell/util.h \
+ ell/test.h \
+ ell/strv.h \
+ ell/utf8.h \
+ ell/queue.h \
+ ell/main.h \
+ ell/idle.h \
+ ell/signal.h \
+ ell/timeout.h \
+ ell/io.h \
+ ell/log.h \
+ ell/checksum.h \
+ ell/random.h \
+ ell/uuid.h \
+ ell/file.h
+
+ell_sources = ell/private.h \
+ ell/missing.h \
+ ell/util.c \
+ ell/test.c \
+ ell/strv.c \
+ ell/utf8.c \
+ ell/queue.c \
+ ell/main.c \
+ ell/idle.c \
+ ell/signal.c \
+ ell/timeout.c \
+ ell/io.c \
+ ell/log.c \
+ ell/checksum.c \
+ ell/random.c \
+ ell/uuid.c \
+ ell/file.c
+
+ell_libell_internal_la_SOURCES = $(ell_headers) $(ell_sources)
+endif
+
pkginclude_HEADERS = include/log.h include/plugin.h include/history.h \
include/dbus.h include/modem.h include/types.h \
include/call-barring.h include/call-forwarding.h \
@@ -243,6 +293,32 @@
builtin_sources += plugins/gobi.c
endif
+if MBIMMODEM
+mbim_sources = drivers/mbimmodem/mbim.h \
+ drivers/mbimmodem/mbim.c \
+ drivers/mbimmodem/mbim-private.h \
+ drivers/mbimmodem/mbim-desc.h \
+ drivers/mbimmodem/mbim-desc.c \
+ drivers/mbimmodem/mbim-message.h \
+ drivers/mbimmodem/mbim-message.c
+
+builtin_modules += mbimmodem
+builtin_sources += $(mbim_sources) \
+ drivers/mbimmodem/util.h \
+ drivers/mbimmodem/util.c \
+ drivers/mbimmodem/mbimmodem.h \
+ drivers/mbimmodem/mbimmodem.c \
+ drivers/mbimmodem/devinfo.c \
+ drivers/mbimmodem/sim.c \
+ drivers/mbimmodem/network-registration.c \
+ drivers/mbimmodem/sms.c \
+ drivers/mbimmodem/gprs.c \
+ drivers/mbimmodem/gprs-context.c
+
+builtin_modules += mbim
+builtin_sources += plugins/mbim.c
+endif
+
if ATMODEM
builtin_modules += atmodem
builtin_sources += drivers/atmodem/atmodem.h \
@@ -397,14 +473,16 @@
builtin_sources += drivers/atmodem/atutil.h \
drivers/gemaltomodem/gemaltomodem.h \
drivers/gemaltomodem/gemaltomodem.c \
- drivers/gemaltomodem/location-reporting.c
+ drivers/gemaltomodem/location-reporting.c \
+ drivers/gemaltomodem/voicecall.c
builtin_modules += xmm7modem
builtin_sources += drivers/atmodem/atutil.h \
drivers/xmm7modem/xmm7modem.h \
drivers/xmm7modem/xmm7modem.c \
drivers/xmm7modem/radio-settings.c \
- drivers/xmm7modem/ims.c
+ drivers/xmm7modem/ims.c \
+ drivers/xmm7modem/netmon.c
if PHONESIM
builtin_modules += phonesim
@@ -608,36 +686,6 @@
builtin_modules += allowed_apns
builtin_sources += plugins/allowed-apns.c
-if ELL
-builtin_cflags += @ELL_CFLAGS@
-builtin_libadd += @ELL_LIBS@
-
-if MBIMMODEM
-mbim_sources = drivers/mbimmodem/mbim.h \
- drivers/mbimmodem/mbim.c \
- drivers/mbimmodem/mbim-desc.h \
- drivers/mbimmodem/mbim-desc.c \
- drivers/mbimmodem/mbim-message.h \
- drivers/mbimmodem/mbim-message.c
-
-builtin_modules += mbimmodem
-builtin_sources += $(mbim_sources) \
- drivers/mbimmodem/util.h \
- drivers/mbimmodem/util.c \
- drivers/mbimmodem/mbimmodem.h \
- drivers/mbimmodem/mbimmodem.c \
- drivers/mbimmodem/devinfo.c \
- drivers/mbimmodem/sim.c \
- drivers/mbimmodem/network-registration.c \
- drivers/mbimmodem/sms.c \
- drivers/mbimmodem/gprs.c \
- drivers/mbimmodem/gprs-context.c
-
-builtin_modules += mbim
-builtin_sources += plugins/mbim.c
-endif
-endif
-
sbin_PROGRAMS = src/ofonod
src_ofonod_SOURCES = $(builtin_sources) $(gatchat_sources) src/ofono.ver \
@@ -669,13 +717,15 @@
src/netmon.c src/lte.c src/ims.c \
src/netmonagent.c src/netmonagent.h
-src_ofonod_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) \
+src_ofonod_LDADD = gdbus/libgdbus-internal.la $(builtin_libadd) $(ell_ldadd) \
@GLIB_LIBS@ @DBUS_LIBS@ -ldl
src_ofonod_LDFLAGS = -Wl,--export-dynamic \
-Wl,--version-script=$(srcdir)/src/ofono.ver
-BUILT_SOURCES = $(local_headers) src/builtin.h
+src_ofonod_DEPENDENCIES = $(ell_dependencies)
+
+BUILT_SOURCES = $(local_headers) $(ell_built_sources) src/builtin.h
CLEANFILES = $(BUILT_SOURCES) $(rules_DATA)
@@ -687,7 +737,7 @@
build_plugindir = $(plugindir)
endif
-AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ $(builtin_cflags) \
+AM_CFLAGS = @DBUS_CFLAGS@ @GLIB_CFLAGS@ $(ell_cflags) $(builtin_cflags) \
-DOFONO_PLUGIN_BUILTIN \
-DPLUGINDIR=\""$(build_plugindir)"\"
@@ -825,7 +875,8 @@
test/test-serving-cell-info \
test/ims-register \
test/ims-unregister \
- test/list-applications
+ test/list-applications \
+ test/set-sms-alphabet
if TEST
@@ -844,18 +895,12 @@
unit_tests = unit/test-common unit/test-util unit/test-idmap \
unit/test-simutil unit/test-stkutil \
unit/test-sms unit/test-cdmasms \
+ unit/test-mbim \
unit/test-rilmodem-cs \
unit/test-rilmodem-sms \
unit/test-rilmodem-cb \
unit/test-rilmodem-gprs
-if ELL
-if MBIMMODEM
-unit_tests += unit/test-mbim
-endif
-endif
-
-
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/README
^
|
@@ -22,12 +22,42 @@
make && make install
+Embedded Linux library
+======================
+
+In order to compile the daemon and utilities the development version of
+Embedded Linux library is required to be present. The development
+repositories can be found here:
+
+ git://git.kernel.org/pub/scm/libs/ell/ell.git
+ https://kernel.googlesource.com/pub/scm/libs/ell/ell.git
+
+The build systems requires that the Embedded Linux library source code
+is available on the same top level directory as the source code:
+
+ .
+ |--- ell
+ | |--- ell
+ | `--- unit
+ `--- ofono
+ |--- src
+ `--- tools
+
+It is not required to build or install Embedded Linux library. The build
+will happen when building the Wireless daemon and it will then be linked
+internally.
+
+When using --enable-external-ell build option, it is not required that the
+Embedded Linux library source code is available in the top level directory.
+
+
Kernel Dependencies
===================
In order to have the PPP stack working in oFono you need to enable CONFIG_TUN
(Universal TUN/TAP device driver support) in your kernel .config.
+
Information
===========
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/configure.ac
^
|
@@ -1,5 +1,5 @@
AC_PREREQ(2.60)
-AC_INIT(ofono, 1.25)
+AC_INIT(ofono, 1.27)
AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
AC_CONFIG_HEADERS(config.h)
@@ -160,6 +160,11 @@
[enable_qmimodem=${enableval}])
AM_CONDITIONAL(QMIMODEM, test "${enable_qmimodem}" != "no")
+AC_ARG_ENABLE(mbimmodem, AC_HELP_STRING([--disable-mbimmodem],
+ [disable MBIM modem support]),
+ [enable_mbimmodem=${enableval}])
+AM_CONDITIONAL(MBIMMODEM, test "${enable_mbimmodem}" != "no")
+
AC_ARG_ENABLE(bluetooth, AC_HELP_STRING([--disable-bluetooth],
[disable BlueZ 4 and BlueZ 5 plugins support]),
[enable_bluetooth=${enableval}])
@@ -207,24 +212,16 @@
[enable_upower=${enableval}])
AM_CONDITIONAL(UPOWER, test "${enable_power}" != "no")
-AC_ARG_ENABLE(mbimmodem, AC_HELP_STRING([--enable-mbimmodem],
- [enable MBIM based modem support]),
- [enable_mbimmodem=${enableval}])
-
-AC_ARG_ENABLE(ell, AC_HELP_STRING([--enable-ell],
- [enable support for ell]),
- [enable_ell=${enableval}])
-
-if (test "${enable_ell}" = "yes"); then
- AC_DEFINE(HAVE_ELL, 1, [Defined if Ell is enabled])
- PKG_CHECK_MODULES(ELL, ell >= 0.2, dummy=yes,
- AC_MSG_ERROR(ell library >= 0.2 is required))
+AC_ARG_ENABLE([external_ell], AC_HELP_STRING([--enable-external-ell],
+ [enable external Embedded Linux library]),
+ [enable_external_ell=${enableval}])
+if (test "${enable_external_ell}" = "yes"); then
+ PKG_CHECK_MODULES(ELL, ell >= 0.12, dummy=yes,
+ AC_MSG_ERROR(Embedded Linux library >= 0.12 is required))
AC_SUBST(ELL_CFLAGS)
AC_SUBST(ELL_LIBS)
fi
-
-AM_CONDITIONAL(MBIMMODEM, test "${enable_ell}" != "no" && test "${enable_mbimmodem}" = "yes")
-AM_CONDITIONAL(ELL, test "${enable_ell}" != "no")
+AM_CONDITIONAL(EXTERNAL_ELL, test "${enable_external_ell}" = "yes")
AC_ARG_ENABLE(datafiles, AC_HELP_STRING([--disable-datafiles],
[do not install configuration and data files]),
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/common-patterns.txt
^
|
@@ -0,0 +1,164 @@
+Every project has its own recursive patterns, and oFono is not an exception.
+This document describes the most common ones found in the code.
+
+Typical flow for atom <-> atom driver operations
+================================================
+Most of the time, the core atom for a given request calls a function in
+the atom driver, which generally executes some commands against the modem,
+and can then return the results to the core.
+
+For example:
+
+dbus call: lte/SetProperty(DefaultAPN)
+ |
+ v
+core: check APN validity, call the modem atom for execution in the modem
+ |
+ v
+atom driver: schedules 'AT+CGDCONT=0,"IP","MyNiceAPN"' for execution
+ |
+[ break in the flow: the functions return back to the core, the dbus request ]
+[ is not answered at this time ]
+ ...
+[GLibMain event loop schedules the command, it is sent to the modem and the ]
+[ modem's reply is obtained ]
+ |
+ v
+atom driver: a callback function, optionally provided when AT command was
+scheduled is now called
+ |
+ v
+core: atom driver core callback function is now called. This was passed from
+the core as an argument, earlier, when the atom driver operation was invoked,
+along with some context data (opaque info for the atom driver containing core
+atom owned data)
+ |
+ v
+the core can now answer the dbus message
+
+
+In the code, it looks like this:
+
+//core call:
+static DBusMessage *lte_set_property(DBusConnection *conn,
+ DBusMessage *msg, void *data)
+{
+ struct ofono_lte *lte = data;
+
+ /*
+ * a block of code here processes the msg and fills the
+ * lte->pending_info structure
+ */
+
+ lte->driver->set_default_attach_info(lte, <e->pending_info,
+ lte_set_default_attach_info_cb, lte);
+
+ return NULL;
+}
+// lte_set_default_attach_info_cb is the core callback function,
+// the lte structure is the parameter that it takes
+
+//atom:
+static void at_lte_set_default_attach_info(const struct ofono_lte *lte,
+ const struct ofono_lte_default_attach_info *info,
+ ofono_lte_cb_t cb, void *data)
+{
+ struct lte_driver_data *ldd = ofono_lte_get_data(lte);
+
+ // next line creates a structure for the in-atom callback
+ struct cb_data *cbd = cb_data_new(cb, data);
+
+ if (g_at_chat_send(ldd->chat, "AT", NULL,
+ at_lte_set_default_attach_info_cb,
+ cbd, g_free) > 0)
+ return;
+
+ g_free(cbd);
+ CALLBACK_WITH_FAILURE(cb, data);
+}
+// here the structure is allocate dynamically, and since it is quite common,
+// the function g_at_chat_send accepts the last 3 parameters:
+// - in-atom callback function
+// - in-atom callback data
+// - destroy function for dynamically-allocated callback data
+// NOTE: if g_at_chat_send fails, it does not free the memory, so it must be
+// done after the call.
+// Note also the callback to the core directly here if the g_at_chat_send fails.
+
+//atom callback:
+
+static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
+ gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+
+ if (result == NULL) {
+ CALLBACK_WITH_FAILURE(cbd->cb, cbd->data);
+ return;
+ }
+
+ decode_at_error(&error, g_at_result_final_response(result));
+ cbd->cb(&error, cbd->data);
+}
+// note that here cbd must not be released, it will be done by the GAtChat
+// after invoking the callback (at_lte_set_default_attach_info_cb)
+// note also that the core function will be executed before cbd is released,
+// so the last line of the code is ok.
+
+
+Use of the cb_data in AT command based atom drivers
+===================================================
+
+the cb_data can be used by creating the structure with cb_data_new,
+and then there are two possibilities:
+- use it in a single callback function, and destroy it with a call to
+ g_free.
+ Example:
+ - calling function:
+ struct cb_data *cbd = cb_data_new(cb, data);
+ if (g_at_chat_send(chat, buf, NULL, at_cgatt_cb, cbd, g_free) > 0)
+ return;
+ g_free(cbd);
+ - called function (here at_cgatt_cb):
+ static void at_cgatt_cb(gboolean ok, GAtResult *result,
+ gpointer user_data)
+ {
+ struct cb_data *cbd = user_data;
+ ofono_gprs_cb_t cb = cbd->cb;
+ struct ofono_error error;
+
+ decode_at_error(&error,
+ g_at_result_final_response(result));
+
+ cb(&error, cbd->data);
+ }
+ note the absence of explicit g_free(cbd);
+
+- pass it through a train of callback functions, adding a reference at
+ each pass cb_data_ref, and removing it with cb_data_unref.
+ the use of cb_data_ref would replace a new object creation, while the
+ use of cb_data_unref the use of g_free.
+ Example:
+ - calling function:
+ struct cb_data *cbd = cb_data_new(cb, data);
+ // no cb_ref at the creation
+ if (g_at_chat_send(chat, buf, NULL,
+ at_lte_set_default_attach_info_cb,
+ cbd, cb_data_unref) > 0)
+ goto end;
+ cb_data_unref(cbd);
+ - called function 1 (at_lte_set_default_attach_info_cb):
+ static void at_lte_set_default_attach_info_cb(gboolean ok,
+ GAtResult *result, gpointer user_data)
+ {
+ struct cb_data *cbd = user_data;
+
+ cbd = cb_data_ref(cbd);
+ if (g_at_chat_send(chat, buf, NULL,
+ at_cgatt_cb, cbd, cb_data_unref) > 0)
+ return;
+ cb_data_unref(cbd);
+ }
+ - called function 2 (at_cgatt_cb):
+ like above. no call to g_free or cb_data_unref. The terminal function
+ doesn't need to know about the reference scheme.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/connman-api.txt
^
|
@@ -192,7 +192,8 @@
string AuthenticationMethod [readwrite]
Holds the PPP authentication method to use. Valid
- values are "pap" and "chap". Defaults to "chap".
+ values are "pap", "chap" and "none".
+ Defaults to "chap".
string Username [readwrite]
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/intel-lte-coex-api.txt
^
|
@@ -0,0 +1,137 @@
+LTE Coexistence hierarchy
+=========================
+
+Service org.ofono
+Interface org.ofono.intel.LteCoexistence
+Object path [variable prefix]/{modem0,modem1,...}
+
+Methods dict GetProperties()
+
+ Returns all coexistence configuration properties.
+
+ void SetProperty(string property, variant value)
+
+ Changes the value of the specified property. Only
+ properties that are listed as Read-write are changeable.
+ On success a PropertyChanged signal will be emitted.
+
+ Possible Errors: [service].Error.InProgress
+ [service].Error.InvalidArguments
+ [service].Error.Failed
+
+ void RegisterAgent(object path)
+
+ Registers an agent which will be called whenever the
+ modem initiates LTE Coexistence information.
+
+ Possible Errors: [service].Error.InProgress
+ [service].Error.InvalidArguments
+ [service].Error.InvalidFormat
+ [service].Error.Failed
+
+ void UnregisterAgent(object path)
+
+ Unregisters an agent.
+
+ Possible Errors: [service].Error.InvalidArguments
+ [service].Error.Failed
+
+ a(a{sv}) GetPlmnHistory()
+ Requests for LTE Plmn history list stored in NVM to
+ retrieve geo location history like MobileNetworkCode,
+ MobileCountryCode, LteBandsFDD, LteBandsTDD,
+ ChannelBandwidth.
+
+ Refer to the sections below for which property types
+ are available, their valid value ranges and
+ applicability to different cell types.
+
+Signals PropertyChanged(string property, variant value)
+
+ This signal indicates a changed value of the given
+ property.
+
+Properties string Band [readwrite]
+
+ Frequency band in which the modem is operating when
+ using "lte" mode.
+
+ boolean BTActive [readwrite]
+
+ Contains whether BT Coex is activated or not.
+
+ boolean WLANActive [readwrite]
+
+ Contains whether WLAN Coex is activated or not.
+
+ string WLANBandwidth [readwrite]
+
+ Contains the frequency WLAN Coex is activated on, when
+ "CoexWLANActive" is active.
+
+ The possible values are:
+ - "20MHz"
+ - "40MHz"
+ - "80MHz"
+
+LTECoexistenceAgent Hierarchy [experimental]
+=============================
+
+Service unique name
+Interface org.ofono.intel.LteCoexistenceAgent
+Object path freely definable
+
+Methods void ReceiveBluetoothNotification(array{byte} notification,
+ dict info) [noreply]
+
+ Requests the agent to process Bluetooth related LTE
+ Coexistence information. The dictionary info contains
+ vector table with modem recommended Safe Tx/Rx band and
+ range information.The properties involved are
+ 'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and
+ 'SafeVector'.
+
+ Possible Errors: None
+
+ void ReceiveWiFiNotification(array{byte} notification,
+ dict info) [noreply]
+
+ Requests the agent to process WiFi related LTE
+ Coexistence information. The dictionary info contains
+ vector table with modem recommended SafeTx/Rx band and
+ range information. The properties involved are
+ 'SafeTxMin', 'SafeRxMin', 'SafeTxMax', 'SafeRxMax' and
+ 'SafeVector'.
+
+ Possible Errors: None
+
+ void Release() [noreply]
+
+ Agent is being released, possibly because of oFono
+ terminating, Coex interface is being torn down or modem
+ off. No UnregisterAgent call is needed.
+
+LTE Plmn history params
+=======================
+uint16 MobileNetworkCode [readonly, optional]
+
+ Contains the MNC of the cell.
+
+uint16 MobileCountryCode [readonly, optional]
+
+ Contains the MCC of the cell.
+
+uint32 LteBandsFDD [readonly, optional]
+
+ Contains the Lte FDD band. Valid range of values is 1 to 32 as per
+ 3GPP 36.101 Section 5.5.
+
+uint32 LteBandsTDD [readonly, optional]
+
+ Contains the Lte TDD band. Valid range of values is 33 to 64 as per
+ 3GPP 36.101 Section 5.5.
+
+byte ChannelBandwidth [readonly, optional]
+
+ Contains the Channel bandwidth. Valid range of values is 0 to 6 as per
+ 3GPP 36.101 Section 5.6.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/lte-api.txt
^
|
@@ -33,3 +33,39 @@
Setting this property to an empty string clears the
default APN from the modem.
+
+ string Protocol [readwrite, experimental]
+
+ Holds the protocol for this context. Valid values
+ are: "ip", "ipv6" and "dual". Default value is "ip".
+
+ string AuthenticationMethod [readwrite, experimental]
+
+ Sets the Method used for the authentication
+ for the default APN.
+
+ Available values are "none", "pap" and "chap".
+ Default is "none".
+
+ If the AuthenticationMethod is set to 'none',
+ no authentication is performed for the default attach
+ APN. Username and Password properties are ignored,
+ even if containing a valid value. If Username or
+ Password are empty, AuthenticationMethod is implicitly
+ assumed to be set to 'none'.
+
+ If the default APN supports authentication and it
+ fails, then it is up to the network how to proceed.
+ In general LTE access is denied and the modem can
+ fallback to a legacy technology if capable and another
+ radio technology is available.
+
+ string Username [readwrite, experimental]
+
+ Holds the username to be used for authentication
+ purposes.
+
+ string Password [readwrite, experimental]
+
+ Holds the password to be used for authentication
+ purposes.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/messagemanager-api.txt
^
|
@@ -104,6 +104,16 @@
"turkish" - Turkish alphabet
"spanish" - Spanish alphabet
"portuguese" - Portuguese alphabet
+ "bengali" - Bengali alphabet
+ "gujarati" - Gujarati alphabet
+ "hindi" - Hindi alphabet
+ "kannada" - Kannada alphabet
+ "malayalam" - Malayalam alphabet
+ "oriya" - Oriya alphabet
+ "punjabi"- Punjabi alphabet
+ "tamil" - Tamil alphabet
+ "telugu" - Telugu alphabet
+ "urdu" - Urdu alphabet
The standard, language-specific alphabets are defined
in 3GPP TS23.038, Annex A. By default, oFono uses
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/network-api.txt
^
|
@@ -77,7 +77,9 @@
string Status [readonly]
- The current registration status of a modem.
+ The current registration status of a modem. In case
+ technology is 'lte', 'registered' and 'roaming' may
+ not necessarily mean voice calling available.
The possible values are:
"unregistered" Not registered to any network
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/doc/simcom-modem.txt
^
|
@@ -0,0 +1,22 @@
+SIM900 modem usage
+===================
+
+To enable SIM900 module support you need to put the following
+udev rule into appropriate file in /{etc,lib}/udev/rules.d:
+
+KERNEL=="gsmtty3", ENV{OFONO_DRIVER}="sim900"
+
+On the i-Tetra tracking device, the SIM900 is accessed
+via N_GSM mux device. We use ofono as SMS message
+service and incoming voice calls service, so we
+use /dev/gsmtty1 provided by N_GSM mux.
+
+SIM800 modem usage
+==================
+
+When using sim800 modem, the udev rule is the same as the
+sim900 rule :
+
+KERNEL=="ttyS3", ENV{OFONO_DRIVER}="sim900"
+
+Because the SIM800 and SIM900 code are the merged into one driver.
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/atutil.c
^
|
@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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
@@ -654,3 +655,45 @@
return ret;
}
+
+int at_util_gprs_auth_method_to_auth_prot(
+ enum ofono_gprs_auth_method auth_method)
+{
+ switch (auth_method) {
+ case OFONO_GPRS_AUTH_METHOD_PAP:
+ return 1;
+ case OFONO_GPRS_AUTH_METHOD_CHAP:
+ return 2;
+ case OFONO_GPRS_AUTH_METHOD_NONE:
+ return 0;
+ }
+
+ return 0;
+}
+
+const char *at_util_gprs_proto_to_pdp_type(enum ofono_gprs_proto proto)
+{
+ switch (proto) {
+ case OFONO_GPRS_PROTO_IPV6:
+ return "IPV6";
+ case OFONO_GPRS_PROTO_IPV4V6:
+ return "IPV4V6";
+ break;
+ case OFONO_GPRS_PROTO_IP:
+ return "IP";
+ }
+
+ return NULL;
+}
+
+char *at_util_get_cgdcont_command(guint cid, enum ofono_gprs_proto proto,
+ const char *apn)
+{
+ const char *pdp_type = at_util_gprs_proto_to_pdp_type(proto);
+
+ if (!apn)
+ return g_strdup_printf("AT+CGDCONT=%u", cid);
+
+ return g_strdup_printf("AT+CGDCONT=%u,\"%s\",\"%s\"", cid, pdp_type,
+ apn);
+}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/atutil.h
^
|
@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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
@@ -86,7 +87,24 @@
int at_util_get_ipv4_address_and_netmask(const char *addrnetmask,
char *address, char *netmask);
+int at_util_gprs_auth_method_to_auth_prot(
+ enum ofono_gprs_auth_method auth_method);
+
+const char *at_util_gprs_proto_to_pdp_type(enum ofono_gprs_proto proto);
+
+/*
+ * at_util_get_cgdcont_command
+ * if the apn pointer is NULL, the context will be removed: the resulting
+ * string will be like: AT+CGDCONT=7
+ * but if apn pointer is not NULL and the string is empty, then
+ * this function will create a normal context with empty apn, like:
+ * AT+CGDCONT=4,"IPV6",""
+ */
+char *at_util_get_cgdcont_command(guint cid, enum ofono_gprs_proto proto,
+ const char *apn);
+
struct cb_data {
+ gint ref_count;
void *cb;
void *data;
void *user;
@@ -97,12 +115,29 @@
struct cb_data *ret;
ret = g_new0(struct cb_data, 1);
+ ret->ref_count = 1;
ret->cb = cb;
ret->data = data;
return ret;
}
+static inline struct cb_data *cb_data_ref(struct cb_data *cbd)
+{
+ cbd->ref_count++;
+ return cbd;
+}
+
+static inline void cb_data_unref(gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+
+ if (--cbd->ref_count)
+ return;
+
+ g_free(cbd);
+}
+
static inline int at_util_convert_signal_strength(int strength)
{
int result;
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-barring.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -212,7 +211,7 @@
ofono_call_barring_set_data(cb, NULL);
}
-static struct ofono_call_barring_driver driver = {
+static const struct ofono_call_barring_driver driver = {
.name = "atmodem",
.probe = at_call_barring_probe,
.remove = at_call_barring_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-forwarding.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -264,7 +263,7 @@
ofono_call_forwarding_set_data(cf, NULL);
}
-static struct ofono_call_forwarding_driver driver = {
+static const struct ofono_call_forwarding_driver driver = {
.name = "atmodem",
.probe = at_ccfc_probe,
.remove = at_ccfc_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-meter.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -331,7 +330,7 @@
ofono_call_meter_set_data(cm, NULL);
}
-static struct ofono_call_meter_driver driver = {
+static const struct ofono_call_meter_driver driver = {
.name = "atmodem",
.probe = at_caoc_probe,
.remove = at_caoc_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -398,7 +397,7 @@
ofono_call_settings_set_data(cs, NULL);
}
-static struct ofono_call_settings_driver driver = {
+static const struct ofono_call_settings_driver driver = {
.name = "atmodem",
.probe = at_call_settings_probe,
.remove = at_call_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/call-volume.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
@@ -207,7 +206,7 @@
g_free(cvd);
}
-static struct ofono_call_volume_driver driver = {
+static const struct ofono_call_volume_driver driver = {
.name = "atmodem",
.probe = at_call_volume_probe,
.remove = at_call_volume_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/cbs.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
@@ -304,7 +303,7 @@
g_free(data);
}
-static struct ofono_cbs_driver driver = {
+static const struct ofono_cbs_driver driver = {
.name = "atmodem",
.probe = at_cbs_probe,
.remove = at_cbs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/devinfo.c
^
|
@@ -153,7 +153,7 @@
g_at_chat_unref(chat);
}
-static struct ofono_devinfo_driver driver = {
+static const struct ofono_devinfo_driver driver = {
.name = "atmodem",
.probe = at_devinfo_probe,
.remove = at_devinfo_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/gnss.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -263,7 +262,7 @@
g_free(gd);
}
-static struct ofono_gnss_driver driver = {
+static const struct ofono_gnss_driver driver = {
.name = "atmodem",
.probe = at_gnss_probe,
.remove = at_gnss_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -158,7 +157,10 @@
g_at_ppp_set_debug(gcd->ppp, ppp_debug, "PPP");
g_at_ppp_set_auth_method(gcd->ppp, gcd->auth_method);
- g_at_ppp_set_credentials(gcd->ppp, gcd->username, gcd->password);
+
+ if (gcd->auth_method != G_AT_PPP_AUTH_METHOD_NONE)
+ g_at_ppp_set_credentials(gcd->ppp, gcd->username,
+ gcd->password);
/* set connect and disconnect callbacks */
g_at_ppp_set_connect_function(gcd->ppp, ppp_connect, gc);
@@ -247,7 +249,7 @@
memcpy(gcd->username, ctx->username, sizeof(ctx->username));
memcpy(gcd->password, ctx->password, sizeof(ctx->password));
- /* We only support CHAP and PAP */
+ /* We support CHAP, PAP and NONE */
switch (ctx->auth_method) {
case OFONO_GPRS_AUTH_METHOD_CHAP:
gcd->auth_method = G_AT_PPP_AUTH_METHOD_CHAP;
@@ -255,8 +257,11 @@
case OFONO_GPRS_AUTH_METHOD_PAP:
gcd->auth_method = G_AT_PPP_AUTH_METHOD_PAP;
break;
- default:
- goto error;
+ case OFONO_GPRS_AUTH_METHOD_NONE:
+ gcd->auth_method = G_AT_PPP_AUTH_METHOD_NONE;
+ memset(gcd->username, 0, sizeof(gcd->username));
+ memset(gcd->password, 0, sizeof(gcd->password));
+ break;
}
gcd->state = STATE_ENABLING;
@@ -304,6 +309,10 @@
snprintf(buf + len, sizeof(buf) - len - 3,
",\"PAP:%s\"", ctx->apn);
break;
+ case OFONO_GPRS_AUTH_METHOD_NONE:
+ snprintf(buf + len, sizeof(buf) - len - 3,
+ ",\"%s\"", ctx->apn);
+ break;
}
break;
default:
@@ -484,7 +493,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "atmodem",
.probe = at_gprs_context_probe,
.remove = at_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/gprs.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -642,7 +641,7 @@
g_free(gd);
}
-static struct ofono_gprs_driver driver = {
+static const struct ofono_gprs_driver driver = {
.name = "atmodem",
.probe = at_gprs_probe,
.remove = at_gprs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/lte.c
^
|
@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Intel Corporation. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -41,45 +41,88 @@
#include "atmodem.h"
+static const char *none_prefix[] = { NULL };
+
struct lte_driver_data {
GAtChat *chat;
+ struct ofono_lte_default_attach_info pending_info;
};
-static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
+static void at_lte_set_auth_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
ofono_lte_cb_t cb = cbd->cb;
struct ofono_error error;
- DBG("ok %d", ok);
-
decode_at_error(&error, g_at_result_final_response(result));
cb(&error, cbd->data);
}
+static void at_lte_set_default_attach_info_cb(gboolean ok, GAtResult *result,
+ gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ ofono_lte_cb_t cb = cbd->cb;
+ void *data = cbd->data;
+ struct lte_driver_data *ldd = cbd->user;
+ struct ofono_error error;
+ char buf[32 + OFONO_GPRS_MAX_USERNAME_LENGTH +
+ OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
+ size_t buflen = sizeof(buf);
+ size_t len;
+ enum ofono_gprs_auth_method auth_method;
+
+ if (!ok) {
+ decode_at_error(&error, g_at_result_final_response(result));
+ cb(&error, data);
+ return;
+ }
+
+ auth_method = ldd->pending_info.auth_method;
+
+ /* change the authentication method if the parameters are invalid */
+ if (!*ldd->pending_info.username || !*ldd->pending_info.password)
+ auth_method = OFONO_GPRS_AUTH_METHOD_NONE;
+
+ len = snprintf(buf, buflen, "AT+CGAUTH=0,%d",
+ at_util_gprs_auth_method_to_auth_prot(auth_method));
+ buflen -= len;
+
+ if (auth_method != OFONO_GPRS_AUTH_METHOD_NONE)
+ snprintf(buf + len, buflen, ",\"%s\",\"%s\"",
+ ldd->pending_info.username,
+ ldd->pending_info.password);
+
+ cbd = cb_data_ref(cbd);
+ if (g_at_chat_send(ldd->chat, buf, none_prefix,
+ at_lte_set_auth_cb, cbd, cb_data_unref) > 0)
+ return;
+
+ cb_data_unref(cbd);
+ CALLBACK_WITH_FAILURE(cb, data);
+}
+
static void at_lte_set_default_attach_info(const struct ofono_lte *lte,
const struct ofono_lte_default_attach_info *info,
ofono_lte_cb_t cb, void *data)
{
struct lte_driver_data *ldd = ofono_lte_get_data(lte);
- char buf[32 + OFONO_GPRS_MAX_APN_LENGTH + 1];
struct cb_data *cbd = cb_data_new(cb, data);
+ char *buf = at_util_get_cgdcont_command(0, info->proto, info->apn);
- DBG("LTE config with APN: %s", info->apn);
+ cbd->user = ldd;
+ memcpy(&ldd->pending_info, info, sizeof(ldd->pending_info));
- if (strlen(info->apn) > 0)
- snprintf(buf, sizeof(buf), "AT+CGDCONT=0,\"IP\",\"%s\"",
- info->apn);
- else
- snprintf(buf, sizeof(buf), "AT+CGDCONT=0,\"IP\"");
-
- /* We can't do much in case of failure so don't check response. */
- if (g_at_chat_send(ldd->chat, buf, NULL,
- at_lte_set_default_attach_info_cb, cbd, g_free) > 0)
- return;
+ if (g_at_chat_send(ldd->chat, buf, none_prefix,
+ at_lte_set_default_attach_info_cb,
+ cbd, cb_data_unref) > 0)
+ goto end;
+ cb_data_unref(cbd);
CALLBACK_WITH_FAILURE(cb, data);
+end:
+ g_free(buf);
}
static gboolean lte_delayed_register(gpointer user_data)
@@ -124,7 +167,7 @@
g_free(ldd);
}
-static struct ofono_lte_driver driver = {
+static const struct ofono_lte_driver driver = {
.name = "atmodem",
.probe = at_lte_probe,
.remove = at_lte_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/network-registration.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -179,7 +178,7 @@
return tech;
}
-static int cinterion_parse_tech(GAtResult *result)
+static int gemalto_parse_tech(GAtResult *result)
{
int tech = -1;
GAtResultIter iter;
@@ -235,13 +234,13 @@
cb(&error, status, lac, ci, tech, cbd->data);
}
-static void cinterion_query_tech_cb(gboolean ok, GAtResult *result,
+static void gemalto_query_tech_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct tech_query *tq = user_data;
int tech;
- tech = cinterion_parse_tech(result);
+ tech = gemalto_parse_tech(result);
ofono_netreg_status_notify(tq->netreg,
tq->status, tq->lac, tq->ci, tech);
@@ -880,7 +879,7 @@
ofono_netreg_strength_notify(netreg, strength);
}
-static void cinterion_ciev_notify(GAtResult *result, gpointer user_data)
+static void gemalto_ciev_notify(GAtResult *result, gpointer user_data)
{
struct ofono_netreg *netreg = user_data;
struct netreg_data *nd = ofono_netreg_get_data(netreg);
@@ -1560,10 +1559,10 @@
option_query_tech_cb, tq, g_free) > 0)
return;
break;
- case OFONO_VENDOR_CINTERION:
+ case OFONO_VENDOR_GEMALTO:
if (g_at_chat_send(nd->chat, "AT^SMONI",
smoni_prefix,
- cinterion_query_tech_cb, tq, g_free) > 0)
+ gemalto_query_tech_cb, tq, g_free) > 0)
return;
break;
}
@@ -2032,12 +2031,12 @@
g_at_chat_send(nd->chat, "AT*TLTS=1", none_prefix,
NULL, NULL, NULL);
break;
- case OFONO_VENDOR_CINTERION:
+ case OFONO_VENDOR_GEMALTO:
/*
- * We can't set rssi bounds from Cinterion responses
+ * We can't set rssi bounds from Gemalto responses
* so set them up to specified values here
*
- * Cinterion rssi signal strength specified as:
+ * Gemalto rssi signal strength specified as:
* 0 <= -112dBm
* 1 - 4 signal strengh in 15 dB steps
* 5 >= -51 dBm
@@ -2051,7 +2050,7 @@
g_at_chat_send(nd->chat, "AT^SIND=\"rssi\",1", none_prefix,
NULL, NULL, NULL);
g_at_chat_register(nd->chat, "+CIEV:",
- cinterion_ciev_notify, FALSE, netreg, NULL);
+ gemalto_ciev_notify, FALSE, netreg, NULL);
break;
case OFONO_VENDOR_NOKIA:
case OFONO_VENDOR_SAMSUNG:
@@ -2155,7 +2154,7 @@
g_free(nd);
}
-static struct ofono_netreg_driver driver = {
+static const struct ofono_netreg_driver driver = {
.name = "atmodem",
.probe = at_netreg_probe,
.remove = at_netreg_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/phonebook.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -593,7 +592,7 @@
g_free(pbd);
}
-static struct ofono_phonebook_driver driver = {
+static const struct ofono_phonebook_driver driver = {
.name = "atmodem",
.probe = at_phonebook_probe,
.remove = at_phonebook_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/sim.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -1959,7 +1958,7 @@
g_free(sd);
}
-static struct ofono_sim_driver driver = {
+static const struct ofono_sim_driver driver = {
.name = "atmodem",
.probe = at_sim_probe,
.remove = at_sim_remove,
@@ -1987,7 +1986,7 @@
.logical_access = at_logical_access
};
-static struct ofono_sim_driver driver_noef = {
+static const struct ofono_sim_driver driver_noef = {
.name = "atmodem-noef",
.probe = at_sim_probe,
.remove = at_sim_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/sms.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -104,7 +103,7 @@
{
struct sms_data *data = ofono_sms_get_data(sms);
struct cb_data *cbd = cb_data_new(cb, user_data);
- char buf[64];
+ char buf[128];
snprintf(buf, sizeof(buf), "AT+CSCA=\"%s\",%d", sca->number, sca->type);
@@ -859,8 +858,18 @@
data->cnma_enabled ? "21" : "1", FALSE))
return FALSE;
+ switch (data->vendor) {
+ case OFONO_VENDOR_GEMALTO:
+ mode = "0";
+ break;
+ default:
+ /* Sounds like 2 is the sanest mode */
+ mode = "20";
+ break;
+ }
+
/* Always deliver CB via +CBM, otherwise don't deliver at all */
- if (!append_cnmi_element(buf, &len, cnmi_opts[2], "20", FALSE))
+ if (!append_cnmi_element(buf, &len, cnmi_opts[2], mode, FALSE))
return FALSE;
/*
@@ -1320,7 +1329,7 @@
ofono_sms_set_data(sms, NULL);
}
-static struct ofono_sms_driver driver = {
+static const struct ofono_sms_driver driver = {
.name = "atmodem",
.probe = at_sms_probe,
.remove = at_sms_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/stk.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -223,7 +222,7 @@
g_free(sd);
}
-static struct ofono_stk_driver driver = {
+static const struct ofono_stk_driver driver = {
.name = "atmodem",
.probe = at_stk_probe,
.remove = at_stk_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/ussd.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -327,7 +326,7 @@
g_free(data);
}
-static struct ofono_ussd_driver driver = {
+static const struct ofono_ussd_driver driver = {
.name = "atmodem",
.probe = at_ussd_probe,
.remove = at_ussd_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/vendor.h
^
|
@@ -47,7 +47,6 @@
OFONO_VENDOR_QUECTEL_M95,
OFONO_VENDOR_UBLOX,
OFONO_VENDOR_UBLOX_TOBY_L2,
- OFONO_VENDOR_CINTERION,
OFONO_VENDOR_XMM,
OFONO_VENDOR_GEMALTO,
};
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/atmodem/voicecall.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -1155,7 +1154,7 @@
g_free(vd);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = "atmodem",
.probe = at_voicecall_probe,
.remove = at_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/calypsomodem/stk.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -292,7 +291,7 @@
g_free(sd);
}
-static struct ofono_stk_driver driver = {
+static const struct ofono_stk_driver driver = {
.name = "calypsomodem",
.probe = calypso_stk_probe,
.remove = calypso_stk_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/calypsomodem/voicecall.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -402,7 +401,7 @@
g_free(vd);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = "calypsomodem",
.probe = calypso_voicecall_probe,
.remove = calypso_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/cdmamodem/connman.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -323,7 +322,7 @@
g_free(cd);
}
-static struct ofono_cdma_connman_driver driver = {
+static const struct ofono_cdma_connman_driver driver = {
.name = "cdmamodem",
.probe = cdma_connman_probe,
.remove = cdma_connman_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/cdmamodem/devinfo.c
^
|
@@ -153,7 +153,7 @@
ofono_devinfo_set_data(info, NULL);
}
-static struct ofono_devinfo_driver driver = {
+static const struct ofono_devinfo_driver driver = {
.name = "cdmamodem",
.probe = cdma_devinfo_probe,
.remove = cdma_devinfo_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/cdmamodem/voicecall.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -143,7 +142,7 @@
g_free(vd);
}
-static struct ofono_cdma_voicecall_driver driver = {
+static const struct ofono_cdma_voicecall_driver driver = {
.name = "cdmamodem",
.probe = cdma_voicecall_probe,
.remove = cdma_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/dunmodem/gprs.c
^
|
@@ -73,7 +73,7 @@
CALLBACK_WITH_SUCCESS(cb, 1, data);
}
-static struct ofono_gprs_driver driver = {
+static const struct ofono_gprs_driver driver = {
.name = "dunmodem",
.probe = dun_gprs_probe,
.remove = dun_gprs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/dunmodem/network-registration.c
^
|
@@ -107,7 +107,7 @@
g_free(nd);
}
-static struct ofono_netreg_driver driver = {
+static const struct ofono_netreg_driver driver = {
.name = "dunmodem",
.probe = dun_netreg_probe,
.remove = dun_netreg_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/gemaltomodem/gemaltomodem.c
^
|
@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Vincent Cesson. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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
@@ -35,12 +36,14 @@
static int gemaltomodem_init(void)
{
gemalto_location_reporting_init();
+ gemalto_voicecall_init();
return 0;
}
static void gemaltomodem_exit(void)
{
+ gemalto_voicecall_exit();
gemalto_location_reporting_exit();
}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/gemaltomodem/gemaltomodem.h
^
|
@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Vincent Cesson. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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,3 +24,6 @@
extern void gemalto_location_reporting_init();
extern void gemalto_location_reporting_exit();
+
+extern void gemalto_voicecall_init();
+extern void gemalto_voicecall_exit();
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/gemaltomodem/location-reporting.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -217,7 +216,7 @@
g_free(gd);
}
-static struct ofono_location_reporting_driver driver = {
+static const struct ofono_location_reporting_driver driver = {
.name = "gemaltomodem",
.type = OFONO_LOCATION_REPORTING_TYPE_NMEA,
.probe = gemalto_location_reporting_probe,
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/gemaltomodem/voicecall.c
^
|
@@ -0,0 +1,576 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
+ *
+ * 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 <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <errno.h>
+
+#include <glib.h>
+
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/voicecall.h>
+
+#include "gatchat.h"
+#include "gatresult.h"
+
+#include "common.h"
+
+#include "gemaltomodem.h"
+
+static const char *clcc_prefix[] = { "+CLCC:", NULL };
+static const char *none_prefix[] = { NULL };
+
+struct voicecall_data {
+ GAtChat *chat;
+ GSList *calls;
+ unsigned int local_release;
+ GSList *new_calls;
+};
+
+struct release_id_req {
+ struct ofono_voicecall *vc;
+ ofono_voicecall_cb_t cb;
+ void *data;
+ int id;
+};
+
+struct change_state_req {
+ struct ofono_voicecall *vc;
+ ofono_voicecall_cb_t cb;
+ void *data;
+ int affected_types;
+};
+
+static void generic_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct change_state_req *req = user_data;
+ struct voicecall_data *vd = ofono_voicecall_get_data(req->vc);
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (ok && req->affected_types) {
+ GSList *l;
+ struct ofono_call *call;
+
+ for (l = vd->calls; l; l = l->next) {
+ call = l->data;
+
+ if (req->affected_types & (1 << call->status))
+ vd->local_release |= (1 << call->id);
+ }
+ }
+
+ req->cb(&error, req->data);
+}
+
+static void gemalto_call_common(const char *cmd, struct ofono_voicecall *vc,
+ GAtResultFunc result_cb,
+ unsigned int affected_types,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+ struct change_state_req *req = g_new0(struct change_state_req, 1);
+
+ req->vc = vc;
+ req->cb = cb;
+ req->data = data;
+ req->affected_types = affected_types;
+
+ if (g_at_chat_send(vd->chat, cmd, none_prefix,
+ result_cb, req, g_free) > 0)
+ return;
+
+ g_free(req);
+ CALLBACK_WITH_FAILURE(cb, data);
+}
+
+static void gemalto_answer(struct ofono_voicecall *vc,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ gemalto_call_common("ATA", vc, generic_cb, 0, cb, data);
+}
+
+static void gemalto_hangup_all(struct ofono_voicecall *vc,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ unsigned int affected = (1 << CALL_STATUS_INCOMING) |
+ (1 << CALL_STATUS_DIALING) |
+ (1 << CALL_STATUS_ALERTING) |
+ (1 << CALL_STATUS_WAITING) |
+ (1 << CALL_STATUS_HELD) |
+ (1 << CALL_STATUS_ACTIVE);
+
+ /* Hangup all calls */
+ gemalto_call_common("AT+CHUP", vc, generic_cb, affected, cb, data);
+}
+
+static void gemalto_hangup(struct ofono_voicecall *vc,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ unsigned int affected = (1 << CALL_STATUS_ACTIVE);
+
+ /* Hangup current active call */
+ gemalto_call_common("AT+CHLD=1", vc, generic_cb, affected, cb, data);
+}
+
+static void gemalto_hold_all_active(struct ofono_voicecall *vc,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ unsigned int affected = (1 << CALL_STATUS_ACTIVE);
+ gemalto_call_common("AT+CHLD=2", vc, generic_cb, affected, cb, data);
+}
+
+static void gemalto_release_all_held(struct ofono_voicecall *vc,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ unsigned int affected = (1 << CALL_STATUS_INCOMING) |
+ (1 << CALL_STATUS_WAITING);
+
+ gemalto_call_common("AT+CHLD=0", vc, generic_cb, affected, cb, data);
+}
+
+static void gemalto_set_udub(struct ofono_voicecall *vc,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ unsigned int affected = (1 << CALL_STATUS_INCOMING) |
+ (1 << CALL_STATUS_WAITING);
+
+ gemalto_call_common("AT+CHLD=0", vc, generic_cb, affected, cb, data);
+}
+
+static void gemalto_release_all_active(struct ofono_voicecall *vc,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ unsigned int affected = (1 << CALL_STATUS_ACTIVE);
+
+ gemalto_call_common("AT+CHLD=1", vc, generic_cb, affected, cb, data);
+}
+
+static void release_id_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct release_id_req *req = user_data;
+ struct voicecall_data *vd = ofono_voicecall_get_data(req->vc);
+ struct ofono_error error;
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (ok)
+ vd->local_release = 1 << req->id;
+
+ req->cb(&error, req->data);
+}
+
+static void gemalto_release_specific(struct ofono_voicecall *vc, int id,
+ ofono_voicecall_cb_t cb, void *data)
+{
+ struct voicecall_data *vd = ofono_voicecall_get_data(vc);
+ struct release_id_req *req = g_new0(struct release_id_req, 1);
+ char buf[32];
+
+ req->vc = vc;
+ req->cb = cb;
+ req->data = data;
+ req->id = id;
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/call-volume.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -218,7 +217,7 @@
g_free(vd);
}
-static struct ofono_call_volume_driver driver = {
+static const struct ofono_call_volume_driver driver = {
.name = "hfpmodem",
.probe = hfp_call_volume_probe,
.remove = hfp_call_volume_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/devinfo.c
^
|
@@ -91,7 +91,7 @@
g_free(dd);
}
-static struct ofono_devinfo_driver driver = {
+static const struct ofono_devinfo_driver driver = {
.name = "hfpmodem",
.probe = hfp_devinfo_probe,
.remove = hfp_devinfo_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/handsfree.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -411,7 +410,7 @@
CALLBACK_WITH_FAILURE(cb, data);
}
-static struct ofono_handsfree_driver driver = {
+static const struct ofono_handsfree_driver driver = {
.name = "hfpmodem",
.probe = hfp_handsfree_probe,
.remove = hfp_handsfree_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/network-registration.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -343,7 +342,7 @@
g_free(nd);
}
-static struct ofono_netreg_driver driver = {
+static const struct ofono_netreg_driver driver = {
.name = "hfpmodem",
.probe = hfp_netreg_probe,
.remove = hfp_netreg_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/siri.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -196,7 +195,7 @@
CALLBACK_WITH_FAILURE(cb, NULL);
}
-static struct ofono_siri_driver driver = {
+static const struct ofono_siri_driver driver = {
.name = "hfpmodem",
.probe = hfp_siri_probe,
.remove = hfp_siri_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/slc.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <errno.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hfpmodem/voicecall.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -1303,7 +1302,7 @@
g_free(vd);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = "hfpmodem",
.probe = hfp_voicecall_probe,
.remove = hfp_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hsomodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -379,7 +378,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "hsomodem",
.probe = hso_gprs_context_probe,
.remove = hso_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/hsomodem/radio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -199,7 +198,7 @@
g_free(rsd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "hsomodem",
.probe = hso_radio_settings_probe,
.remove = hso_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/audio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -113,7 +112,7 @@
g_free(asd);
}
-static struct ofono_audio_settings_driver driver = {
+static const struct ofono_audio_settings_driver driver = {
.name = "huaweimodem",
.probe = huawei_audio_settings_probe,
.remove = huawei_audio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/cdma-netreg.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <glib.h>
#include <errno.h>
@@ -210,7 +209,7 @@
g_at_chat_unref(chat);
}
-static struct ofono_cdma_netreg_driver driver = {
+static const struct ofono_cdma_netreg_driver driver = {
.name = "huaweimodem",
.probe = huawei_cdma_netreg_probe,
.remove = huawei_cdma_netreg_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -339,7 +338,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "huaweimodem",
.probe = huawei_gprs_context_probe,
.remove = huawei_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/radio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -569,7 +568,7 @@
g_free(rsd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "huaweimodem",
.probe = huawei_radio_settings_probe,
.remove = huawei_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/ussd.c
^
|
@@ -204,7 +204,7 @@
g_free(data);
}
-static struct ofono_ussd_driver driver = {
+static const struct ofono_ussd_driver driver = {
.name = "huaweimodem",
.probe = huawei_ussd_probe,
.remove = huawei_ussd_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/huaweimodem/voicecall.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -497,7 +496,7 @@
g_free(vd);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = "huaweimodem",
.probe = huawei_voicecall_probe,
.remove = huawei_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/iceramodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -403,7 +402,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "iceramodem",
.probe = icera_gprs_context_probe,
.remove = icera_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/iceramodem/radio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -212,7 +211,7 @@
g_free(rsd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "iceramodem",
.probe = icera_radio_settings_probe,
.remove = icera_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/audio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -382,7 +381,7 @@
g_free(asd);
}
-static struct ofono_audio_settings_driver driver = {
+static const struct ofono_audio_settings_driver driver = {
.name = "ifxmodem",
.probe = ifx_audio_settings_probe,
.remove = ifx_audio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/ctm.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -167,7 +166,7 @@
g_free(ctmd);
}
-static struct ofono_ctm_driver driver = {
+static const struct ofono_ctm_driver driver = {
.name = "ifxmodem",
.probe = ifx_ctm_probe,
.remove = ifx_ctm_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -466,8 +465,14 @@
gcd->active_context = ctx->cid;
gcd->cb = cb;
gcd->cb_data = data;
- memcpy(gcd->username, ctx->username, sizeof(ctx->username));
- memcpy(gcd->password, ctx->password, sizeof(ctx->password));
+
+ if (ctx->auth_method == OFONO_GPRS_AUTH_METHOD_NONE) {
+ memset(gcd->username, 0, sizeof(gcd->username));
+ memset(gcd->password, 0, sizeof(gcd->password));
+ } else {
+ memcpy(gcd->username, ctx->username, sizeof(ctx->username));
+ memcpy(gcd->password, ctx->password, sizeof(ctx->password));
+ }
gcd->state = STATE_ENABLING;
gcd->proto = ctx->proto;
@@ -514,6 +519,9 @@
if (gcd->vendor != OFONO_VENDOR_XMM)
g_at_chat_resume(gcd->chat);
+ if (!gcd->cb)
+ return;
+
CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
}
@@ -652,7 +660,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "ifxmodem",
.probe = ifx_gprs_context_probe,
.remove = ifx_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/radio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -201,7 +200,7 @@
g_free(rsd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "ifxmodem",
.probe = ifx_radio_settings_probe,
.remove = ifx_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/stk.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -307,7 +306,7 @@
g_free(sd);
}
-static struct ofono_stk_driver driver = {
+static const struct ofono_stk_driver driver = {
.name = "ifxmodem",
.probe = ifx_stk_probe,
.remove = ifx_stk_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ifxmodem/voicecall.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -1019,7 +1018,7 @@
g_free(vd);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = "ifxmodem",
.probe = ifx_voicecall_probe,
.remove = ifx_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/audio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -117,7 +116,7 @@
g_free(asd);
}
-static struct ofono_audio_settings_driver driver = {
+static const struct ofono_audio_settings_driver driver = {
.name = "isimodem",
.probe = isi_audio_settings_probe,
.remove = isi_audio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/call-barring.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -429,7 +428,7 @@
g_free(data);
}
-static struct ofono_call_barring_driver driver = {
+static const struct ofono_call_barring_driver driver = {
.name = "isimodem",
.probe = isi_call_barring_probe,
.remove = isi_call_barring_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/call-forwarding.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -457,7 +456,7 @@
g_free(data);
}
-static struct ofono_call_forwarding_driver driver = {
+static const struct ofono_call_forwarding_driver driver = {
.name = "isimodem",
.probe = isi_call_forwarding_probe,
.remove = isi_call_forwarding_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/call-meter.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -118,7 +117,7 @@
g_free(data);
}
-static struct ofono_call_meter_driver driver = {
+static const struct ofono_call_meter_driver driver = {
.name = "isimodem",
.probe = isi_call_meter_probe,
.remove = isi_call_meter_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/call-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -405,7 +404,7 @@
g_free(data);
}
-static struct ofono_call_settings_driver driver = {
+static const struct ofono_call_settings_driver driver = {
.name = "isimodem",
.probe = isi_call_settings_probe,
.remove = isi_call_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/cbs.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -227,7 +226,7 @@
g_free(cd);
}
-static struct ofono_cbs_driver driver = {
+static const struct ofono_cbs_driver driver = {
.name = "isimodem",
.probe = isi_cbs_probe,
.remove = isi_cbs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/debug.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/devinfo.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -252,7 +251,7 @@
g_free(data);
}
-static struct ofono_devinfo_driver driver = {
+static const struct ofono_devinfo_driver driver = {
.name = "isimodem",
.probe = isi_devinfo_probe,
.remove = isi_devinfo_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -538,11 +537,15 @@
strncpy(cd->apn, ctx->apn, GPDS_MAX_APN_STRING_LENGTH);
cd->apn[GPDS_MAX_APN_STRING_LENGTH] = '\0';
- strncpy(cd->username, ctx->username, GPDS_MAX_USERNAME_LENGTH);
- cd->username[GPDS_MAX_USERNAME_LENGTH] = '\0';
-
- strncpy(cd->password, ctx->password, GPDS_MAX_PASSWORD_LENGTH);
- cd->username[GPDS_MAX_PASSWORD_LENGTH] = '\0';
+ if (ctx->auth_method == OFONO_GPRS_AUTH_METHOD_NONE) {
+ memset(cd->username, 0, sizeof(cd->username));
+ memset(cd->password, 0, sizeof(cd->password));
+ } else {
+ strncpy(cd->username, ctx->username, GPDS_MAX_USERNAME_LENGTH);
+ cd->username[GPDS_MAX_USERNAME_LENGTH] = '\0';
+ strncpy(cd->password, ctx->password, GPDS_MAX_PASSWORD_LENGTH);
+ cd->username[GPDS_MAX_PASSWORD_LENGTH] = '\0';
+ }
cd->pep = g_isi_pep_create(cd->idx, NULL, NULL);
if (cd->pep == NULL)
@@ -659,7 +662,7 @@
g_free(cd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "isimodem",
.probe = isi_gprs_context_probe,
.remove = isi_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/gprs.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -490,7 +489,7 @@
g_free(cbd);
}
-static struct ofono_gprs_driver driver = {
+static const struct ofono_gprs_driver driver = {
.name = "isimodem",
.probe = isi_gprs_probe,
.remove = isi_gprs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/network-registration.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1165,7 +1164,7 @@
g_free(data);
}
-static struct ofono_netreg_driver isimodem = {
+static const struct ofono_netreg_driver isimodem = {
.name = "isimodem",
.probe = isi_netreg_probe,
.remove = isi_netreg_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/phonebook.c
^
|
@@ -340,7 +340,7 @@
g_free(data);
}
-static struct ofono_phonebook_driver driver = {
+static const struct ofono_phonebook_driver driver = {
.name = "isimodem",
.probe = isi_phonebook_probe,
.remove = isi_phonebook_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/radio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -365,7 +364,7 @@
g_free(rd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "isimodem",
.probe = isi_radio_settings_probe,
.remove = isi_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/sim.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -969,7 +968,7 @@
g_free(data);
}
-static struct ofono_sim_driver driver = {
+static const struct ofono_sim_driver driver = {
.name = "isimodem",
.probe = isi_sim_probe,
.remove = isi_sim_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/sms.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1121,7 +1120,7 @@
g_free(sd);
}
-static struct ofono_sms_driver driver = {
+static const struct ofono_sms_driver driver = {
.name = "isimodem",
.probe = isi_sms_probe,
.remove = isi_sms_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/uicc-util.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/uicc.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1651,7 +1650,7 @@
g_free(data);
}
-static struct ofono_sim_driver driver = {
+static const struct ofono_sim_driver driver = {
.name = "wgmodem2.5",
.probe = uicc_sim_probe,
.remove = uicc_sim_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/ussd.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -276,7 +275,7 @@
g_free(data);
}
-static struct ofono_ussd_driver driver = {
+static const struct ofono_ussd_driver driver = {
.name = "isimodem",
.probe = isi_ussd_probe,
.remove = isi_ussd_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/isimodem/voicecall.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1935,7 +1934,7 @@
g_free(data);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = "isimodem",
.probe = isi_probe,
.remove = isi_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/devinfo.c
^
|
@@ -88,7 +88,7 @@
l_free(dd);
}
-static struct ofono_devinfo_driver driver = {
+static const struct ofono_devinfo_driver driver = {
.name = "mbim",
.probe = mbim_devinfo_probe,
.remove = mbim_devinfo_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdint.h>
#include <stdbool.h>
#include <errno.h>
@@ -75,9 +74,11 @@
return 2; /* MBIMAuthProtocolChap */
case OFONO_GPRS_AUTH_METHOD_PAP:
return 1; /* MBIMAuthProtocolPap */
+ case OFONO_GPRS_AUTH_METHOD_NONE:
+ return 0; /* MBIMAUthProtocolNone */
}
- return 0;
+ return 0; /* MBIMAUthProtocolNone */
}
static void mbim_deactivate_cb(struct mbim_message *message, void *user)
@@ -345,6 +346,8 @@
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct mbim_message *message;
+ const char *username = NULL;
+ const char *password = NULL;
DBG("cid %u", ctx->cid);
@@ -354,6 +357,12 @@
gcd->active_context = ctx->cid;
gcd->proto = ctx->proto;
+ if (ctx->auth_method != OFONO_GPRS_AUTH_METHOD_NONE && ctx->username[0])
+ username = ctx->username;
+
+ if (ctx->auth_method != OFONO_GPRS_AUTH_METHOD_NONE && ctx->password[0])
+ password = ctx->password;
+
message = mbim_message_new(mbim_uuid_basic_connect,
MBIM_CID_CONNECT,
MBIM_COMMAND_TYPE_SET);
@@ -361,8 +370,8 @@
ctx->cid,
1, /* MBIMActivationCommandActivate */
ctx->apn,
- ctx->username[0] ? ctx->username : NULL,
- ctx->password[0] ? ctx->password : NULL,
+ username,
+ password,
0, /*MBIMCompressionNone */
auth_method_to_auth_protocol(ctx->auth_method),
proto_to_context_ip_type(ctx->proto),
@@ -444,7 +453,7 @@
l_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "mbim",
.probe = mbim_gprs_context_probe,
.remove = mbim_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/gprs.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdint.h>
#include <stdbool.h>
#include <inttypes.h>
@@ -280,7 +279,7 @@
l_free(gd);
}
-static struct ofono_gprs_driver driver = {
+static const struct ofono_gprs_driver driver = {
.name = "mbim",
.probe = mbim_gprs_probe,
.remove = mbim_gprs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/mbim-message.c
^
|
@@ -23,6 +23,7 @@
#include <config.h>
#endif
+#include <stdlib.h>
#include <sys/uio.h>
#include <linux/types.h>
@@ -197,7 +198,7 @@
if (L_CPU_TO_LE16(0x8000) != 0x8000) {
uint16_t *le = (uint16_t *) buf;
- for (i = 0; i < len; i+= 2)
+ for (i = 0; i < len / 2; i++)
le[i] = __builtin_bswap16(le[i]);
}
@@ -1131,7 +1132,7 @@
if (L_CPU_TO_LE16(0x8000) != 0x8000) {
size_t i;
- for (i = 0; i < len - 2; i += 2)
+ for (i = 0; i < len / 2; i++)
utf16[i] = __builtin_bswap16(utf16[i]);
}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/mbim.c
^
|
@@ -487,7 +487,7 @@
written = TEMP_FAILURE_RETRY(write(fd, buf, pos));
- l_info("n_iov: %lu, %lu", n_iov + 1, (size_t) written);
+ l_info("n_iov: %zu, %zu", n_iov + 1, (size_t) written);
if (written < 0)
return false;
@@ -646,8 +646,8 @@
l_info("hdr->len: %u", L_LE32_TO_CPU(hdr->len));
l_info("header_size: %u", header_size);
- l_info("header_offset: %lu", device->header_offset);
- l_info("segment_bytes_remaining: %lu", device->segment_bytes_remaining);
+ l_info("header_offset: %zu", device->header_offset);
+ l_info("segment_bytes_remaining: %zu", device->segment_bytes_remaining);
iov[n_iov].iov_base = device->segment + L_LE32_TO_CPU(hdr->len) -
device->header_offset -
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/network-registration.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
@@ -395,7 +394,7 @@
l_free(nd);
}
-static struct ofono_netreg_driver driver = {
+static const struct ofono_netreg_driver driver = {
.name = "mbim",
.probe = mbim_netreg_probe,
.remove = mbim_netreg_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/sim.c
^
|
@@ -509,7 +509,7 @@
l_free(sd);
}
-static struct ofono_sim_driver driver = {
+static const struct ofono_sim_driver driver = {
.name = "mbim",
.probe = mbim_sim_probe,
.remove = mbim_sim_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbimmodem/sms.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <errno.h>
#include <stdint.h>
@@ -496,7 +495,7 @@
l_free(sd);
}
-static struct ofono_sms_driver driver = {
+static const struct ofono_sms_driver driver = {
.name = "mbim",
.probe = mbim_sms_probe,
.remove = mbim_sms_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbmmodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -511,7 +510,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "mbmmodem",
.probe = mbm_gprs_context_probe,
.remove = mbm_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbmmodem/location-reporting.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -231,7 +230,7 @@
g_free(gd);
}
-static struct ofono_location_reporting_driver driver = {
+static const struct ofono_location_reporting_driver driver = {
.name = "mbmmodem",
.type = OFONO_LOCATION_REPORTING_TYPE_NMEA,
.probe = mbm_location_reporting_probe,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/mbmmodem/stk.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -262,7 +261,7 @@
g_free(sd);
}
-static struct ofono_stk_driver driver = {
+static const struct ofono_stk_driver driver = {
.name = "mbmmodem",
.probe = mbm_stk_probe,
.remove = mbm_stk_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/nwmodem/radio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -195,7 +194,7 @@
g_free(rsd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "nwmodem",
.probe = nw_radio_settings_probe,
.remove = nw_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/devinfo.c
^
|
@@ -208,7 +208,7 @@
g_free(data);
}
-static struct ofono_devinfo_driver driver = {
+static const struct ofono_devinfo_driver driver = {
.name = "qmimodem",
.probe = qmi_devinfo_probe,
.remove = qmi_devinfo_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/gprs-context.c
^
|
@@ -88,6 +88,7 @@
char* straddr;
char* apn;
const char *dns[3] = { NULL, NULL, NULL };
+ char dns_buf[2][INET_ADDRSTRLEN];
DBG("");
@@ -131,14 +132,14 @@
if (qmi_result_get_uint32(result,
QMI_WDS_RESULT_PRIMARY_DNS, &ip_addr)) {
addr.s_addr = htonl(ip_addr);
- dns[0] = inet_ntoa(addr);
+ dns[0] = inet_ntop(AF_INET, &addr, dns_buf[0], sizeof(dns_buf[0]));
DBG("Primary DNS: %s", dns[0]);
}
if (qmi_result_get_uint32(result,
QMI_WDS_RESULT_SECONDARY_DNS, &ip_addr)) {
addr.s_addr = htonl(ip_addr);
- dns[1] = inet_ntoa(addr);
+ dns[1] = inet_ntop(AF_INET, &addr, dns_buf[1], sizeof(dns_buf[1]));
DBG("Secondary DNS: %s", dns[1]);
}
@@ -230,6 +231,20 @@
g_free(cbd);
}
+static uint8_t auth_method_to_qmi_auth(enum ofono_gprs_auth_method method)
+{
+ switch (method) {
+ case OFONO_GPRS_AUTH_METHOD_CHAP:
+ return QMI_WDS_AUTHENTICATION_CHAP;
+ case OFONO_GPRS_AUTH_METHOD_PAP:
+ return QMI_WDS_AUTHENTICATION_PAP;
+ case OFONO_GPRS_AUTH_METHOD_NONE:
+ return QMI_WDS_AUTHENTICATION_NONE;
+ }
+
+ return QMI_WDS_AUTHENTICATION_NONE;
+}
+
static void qmi_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
ofono_gprs_context_cb_t cb, void *user_data)
@@ -266,26 +281,16 @@
qmi_param_append_uint8(param, QMI_WDS_PARAM_IP_FAMILY, ip_family);
- switch (ctx->auth_method) {
- case OFONO_GPRS_AUTH_METHOD_CHAP:
- auth = QMI_WDS_AUTHENTICATION_CHAP;
- break;
- case OFONO_GPRS_AUTH_METHOD_PAP:
- auth = QMI_WDS_AUTHENTICATION_PAP;
- break;
- default:
- auth = QMI_WDS_AUTHENTICATION_NONE;
- break;
- }
+ auth = auth_method_to_qmi_auth(ctx->auth_method);
qmi_param_append_uint8(param, QMI_WDS_PARAM_AUTHENTICATION_PREFERENCE,
auth);
- if (ctx->username[0] != '\0')
+ if (auth != QMI_WDS_AUTHENTICATION_NONE && ctx->username[0] != '\0')
qmi_param_append(param, QMI_WDS_PARAM_USERNAME,
strlen(ctx->username), ctx->username);
- if (ctx->password[0] != '\0')
+ if (auth != QMI_WDS_AUTHENTICATION_NONE && ctx->password[0] != '\0')
qmi_param_append(param, QMI_WDS_PARAM_PASSWORD,
strlen(ctx->password), ctx->password);
@@ -487,7 +492,7 @@
g_free(data);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "qmimodem",
.probe = qmi_gprs_context_probe,
.remove = qmi_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/gprs.c
^
|
@@ -408,7 +408,7 @@
g_free(data);
}
-static struct ofono_gprs_driver driver = {
+static const struct ofono_gprs_driver driver = {
.name = "qmimodem",
.probe = qmi_gprs_probe,
.remove = qmi_gprs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/location-reporting.c
^
|
@@ -278,7 +278,7 @@
g_free(data);
}
-static struct ofono_location_reporting_driver driver = {
+static const struct ofono_location_reporting_driver driver = {
.name = "qmimodem",
.type = OFONO_LOCATION_REPORTING_TYPE_NMEA,
.probe = qmi_location_reporting_probe,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/lte.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -165,7 +164,7 @@
qmi_param_free(param);
error:
- ofono_error("Failed to reset profile %hhd", index);
+ ofono_error("Failed to reset default profile");
ofono_lte_remove(lte);
}
@@ -247,7 +246,7 @@
g_free(ldd);
}
-static struct ofono_lte_driver driver = {
+static const struct ofono_lte_driver driver = {
.name = "qmimodem",
.probe = qmimodem_lte_probe,
.remove = qmimodem_lte_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/netmon.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
@@ -268,7 +267,7 @@
g_free(nmd);
}
-static struct ofono_netmon_driver driver = {
+static const struct ofono_netmon_driver driver = {
.name = "qmimodem",
.probe = qmi_netmon_probe,
.remove = qmi_netmon_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/network-registration.c
^
|
@@ -637,7 +637,7 @@
g_free(data);
}
-static struct ofono_netreg_driver driver = {
+static const struct ofono_netreg_driver driver = {
.name = "qmimodem",
.probe = qmi_netreg_probe,
.remove = qmi_netreg_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/radio-settings.c
^
|
@@ -287,7 +287,7 @@
g_free(data);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "qmimodem",
.probe = qmi_radio_settings_probe,
.remove = qmi_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/sim-legacy.c
^
|
@@ -379,7 +379,7 @@
g_free(data);
}
-static struct ofono_sim_driver driver = {
+static const struct ofono_sim_driver driver = {
.name = "qmimodem-legacy",
.probe = qmi_sim_probe,
.remove = qmi_sim_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/sim.c
^
|
@@ -911,7 +911,7 @@
g_free(data);
}
-static struct ofono_sim_driver driver = {
+static const struct ofono_sim_driver driver = {
.name = "qmimodem",
.probe = qmi_sim_probe,
.remove = qmi_sim_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/sms.c
^
|
@@ -571,7 +571,7 @@
g_free(data);
}
-static struct ofono_sms_driver driver = {
+static const struct ofono_sms_driver driver = {
.name = "qmimodem",
.probe = qmi_sms_probe,
.remove = qmi_sms_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/ussd.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <glib.h>
@@ -270,7 +269,7 @@
CALLBACK_WITH_FAILURE(cb, data);
}
-static struct ofono_ussd_driver driver = {
+static const struct ofono_ussd_driver driver = {
.name = "qmimodem",
.probe = qmi_ussd_probe,
.remove = qmi_ussd_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/qmimodem/voicecall.c
^
|
@@ -95,7 +95,7 @@
g_free(data);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = "qmimodem",
.probe = qmi_voicecall_probe,
.remove = qmi_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/call-barring.c
^
|
@@ -270,7 +270,7 @@
g_free(data);
}
-static struct ofono_call_barring_driver driver = {
+static const struct ofono_call_barring_driver driver = {
.name = "rilmodem",
.probe = ril_call_barring_probe,
.remove = ril_call_barring_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/call-forwarding.c
^
|
@@ -25,7 +25,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -377,7 +376,7 @@
g_free(data);
}
-static struct ofono_call_forwarding_driver driver = {
+static const struct ofono_call_forwarding_driver driver = {
.name = RILMODEM,
.probe = ril_call_forwarding_probe,
.remove = ril_call_forwarding_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/call-settings.c
^
|
@@ -26,7 +26,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -320,7 +319,7 @@
g_free(sd);
}
-static struct ofono_call_settings_driver driver = {
+static const struct ofono_call_settings_driver driver = {
.name = RILMODEM,
.probe = ril_call_settings_probe,
.remove = ril_call_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/call-volume.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <errno.h>
@@ -170,7 +169,7 @@
g_free(cvd);
}
-static struct ofono_call_volume_driver driver = {
+static const struct ofono_call_volume_driver driver = {
.name = RILMODEM,
.probe = ril_call_volume_probe,
.remove = ril_call_volume_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/cbs.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <ctype.h>
@@ -194,7 +193,7 @@
g_free(data);
}
-static struct ofono_cbs_driver driver = {
+static const struct ofono_cbs_driver driver = {
.name = RILMODEM,
.probe = ril_cbs_probe,
.remove = ril_cbs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/devinfo.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -212,7 +211,7 @@
g_ril_unref(ril);
}
-static struct ofono_devinfo_driver driver = {
+static const struct ofono_devinfo_driver driver = {
.name = RILMODEM,
.probe = ril_devinfo_probe,
.remove = ril_devinfo_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/gprs-context.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -598,9 +597,12 @@
* We do the same as in $AOSP/frameworks/opt/telephony/src/java/com/
* android/internal/telephony/dataconnection/DataConnection.java,
* onConnect(), and use authentication or not depending on whether
- * the user field is empty or not.
+ * the user field is empty or not,
+ * on top of the verification for the authentication method.
*/
- if (ctx->username[0] != '\0')
+
+ if (ctx->auth_method != OFONO_GPRS_AUTH_METHOD_NONE &&
+ ctx->username[0] != '\0')
auth_type = RIL_AUTH_BOTH;
else
auth_type = RIL_AUTH_NONE;
@@ -615,8 +617,10 @@
parcel_w_string(&rilp, buf);
g_ril_append_print_buf(gcd->ril, "(%d,%s,%s,%s,%s,%d,%s,%u)",
- tech, profile, ctx->apn, ctx->username,
- ctx->password, auth_type,
+ tech, profile, ctx->apn,
+ auth_type == RIL_AUTH_NONE ? "" : ctx->username,
+ auth_type == RIL_AUTH_NONE ? "" : ctx->password,
+ auth_type,
ril_util_gprs_proto_to_ril_string(ctx->proto),
ctx->cid);
} else
@@ -852,7 +856,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = RILMODEM,
.probe = ril_gprs_context_probe,
.remove = ril_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/gprs.c
^
|
@@ -26,7 +26,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -515,7 +514,7 @@
g_free(gd);
}
-static struct ofono_gprs_driver driver = {
+static const struct ofono_gprs_driver driver = {
.name = RILMODEM,
.probe = ril_gprs_probe,
.remove = ril_gprs_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/lte.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -141,7 +140,7 @@
g_free(ld);
}
-static struct ofono_lte_driver driver = {
+static const struct ofono_lte_driver driver = {
.name = RILMODEM,
.probe = ril_lte_probe,
.remove = ril_lte_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/netmon.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
@@ -339,7 +338,7 @@
CALLBACK_WITH_FAILURE(cb, cbd->data);
}
-static struct ofono_netmon_driver driver = {
+static const struct ofono_netmon_driver driver = {
.name = RILMODEM,
.probe = ril_netmon_probe,
.remove = ril_netmon_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/network-registration.c
^
|
@@ -26,7 +26,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -834,7 +833,7 @@
g_free(nd);
}
-static struct ofono_netreg_driver driver = {
+static const struct ofono_netreg_driver driver = {
.name = RILMODEM,
.probe = ril_netreg_probe,
.remove = ril_netreg_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/phonebook.c
^
|
@@ -27,7 +27,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -1037,7 +1036,7 @@
g_free(pbd);
}
-static struct ofono_phonebook_driver driver = {
+static const struct ofono_phonebook_driver driver = {
.name = RILMODEM,
.probe = ril_phonebook_probe,
.remove = ril_phonebook_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/radio-settings.c
^
|
@@ -25,7 +25,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -453,7 +452,7 @@
g_free(rd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = RILMODEM,
.probe = ril_radio_settings_probe,
.remove = ril_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/sim.c
^
|
@@ -25,7 +25,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -1483,7 +1482,7 @@
g_free(sd);
}
-static struct ofono_sim_driver driver = {
+static const struct ofono_sim_driver driver = {
.name = RILMODEM,
.probe = ril_sim_probe,
.remove = ril_sim_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/sms.c
^
|
@@ -25,7 +25,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
@@ -503,7 +502,7 @@
ofono_sms_set_data(sms, NULL);
}
-static struct ofono_sms_driver driver = {
+static const struct ofono_sms_driver driver = {
.name = RILMODEM,
.probe = ril_sms_probe,
.sca_query = ril_csca_query,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/stk.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
@@ -238,7 +237,7 @@
g_free(data);
}
-static struct ofono_stk_driver driver = {
+static const struct ofono_stk_driver driver = {
.name = RILMODEM,
.probe = ril_stk_probe,
.remove = ril_stk_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/ussd.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -242,7 +241,7 @@
g_free(ud);
}
-static struct ofono_ussd_driver driver = {
+static const struct ofono_ussd_driver driver = {
.name = RILMODEM,
.probe = ril_ussd_probe,
.remove = ril_ussd_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/rilmodem/voicecall.c
^
|
@@ -25,7 +25,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -856,7 +855,7 @@
g_free(vd);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = RILMODEM,
.probe = ril_voicecall_probe,
.remove = ril_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/speedupmodem/ussd.c
^
|
@@ -204,7 +204,7 @@
g_free(data);
}
-static struct ofono_ussd_driver driver = {
+static const struct ofono_ussd_driver driver = {
.name = "speedupmodem",
.probe = speedup_ussd_probe,
.remove = speedup_ussd_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/stemodem/gprs-context.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -427,7 +426,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "stemodem",
.probe = ste_gprs_context_probe,
.remove = ste_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/stemodem/radio-settings.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -223,7 +222,7 @@
g_free(rsd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "stemodem",
.probe = ste_radio_settings_probe,
.remove = ste_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/stemodem/voicecall.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -582,7 +581,7 @@
g_free(vd);
}
-static struct ofono_voicecall_driver driver = {
+static const struct ofono_voicecall_driver driver = {
.name = "stemodem",
.probe = ste_voicecall_probe,
.remove = ste_voicecall_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/swmodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -245,7 +244,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "swmodem",
.probe = sw_gprs_context_probe,
.remove = sw_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/telitmodem/gprs-context-ncm.c
^
|
@@ -19,7 +19,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -277,7 +276,8 @@
return;
}
- if (gcd->username[0] && gcd->password[0])
+ if (gcd->auth_method != AUTH_METHOD_NONE &&
+ gcd->username[0] && gcd->password[0])
sprintf(buf, "AT#PDPAUTH=%u,%u,\"%s\",\"%s\"",
gcd->active_context, gcd->auth_method,
gcd->username, gcd->password);
@@ -320,7 +320,7 @@
gcd->state = STATE_ENABLING;
gcd->proto = ctx->proto;
- /* We only support CHAP and PAP */
+ /* We support CHAP, PAP and NONE */
switch (ctx->auth_method) {
case OFONO_GPRS_AUTH_METHOD_CHAP:
gcd->auth_method = AUTH_METHOD_CHAP;
@@ -328,6 +328,11 @@
case OFONO_GPRS_AUTH_METHOD_PAP:
gcd->auth_method = AUTH_METHOD_PAP;
break;
+ case OFONO_GPRS_AUTH_METHOD_NONE:
+ gcd->auth_method = AUTH_METHOD_NONE;
+ gcd->username[0] = 0;
+ gcd->password[0] = 0;
+ break;
default:
goto error;
}
@@ -463,7 +468,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "telitncmmodem",
.probe = telitncm_gprs_context_probe,
.remove = telitncm_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/telitmodem/location-reporting.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -295,7 +294,7 @@
g_free(gd);
}
-static struct ofono_location_reporting_driver driver = {
+static const struct ofono_location_reporting_driver driver = {
.name = "telitmodem",
.type = OFONO_LOCATION_REPORTING_TYPE_NMEA,
.probe = telit_location_reporting_probe,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ubloxmodem/gprs-context.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -315,9 +314,10 @@
case OFONO_GPRS_AUTH_METHOD_CHAP:
auth = 2;
break;
- default:
- ofono_error("Unsupported auth type %u", auth_method);
- return;
+ case OFONO_GPRS_AUTH_METHOD_NONE:
+ auth = 0;
+ username = password = "";
+ break;
}
snprintf(buf, sizeof(buf), "AT+UAUTHREQ=%u,%u,\"%s\",\"%s\"",
@@ -496,7 +496,7 @@
g_free(gcd);
}
-static struct ofono_gprs_context_driver driver = {
+static const struct ofono_gprs_context_driver driver = {
.name = "ubloxmodem",
.probe = ublox_gprs_context_probe,
.remove = ublox_gprs_context_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ubloxmodem/lte.c
^
|
@@ -22,7 +22,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -125,7 +124,7 @@
g_free(ldd);
}
-static struct ofono_lte_driver driver = {
+static const struct ofono_lte_driver driver = {
.name = UBLOXMODEM,
.probe = ublox_lte_probe,
.remove = ublox_lte_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ubloxmodem/netmon.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
@@ -336,7 +335,7 @@
g_free(nmd);
}
-static struct ofono_netmon_driver driver = {
+static const struct ofono_netmon_driver driver = {
.name = UBLOXMODEM,
.probe = ublox_netmon_probe,
.remove = ublox_netmon_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/ims.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@@ -235,7 +234,7 @@
g_free(idd);
}
-static struct ofono_ims_driver driver = {
+static const struct ofono_ims_driver driver = {
.name = "xmm7modem",
.probe = xmm_ims_probe,
.remove = xmm_ims_remove,
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/netmon.c
^
|
@@ -0,0 +1,263 @@
+/*
+ *
+ * oFono - Open Source Telephony
+ *
+ * Copyright (C) 2017 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 <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <errno.h>
+
+#include <glib.h>
+
+#include <ofono/log.h>
+#include <ofono/modem.h>
+#include <ofono/netreg.h>
+#include <ofono/netmon.h>
+
+#include "gatchat.h"
+#include "gatresult.h"
+
+#include "common.h"
+#include "xmm7modem.h"
+#include "drivers/atmodem/vendor.h"
+
+static const char *xmci_prefix[] = { "+XMCI:", NULL };
+
+struct netmon_driver_data {
+ GAtChat *chat;
+};
+
+enum xmci_ofono_type_info {
+ XMCI_GSM_SERV_CELL,
+ XMCI_GSM_NEIGH_CELL,
+ XMCI_UMTS_SERV_CELL,
+ XMCI_UMTS_NEIGH_CELL,
+ XMCI_LTE_SERV_CELL,
+ XMCI_LTE_NEIGH_CELL
+};
+
+/*
+ * Returns the appropriate radio access technology.
+ *
+ * If we can not resolve to a specific radio access technolgy
+ * we return OFONO_NETMON_CELL_TYPE_GSM by default.
+ */
+static int xmm7modem_map_radio_access_technology(int tech)
+{
+ switch (tech) {
+ case XMCI_GSM_SERV_CELL:
+ case XMCI_GSM_NEIGH_CELL:
+ return OFONO_NETMON_CELL_TYPE_GSM;
+ case XMCI_UMTS_SERV_CELL:
+ case XMCI_UMTS_NEIGH_CELL:
+ return OFONO_NETMON_CELL_TYPE_UMTS;
+ case XMCI_LTE_SERV_CELL:
+ case XMCI_LTE_NEIGH_CELL:
+ return OFONO_NETMON_CELL_TYPE_LTE;
+ }
+
+ return OFONO_NETMON_CELL_TYPE_GSM;
+}
+
+static void xmci_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct cb_data *cbd = user_data;
+ struct ofono_netmon *netmon = cbd->data;
+ ofono_netmon_cb_t cb = cbd->cb;
+ struct ofono_error error;
+ GAtResultIter iter;
+ int number;
+ int rxlev = -1;
+ int ber = -1;
+ int rscp = -1;
+ int rsrp = -1;
+ int ecn0 = -1;
+ int rsrq = -1;
+ int tech = -1;
+
+ DBG("ok %d", ok);
+
+ decode_at_error(&error, g_at_result_final_response(result));
+
+ if (!ok) {
+ cb(&error, cbd->data);
+ return;
+ }
+
+ g_at_result_iter_init(&iter, result);
+
+ while (g_at_result_iter_next(&iter, "+XMCI:")) {
+ if (!g_at_result_iter_next_number(&iter, &number))
+ break;
+
+ tech = xmm7modem_map_radio_access_technology(number);
+
+ switch (number) {
+ case XMCI_GSM_SERV_CELL:
+ /* skip <MCC>,<MNC>,<LAC>,<CI>,<BSIC> */
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+
+ g_at_result_iter_next_number(&iter, &number);
+ rxlev = number != 99 ? number : rxlev;
+
+ g_at_result_iter_next_number(&iter, &number);
+ ber = number != 99 ? number : ber;
+ break;
+ case XMCI_UMTS_SERV_CELL:
+ /*
+ * skip <MCC>,<MNC>,<LAC>,<CI><PSC>,<DLUARFNC>,
+ * <ULUARFCN>,<PATHLOSS>,<RSSI>
+ */
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+
+ g_at_result_iter_next_number(&iter, &number);
+ rscp = number != 255 ? number : rscp;
+
+ g_at_result_iter_next_number(&iter, &number);
+ ecn0 = number != 255 ? number : ecn0;
+ break;
+ case XMCI_LTE_SERV_CELL:
+ /*
+ * skip <MCC>,<MNC>,<TAC>,<CI>,<PCI>,<DLUARFNC>,
+ * <ULUARFCN>,<PATHLOSS_LTE>
+ */
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+ g_at_result_iter_skip_next(&iter);
+
+ g_at_result_iter_next_number(&iter, &number);
+ rsrq = number != 255 ? number : rsrq;
+
+ g_at_result_iter_next_number(&iter, &number);
+ rsrp = number != 255 ? number : rsrp;
+ break;
+ default:
+ break;
+ }
+
+ ofono_netmon_serving_cell_notify(netmon,
+ tech,
+ OFONO_NETMON_INFO_RXLEV, rxlev,
+ OFONO_NETMON_INFO_BER, ber,
+ OFONO_NETMON_INFO_RSCP, rscp,
+ OFONO_NETMON_INFO_ECN0, ecn0,
+ OFONO_NETMON_INFO_RSRQ, rsrq,
+ OFONO_NETMON_INFO_RSRP, rsrp,
+ OFONO_NETMON_INFO_INVALID);
+
+ CALLBACK_WITH_SUCCESS(cb, cbd->data);
+ break;
+ }
+}
+
+static void xmm7modem_netmon_request_update(struct ofono_netmon *netmon,
+ ofono_netmon_cb_t cb, void *data)
+{
+ struct netmon_driver_data *nmd = ofono_netmon_get_data(netmon);
+ struct cb_data *cbd = cb_data_new(cb, data);
+
+ DBG("xmm7modem netmon request update");
+
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/radio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -214,7 +213,7 @@
g_free(rsd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "xmm7modem",
.probe = xmm_radio_settings_probe,
.remove = xmm_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/xmm7modem.c
^
|
@@ -37,7 +37,7 @@
{
xmm_radio_settings_init();
xmm_ims_init();
-
+ xmm_netmon_init();
return 0;
}
@@ -45,6 +45,7 @@
{
xmm_radio_settings_exit();
xmm_ims_exit();
+ xmm_netmon_exit();
}
OFONO_PLUGIN_DEFINE(xmm7modem, "Intel xmm7xxx series modem driver",
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/xmm7modem/xmm7modem.h
^
|
@@ -28,3 +28,6 @@
extern void xmm_ims_init(void);
extern void xmm_ims_exit(void);
+
+extern void xmm_netmon_init(void);
+extern void xmm_netmon_exit(void);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/drivers/ztemodem/radio-settings.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
@@ -195,7 +194,7 @@
g_free(rsd);
}
-static struct ofono_radio_settings_driver driver = {
+static const struct ofono_radio_settings_driver driver = {
.name = "ztemodem",
.probe = zte_radio_settings_probe,
.remove = zte_radio_settings_remove,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gatchat/gatppp.c
^
|
@@ -615,7 +615,8 @@
gboolean g_at_ppp_set_auth_method(GAtPPP *ppp, GAtPPPAuthMethod method)
{
if (method != G_AT_PPP_AUTH_METHOD_CHAP &&
- method != G_AT_PPP_AUTH_METHOD_PAP)
+ method != G_AT_PPP_AUTH_METHOD_PAP &&
+ method != G_AT_PPP_AUTH_METHOD_NONE)
return FALSE;
ppp->auth_method = method;
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gatchat/gatppp.h
^
|
@@ -46,6 +46,7 @@
typedef enum _GAtPPPAuthMethod {
G_AT_PPP_AUTH_METHOD_CHAP,
G_AT_PPP_AUTH_METHOD_PAP,
+ G_AT_PPP_AUTH_METHOD_NONE,
} GAtPPPAuthMethod;
typedef void (*GAtPPPConnectFunc)(const char *iface, const char *local,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gatchat/ppp_lcp.c
^
|
@@ -279,6 +279,9 @@
*new_len = 4;
return RCR_NAK;
+
+ case G_AT_PPP_AUTH_METHOD_NONE:
+ return RCR_REJECT;
}
break;
}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gisi/client.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gisi/modem.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/gril/parcel.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/include/gprs-context.h
^
|
@@ -31,21 +31,6 @@
struct ofono_gprs_context;
struct ofono_modem;
-/*
- * ETSI 123.003, Section 9.1:
- * the APN has, after encoding as defined in the paragraph below, a maximum
- * length of 100 octets
- */
-#define OFONO_GPRS_MAX_APN_LENGTH 100
-#define OFONO_GPRS_MAX_USERNAME_LENGTH 63
-#define OFONO_GPRS_MAX_PASSWORD_LENGTH 255
-
-enum ofono_gprs_proto {
- OFONO_GPRS_PROTO_IP = 0,
- OFONO_GPRS_PROTO_IPV6,
- OFONO_GPRS_PROTO_IPV4V6,
-};
-
enum ofono_gprs_context_type {
OFONO_GPRS_CONTEXT_TYPE_ANY = 0,
OFONO_GPRS_CONTEXT_TYPE_INTERNET,
@@ -54,11 +39,6 @@
OFONO_GPRS_CONTEXT_TYPE_IMS,
};
-enum ofono_gprs_auth_method {
- OFONO_GPRS_AUTH_METHOD_CHAP = 0,
- OFONO_GPRS_AUTH_METHOD_PAP,
-};
-
struct ofono_gprs_primary_context {
unsigned int cid;
char apn[OFONO_GPRS_MAX_APN_LENGTH + 1];
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/include/lte.h
^
|
@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2016 Endocode AG. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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
@@ -32,6 +33,10 @@
struct ofono_lte_default_attach_info {
char apn[OFONO_GPRS_MAX_APN_LENGTH + 1];
+ enum ofono_gprs_proto proto;
+ enum ofono_gprs_auth_method auth_method;
+ char username[OFONO_GPRS_MAX_USERNAME_LENGTH + 1];
+ char password[OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
};
typedef void (*ofono_lte_cb_t)(const struct ofono_error *error, void *data);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/include/modem.h
^
|
@@ -127,6 +127,9 @@
struct ofono_modem *ofono_modem_find(ofono_modem_compare_cb_t func,
void *user_data);
+void ofono_modem_set_powered_timeout_hint(struct ofono_modem *modem,
+ unsigned int seconds);
+
#ifdef __cplusplus
}
#endif
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/include/types.h
^
|
@@ -122,6 +122,27 @@
unsigned char uuid[OFONO_SHA1_UUID_LEN];
};
+/*
+ * ETSI 123.003, Section 9.1:
+ * the APN has, after encoding as defined in the paragraph below, a maximum
+ * length of 100 octets
+ */
+#define OFONO_GPRS_MAX_APN_LENGTH 100
+#define OFONO_GPRS_MAX_USERNAME_LENGTH 63
+#define OFONO_GPRS_MAX_PASSWORD_LENGTH 255
+
+enum ofono_gprs_proto {
+ OFONO_GPRS_PROTO_IP = 0,
+ OFONO_GPRS_PROTO_IPV6,
+ OFONO_GPRS_PROTO_IPV4V6,
+};
+
+enum ofono_gprs_auth_method {
+ OFONO_GPRS_AUTH_METHOD_CHAP = 0,
+ OFONO_GPRS_AUTH_METHOD_PAP,
+ OFONO_GPRS_AUTH_METHOD_NONE,
+};
+
const char *ofono_uuid_to_str(const struct ofono_uuid *uuid);
void ofono_call_init(struct ofono_call *call);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/cinterion.c
^
|
@@ -209,7 +209,7 @@
ofono_ussd_create(modem, 0, "atmodem", chat);
ofono_call_forwarding_create(modem, 0, "atmodem", chat);
ofono_call_settings_create(modem, 0, "atmodem", chat);
- ofono_netreg_create(modem, OFONO_VENDOR_CINTERION, "atmodem", chat);
+ ofono_netreg_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", chat);
ofono_call_meter_create(modem, 0, "atmodem", chat);
ofono_call_barring_create(modem, 0, "atmodem", chat);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/file-provision.c
^
|
@@ -93,7 +93,9 @@
if (value != NULL)
(*settings)[0].password = value;
- (*settings)[0].auth_method = OFONO_GPRS_AUTH_METHOD_CHAP;
+ /* select default authentication method */
+ (*settings)[0].auth_method = OFONO_GPRS_AUTH_METHOD_NONE;
+
value = g_key_file_get_string(key_file, setting_group,
"internet.AuthenticationMethod", NULL);
@@ -104,7 +106,7 @@
else if (g_strcmp0(value, "pap") == 0)
(*settings)[0].auth_method =
OFONO_GPRS_AUTH_METHOD_PAP;
- else
+ else if (g_strcmp0(value, "none") != 0)
DBG("Unknown auth method: %s", value);
g_free(value);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/gemalto.c
^
|
@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2017 Vincent Cesson. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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
@@ -571,6 +572,10 @@
ofono_devinfo_create(modem, 0, "atmodem", data->app);
ofono_location_reporting_create(modem, 0, "gemaltomodem", data->app);
+
+ ofono_modem_set_integer(modem, "GemaltoVtsQuotes", 1);
+ ofono_voicecall_create(modem, 0, "gemaltomodem", data->app);
+
data->sim = ofono_sim_create(modem, OFONO_VENDOR_GEMALTO, "atmodem",
data->app);
@@ -597,8 +602,15 @@
if (gprs && gc)
ofono_gprs_add_context(gprs, gc);
+ ofono_ussd_create(modem, 0, "atmodem", data->app);
+
+ ofono_call_forwarding_create(modem, 0, "atmodem", data->app);
+ ofono_call_settings_create(modem, 0, "atmodem", data->app);
+ ofono_call_meter_create(modem, 0, "atmodem", data->app);
+ ofono_call_barring_create(modem, 0, "atmodem", data->app);
+
if (!g_strcmp0(model, GEMALTO_MODEL_ALS3_PLS8x))
- ofono_lte_create(modem, OFONO_VENDOR_CINTERION,
+ ofono_lte_create(modem, OFONO_VENDOR_GEMALTO,
"atmodem", data->app);
}
@@ -608,7 +620,7 @@
DBG("%p", modem);
- ofono_netreg_create(modem, OFONO_VENDOR_CINTERION, "atmodem", data->app);
+ ofono_netreg_create(modem, OFONO_VENDOR_GEMALTO, "atmodem", data->app);
}
static struct ofono_modem_driver gemalto_driver = {
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/gobi.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/mbim.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/mbpi.c
^
|
@@ -325,6 +325,8 @@
ap->apn = g_strdup(apn);
ap->type = OFONO_GPRS_CONTEXT_TYPE_INTERNET;
ap->proto = OFONO_GPRS_PROTO_IP;
+
+ /* pre-select default authentication method */
ap->auth_method = OFONO_GPRS_AUTH_METHOD_CHAP;
g_markup_parse_context_push(context, &apn_parser, ap);
@@ -395,6 +397,10 @@
if (ap == NULL)
return;
+ /* select authentication method NONE if fit */
+ if (!ap->username || !ap->password)
+ ap->auth_method = OFONO_GPRS_AUTH_METHOD_NONE;
+
if (gsm->allow_duplicates == FALSE) {
GSList *l;
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/phonesim.c
^
|
@@ -803,6 +803,7 @@
set_online_cb, cbd, g_free) > 0)
return;
+ g_free(cbd);
CALLBACK_WITH_FAILURE(cb, user_data);
}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/sim900.c
^
|
@@ -24,6 +24,7 @@
#endif
#include <errno.h>
+#include <string.h>
#include <stdlib.h>
#include <glib.h>
#include <gatchat.h>
@@ -60,13 +61,66 @@
static const char *none_prefix[] = { NULL };
+enum type {
+ SIMCOM_UNKNOWN,
+ SIM800,
+ SIM900,
+};
+
struct sim900_data {
GIOChannel *device;
GAtMux *mux;
GAtChat * dlcs[NUM_DLC];
guint frame_size;
+ enum type modem_type;
};
+static void mux_ready_notify(GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ struct sim900_data *data = ofono_modem_get_data(modem);
+ struct ofono_gprs *gprs = NULL;
+ struct ofono_gprs_context *gc;
+
+ ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
+ data->dlcs[SMS_DLC]);
+
+ gprs = ofono_gprs_create(modem, 0, "atmodem", data->dlcs[GPRS_DLC]);
+ if (gprs == NULL)
+ return;
+
+ gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM,
+ "atmodem", data->dlcs[GPRS_DLC]);
+ if (gc)
+ ofono_gprs_add_context(gprs, gc);
+}
+
+static void check_model(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ GAtResultIter iter;
+ char const *model;
+ struct sim900_data *data = ofono_modem_get_data(modem);
+
+ DBG("");
+
+ g_at_result_iter_init(&iter, result);
+
+ while (g_at_result_iter_next(&iter, NULL)) {
+ if (!g_at_result_iter_next_unquoted_string(&iter, &model))
+ continue;
+
+ DBG("setting type %s", model);
+
+ if (strstr(model, "SIM800"))
+ data->modem_type = SIM800;
+ else if (strstr(model, "SIM900"))
+ data->modem_type = SIM800;
+ else
+ data->modem_type = SIMCOM_UNKNOWN;
+ }
+}
+
static int sim900_probe(struct ofono_modem *modem)
{
struct sim900_data *data;
@@ -233,6 +287,14 @@
}
}
+ if (data->modem_type == SIM800) {
+ for (i = 0; i<NUM_DLC; i++) {
+ g_at_chat_register(data->dlcs[i], "SMS Ready",
+ mux_ready_notify, FALSE,
+ modem, NULL);
+ }
+ }
+
ofono_modem_set_powered(modem, TRUE);
return;
@@ -294,6 +356,8 @@
return -EINVAL;
g_at_chat_send(data->dlcs[SETUP_DLC], "ATE0", NULL, NULL, NULL, NULL);
+ g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CGMM", NULL,
+ check_model, modem, NULL);
/* For obtain correct sms service number */
g_at_chat_send(data->dlcs[SETUP_DLC], "AT+CSCS=\"GSM\"", NULL,
@@ -353,18 +417,24 @@
DBG("%p", modem);
- ofono_phonebook_create(modem, 0, "atmodem", data->dlcs[VOICE_DLC]);
- ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
+ if (data->modem_type == SIM900) {
+ ofono_phonebook_create(modem, 0, "atmodem",
+ data->dlcs[VOICE_DLC]);
+ ofono_sms_create(modem, OFONO_VENDOR_SIMCOM, "atmodem",
data->dlcs[SMS_DLC]);
- gprs = ofono_gprs_create(modem, 0, "atmodem", data->dlcs[GPRS_DLC]);
- if (gprs == NULL)
- return;
-
- gc = ofono_gprs_context_create(modem, OFONO_VENDOR_SIMCOM_SIM900,
- "atmodem", data->dlcs[GPRS_DLC]);
- if (gc)
- ofono_gprs_add_context(gprs, gc);
+ gprs = ofono_gprs_create(modem, 0, "atmodem",
+ data->dlcs[GPRS_DLC]);
+ if (gprs == NULL)
+ return;
+
+ gc = ofono_gprs_context_create(modem,
+ OFONO_VENDOR_SIMCOM_SIM900,
+ "atmodem",
+ data->dlcs[GPRS_DLC]);
+ if (gc)
+ ofono_gprs_add_context(gprs, gc);
+ }
}
static void sim900_post_online(struct ofono_modem *modem)
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/udevng.c
^
|
@@ -962,8 +962,6 @@
ofono_modem_set_string(modem->modem, "Device", ctl);
ofono_modem_set_string(modem->modem, "NetworkInterface", net);
ofono_modem_set_string(modem->modem, "DescriptorFile", descriptors);
- ofono_modem_set_string(modem->modem, "Vendor", modem->vendor);
- ofono_modem_set_string(modem->modem, "Model", modem->model);
return TRUE;
}
@@ -1195,12 +1193,22 @@
info->interface, info->number, info->label,
info->sysattr, info->subsystem);
- if (g_strcmp0(info->subsystem, "tty") == 0) {
- if (g_strcmp0(info->number, "02") == 0)
- mdm = info->devnode;
- } else if (g_strcmp0(info->subsystem, "net") == 0) {
- if (g_strcmp0(info->number, "00") == 0)
- net = info->devnode;
+ if (g_strcmp0(modem->model,"095a") == 0) {
+ if (g_strcmp0(info->subsystem, "tty") == 0) {
+ if (g_strcmp0(info->number, "00") == 0)
+ mdm = info->devnode;
+ } else if (g_strcmp0(info->subsystem, "net") == 0) {
+ if (g_strcmp0(info->number, "06") == 0)
+ net = info->devnode;
+ }
+ } else {
+ if (g_strcmp0(info->subsystem, "tty") == 0) {
+ if (g_strcmp0(info->number, "02") == 0)
+ mdm = info->devnode;
+ } else if (g_strcmp0(info->subsystem, "net") == 0) {
+ if (g_strcmp0(info->number, "00") == 0)
+ net = info->devnode;
+ }
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/plugins/xmm7xxx.c
^
|
@@ -50,20 +50,911 @@
#include <ofono/lte.h>
#include <ofono/ims.h>
#include <ofono/sim-auth.h>
+#include <ofono/sms.h>
+#include <ofono/phonebook.h>
+#include <ofono/netmon.h>
#include <drivers/atmodem/atutil.h>
#include <drivers/atmodem/vendor.h>
+#include "ofono.h"
+#include "gdbus.h"
+
+#define OFONO_COEX_INTERFACE OFONO_SERVICE ".intel.LteCoexistence"
+#define OFONO_COEX_AGENT_INTERFACE OFONO_SERVICE ".intel.LteCoexistenceAgent"
+
+#define NET_BAND_LTE_INVALID 0
+#define NET_BAND_LTE_1 101
+#define NET_BAND_LTE_43 143
+#define BAND_LEN 20
+#define MAX_BT_SAFE_VECTOR 15
+#define MAX_WL_SAFE_VECTOR 13
+
static const char *none_prefix[] = { NULL };
static const char *xsimstate_prefix[] = { "+XSIMSTATE:", NULL };
+static const char *xnvmplmn_prefix[] = { "+XNVMPLMN:", NULL };
+
+struct bt_coex_info {
+ int safe_tx_min;
+ int safe_tx_max;
+ int safe_rx_min;
+ int safe_rx_max;
+ int safe_vector[MAX_BT_SAFE_VECTOR];
+ int num_safe_vector;
+};
+
+struct wl_coex_info {
+ int safe_tx_min;
+ int safe_tx_max;
+ int safe_rx_min;
+ int safe_rx_max;
+ int safe_vector[MAX_BT_SAFE_VECTOR];
+ int num_safe_vector;
+};
+
+struct coex_agent {
+ char *path;
+ char *bus;
+ guint disconnect_watch;
+ ofono_bool_t remove_on_terminate;
+ ofono_destroy_func removed_cb;
+ void *removed_data;
+ DBusMessage *msg;
+};
struct xmm7xxx_data {
GAtChat *chat; /* AT chat */
struct ofono_sim *sim;
ofono_bool_t have_sim;
ofono_bool_t sms_phonebook_added;
+ unsigned int netreg_watch;
+};
+
+/* Coex Implementation */
+enum wlan_bw {
+ WLAN_BW_UNSUPPORTED = -1,
+ WLAN_BW_20MHZ = 0,
+ WLAN_BW_40MHZ = 1,
+ WLAN_BW_80MHZ = 2,
+};
+
+struct plmn_hist {
+ unsigned short mnc;
+ unsigned short mcc;
+ unsigned long tdd;
+ unsigned long fdd;
+ unsigned char bw;
+};
+
+struct xmm7xxx_coex {
+ GAtChat *chat;
+ struct ofono_modem *modem;
+
+ DBusMessage *pending;
+ ofono_bool_t bt_active;
+ ofono_bool_t wlan_active;
+ enum wlan_bw wlan_bw;
+ char *lte_band;
+
+ ofono_bool_t pending_bt_active;
+ ofono_bool_t pending_wlan_active;
+ enum wlan_bw pending_wlan_bw;
+
+ struct coex_agent *session_agent;
};
+static ofono_bool_t coex_agent_matches(struct coex_agent *agent,
+ const char *path, const char *sender)
+{
+ return !strcmp(agent->path, path) && !strcmp(agent->bus, sender);
+}
+
+static void coex_agent_set_removed_notify(struct coex_agent *agent,
+ ofono_destroy_func destroy,
+ void *user_data)
+{
+ agent->removed_cb = destroy;
+ agent->removed_data = user_data;
+}
+
+static void coex_agent_send_noreply(struct coex_agent *agent,
+ const char *method)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ DBusMessage *message;
+
+ message = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_COEX_INTERFACE,
+ method);
+ if (message == NULL)
+ return;
+
+ dbus_message_set_no_reply(message, TRUE);
+ g_dbus_send_message(conn, message);
+}
+
+static void coex_agent_send_release(struct coex_agent *agent)
+{
+ coex_agent_send_noreply(agent, "Release");
+}
+
+static void coex_agent_free(struct coex_agent *agent)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ if (agent->disconnect_watch) {
+ coex_agent_send_release(agent);
+
+ g_dbus_remove_watch(conn, agent->disconnect_watch);
+ agent->disconnect_watch = 0;
+ }
+
+ if (agent->removed_cb)
+ agent->removed_cb(agent->removed_data);
+
+ g_free(agent->path);
+ g_free(agent->bus);
+ g_free(agent);
+}
+
+static void coex_agent_disconnect_cb(DBusConnection *conn, void *user_data)
+{
+ struct coex_agent *agent = user_data;
+
+ ofono_debug("Agent exited without calling Unregister");
+
+ agent->disconnect_watch = 0;
+
+ coex_agent_free(agent);
+}
+
+static struct coex_agent *coex_agent_new(const char *path, const char *sender,
+ ofono_bool_t remove_on_terminate)
+{
+ struct coex_agent *agent = g_try_new0(struct coex_agent, 1);
+ DBusConnection *conn = ofono_dbus_get_connection();
+
+ DBG("");
+ if (agent == NULL)
+ return NULL;
+
+ agent->path = g_strdup(path);
+ agent->bus = g_strdup(sender);
+
+ agent->remove_on_terminate = remove_on_terminate;
+
+ agent->disconnect_watch = g_dbus_add_disconnect_watch(conn, sender,
+ coex_agent_disconnect_cb,
+ agent, NULL);
+
+ return agent;
+}
+
+static int coex_agent_coex_wlan_notify(struct coex_agent *agent,
+ const struct wl_coex_info wlan_info)
+{
+ DBusConnection *conn = ofono_dbus_get_connection();
+ DBusMessageIter wl_args, wl_dict, wl_array;
+ const dbus_int32_t *pwl_array = wlan_info.safe_vector;
+ dbus_int32_t value;
+
+ agent->msg = dbus_message_new_method_call(agent->bus, agent->path,
+ OFONO_COEX_AGENT_INTERFACE,
+ "ReceiveWiFiNotification");
+ if (agent->msg == NULL)
+ return -ENOMEM;
+
+ dbus_message_iter_init_append(agent->msg, &wl_args);
+
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/call-volume.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/cdma-smsutil.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <dirent.h>
#include <sys/types.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/common.c
^
|
@@ -669,6 +669,10 @@
return "unknown";
case NETWORK_REGISTRATION_STATUS_ROAMING:
return "roaming";
+ case NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN:
+ return "registered";
+ case NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN:
+ return "roaming";
}
return "";
@@ -765,3 +769,64 @@
return "unknown";
}
+
+const char *gprs_proto_to_string(enum ofono_gprs_proto proto)
+{
+ switch (proto) {
+ case OFONO_GPRS_PROTO_IP:
+ return "ip";
+ case OFONO_GPRS_PROTO_IPV6:
+ return "ipv6";
+ case OFONO_GPRS_PROTO_IPV4V6:
+ return "dual";
+ };
+
+ return NULL;
+}
+
+gboolean gprs_proto_from_string(const char *str, enum ofono_gprs_proto *proto)
+{
+ if (g_str_equal(str, "ip")) {
+ *proto = OFONO_GPRS_PROTO_IP;
+ return TRUE;
+ } else if (g_str_equal(str, "ipv6")) {
+ *proto = OFONO_GPRS_PROTO_IPV6;
+ return TRUE;
+ } else if (g_str_equal(str, "dual")) {
+ *proto = OFONO_GPRS_PROTO_IPV4V6;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+const char *gprs_auth_method_to_string(enum ofono_gprs_auth_method auth)
+{
+ switch (auth) {
+ case OFONO_GPRS_AUTH_METHOD_CHAP:
+ return "chap";
+ case OFONO_GPRS_AUTH_METHOD_PAP:
+ return "pap";
+ case OFONO_GPRS_AUTH_METHOD_NONE:
+ return "none";
+ };
+
+ return NULL;
+}
+
+gboolean gprs_auth_method_from_string(const char *str,
+ enum ofono_gprs_auth_method *auth)
+{
+ if (g_str_equal(str, "chap")) {
+ *auth = OFONO_GPRS_AUTH_METHOD_CHAP;
+ return TRUE;
+ } else if (g_str_equal(str, "pap")) {
+ *auth = OFONO_GPRS_AUTH_METHOD_PAP;
+ return TRUE;
+ } else if (g_str_equal(str, "none")) {
+ *auth = OFONO_GPRS_AUTH_METHOD_NONE;
+ return TRUE;
+ }
+
+ return FALSE;
+}
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/common.h
^
|
@@ -37,12 +37,14 @@
/* 27.007 Section 7.2 <stat> */
enum network_registration_status {
- NETWORK_REGISTRATION_STATUS_NOT_REGISTERED = 0,
- NETWORK_REGISTRATION_STATUS_REGISTERED = 1,
- NETWORK_REGISTRATION_STATUS_SEARCHING = 2,
- NETWORK_REGISTRATION_STATUS_DENIED = 3,
- NETWORK_REGISTRATION_STATUS_UNKNOWN = 4,
- NETWORK_REGISTRATION_STATUS_ROAMING = 5,
+ NETWORK_REGISTRATION_STATUS_NOT_REGISTERED = 0,
+ NETWORK_REGISTRATION_STATUS_REGISTERED = 1,
+ NETWORK_REGISTRATION_STATUS_SEARCHING = 2,
+ NETWORK_REGISTRATION_STATUS_DENIED = 3,
+ NETWORK_REGISTRATION_STATUS_UNKNOWN = 4,
+ NETWORK_REGISTRATION_STATUS_ROAMING = 5,
+ NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN = 6,
+ NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN = 7,
};
/* 27.007 Section 7.3 <stat> */
@@ -185,3 +187,10 @@
gboolean is_valid_apn(const char *apn);
const char *call_status_to_string(enum call_status status);
+
+const char *gprs_proto_to_string(enum ofono_gprs_proto proto);
+gboolean gprs_proto_from_string(const char *str, enum ofono_gprs_proto *proto);
+
+const char *gprs_auth_method_to_string(enum ofono_gprs_auth_method auth);
+gboolean gprs_auth_method_from_string(const char *str,
+ enum ofono_gprs_auth_method *auth);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/gnss.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/gnssagent.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdint.h>
#include <string.h>
#include <errno.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/gprs.c
^
|
@@ -223,63 +223,6 @@
return FALSE;
}
-static const char *gprs_proto_to_string(enum ofono_gprs_proto proto)
-{
- switch (proto) {
- case OFONO_GPRS_PROTO_IP:
- return "ip";
- case OFONO_GPRS_PROTO_IPV6:
- return "ipv6";
- case OFONO_GPRS_PROTO_IPV4V6:
- return "dual";
- };
-
- return NULL;
-}
-
-static gboolean gprs_proto_from_string(const char *str,
- enum ofono_gprs_proto *proto)
-{
- if (g_str_equal(str, "ip")) {
- *proto = OFONO_GPRS_PROTO_IP;
- return TRUE;
- } else if (g_str_equal(str, "ipv6")) {
- *proto = OFONO_GPRS_PROTO_IPV6;
- return TRUE;
- } else if (g_str_equal(str, "dual")) {
- *proto = OFONO_GPRS_PROTO_IPV4V6;
- return TRUE;
- }
-
- return FALSE;
-}
-
-static const char *gprs_auth_method_to_string(enum ofono_gprs_auth_method auth)
-{
- switch (auth) {
- case OFONO_GPRS_AUTH_METHOD_CHAP:
- return "chap";
- case OFONO_GPRS_AUTH_METHOD_PAP:
- return "pap";
- };
-
- return NULL;
-}
-
-static gboolean gprs_auth_method_from_string(const char *str,
- enum ofono_gprs_auth_method *auth)
-{
- if (g_str_equal(str, "chap")) {
- *auth = OFONO_GPRS_AUTH_METHOD_CHAP;
- return TRUE;
- } else if (g_str_equal(str, "pap")) {
- *auth = OFONO_GPRS_AUTH_METHOD_PAP;
- return TRUE;
- }
-
- return FALSE;
-}
-
static unsigned int gprs_cid_alloc(struct ofono_gprs *gprs)
{
return idmap_alloc(gprs->cid_map);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/handsfree.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/idmap.c
^
|
@@ -24,7 +24,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <glib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/lte.c
^
|
@@ -3,6 +3,7 @@
* oFono - Open Source Telephony
*
* Copyright (C) 2016 Endocode AG. All rights reserved.
+ * Copyright (C) 2018 Gemalto M2M
*
* 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
@@ -39,7 +40,11 @@
#define SETTINGS_STORE "lte"
#define SETTINGS_GROUP "Settings"
-#define DEFAULT_APN_KEY "DefaultAccessPointName"
+#define LTE_APN "DefaultAccessPointName"
+#define LTE_PROTO "Protocol"
+#define LTE_USERNAME "Username"
+#define LTE_PASSWORD "Password"
+#define LTE_AUTH_METHOD "AuthenticationMethod"
struct ofono_lte {
const struct ofono_lte_driver *driver;
@@ -57,6 +62,10 @@
static void lte_load_settings(struct ofono_lte *lte)
{
char *apn;
+ char *proto_str;
+ char *auth_method_str;
+ char *username;
+ char *password;
if (lte->imsi == NULL)
return;
@@ -69,19 +78,57 @@
return;
}
- apn = g_key_file_get_string(lte->settings, SETTINGS_GROUP ,
- DEFAULT_APN_KEY, NULL);
- if (apn) {
+ apn = g_key_file_get_string(lte->settings, SETTINGS_GROUP,
+ LTE_APN, NULL);
+ proto_str = g_key_file_get_string(lte->settings, SETTINGS_GROUP,
+ LTE_PROTO, NULL);
+ auth_method_str = g_key_file_get_string(lte->settings, SETTINGS_GROUP,
+ LTE_AUTH_METHOD, NULL);
+ username = g_key_file_get_string(lte->settings, SETTINGS_GROUP,
+ LTE_USERNAME, NULL);
+ password = g_key_file_get_string(lte->settings, SETTINGS_GROUP,
+ LTE_PASSWORD, NULL);
+ if (apn && is_valid_apn(apn))
strcpy(lte->info.apn, apn);
- g_free(apn);
- }
+
+ if (proto_str == NULL)
+ proto_str = g_strdup("ip");
+
+ /* this must have a valid default */
+ if (!gprs_proto_from_string(proto_str, <e->info.proto))
+ lte->info.proto = OFONO_GPRS_PROTO_IP;
+
+ if (auth_method_str == NULL)
+ auth_method_str = g_strdup("none");
+
+ /* this must have a valid default */
+ if (!gprs_auth_method_from_string(auth_method_str,
+ <e->info.auth_method))
+ lte->info.auth_method = OFONO_GPRS_AUTH_METHOD_NONE;
+
+ if (username && strlen(username) <= OFONO_GPRS_MAX_USERNAME_LENGTH)
+ strcpy(lte->info.username, username);
+
+ if (password && strlen(password) <= OFONO_GPRS_MAX_PASSWORD_LENGTH)
+ strcpy(lte->info.password, password);
+
+ g_free(apn);
+ g_free(proto_str);
+ g_free(auth_method_str);
+ g_free(username);
+ g_free(password);
}
static DBusMessage *lte_get_properties(DBusConnection *conn,
DBusMessage *msg, void *data)
{
struct ofono_lte *lte = data;
+ const char *proto = gprs_proto_to_string(lte->info.proto);
const char *apn = lte->info.apn;
+ const char* auth_method =
+ gprs_auth_method_to_string(lte->info.auth_method);
+ const char *username = lte->info.username;
+ const char *password = lte->info.password;
DBusMessage *reply;
DBusMessageIter iter;
DBusMessageIter dict;
@@ -95,20 +142,31 @@
dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
OFONO_PROPERTIES_ARRAY_SIGNATURE,
&dict);
- ofono_dbus_dict_append(&dict, DEFAULT_APN_KEY, DBUS_TYPE_STRING, &apn);
+ ofono_dbus_dict_append(&dict, LTE_APN, DBUS_TYPE_STRING, &apn);
+ ofono_dbus_dict_append(&dict, LTE_PROTO, DBUS_TYPE_STRING, &proto);
+ ofono_dbus_dict_append(&dict, LTE_AUTH_METHOD, DBUS_TYPE_STRING,
+ &auth_method);
+ ofono_dbus_dict_append(&dict, LTE_USERNAME, DBUS_TYPE_STRING,
+ &username);
+ ofono_dbus_dict_append(&dict, LTE_PASSWORD, DBUS_TYPE_STRING,
+ &password);
dbus_message_iter_close_container(&iter, &dict);
return reply;
}
static void lte_set_default_attach_info_cb(const struct ofono_error *error,
- void *data)
+ void *data)
{
struct ofono_lte *lte = data;
const char *path = __ofono_atom_get_path(lte->atom);
DBusConnection *conn = ofono_dbus_get_connection();
DBusMessage *reply;
- const char *apn = lte->info.apn;
+ char *key;
+ char *value;
+ const char *str;
+ DBusMessageIter iter;
+ DBusMessageIter var;
DBG("%s error %d", path, error->type);
@@ -118,55 +176,48 @@
return;
}
- g_strlcpy(lte->info.apn, lte->pending_info.apn,
- OFONO_GPRS_MAX_APN_LENGTH + 1);
+ /*
+ * Reparsing of the message to extract the key and value
+ * No error checking needed since we already validated pending
+ */
+ dbus_message_iter_init(lte->pending, &iter);
+ dbus_message_iter_get_basic(&iter, &str);
+ key = strdup(str);
+
+ dbus_message_iter_next(&iter);
+ dbus_message_iter_recurse(&iter, &var);
+ dbus_message_iter_get_basic(&var, &str);
+ value = strdup(str);
+
+ memcpy(<e->info, <e->pending_info, sizeof(lte->info));
+
+ reply = dbus_message_new_method_return(lte->pending);
+ __ofono_dbus_pending_reply(<e->pending, reply);
if (lte->settings) {
- if (strlen(lte->info.apn) == 0)
- /* Clear entry on empty APN. */
- g_key_file_remove_key(lte->settings, SETTINGS_GROUP,
- DEFAULT_APN_KEY, NULL);
+ /*
+ * the following code removes from storage empty APN, user, pwd
+ * for proto and auth_method, given that they always
+ * have defaults, it will not do anything.
+ */
+ if (!*value)
+ /* Clear entry on empty string. */
+ g_key_file_remove_key(lte->settings,
+ SETTINGS_GROUP, key, NULL);
else
- g_key_file_set_string(lte->settings, SETTINGS_GROUP,
- DEFAULT_APN_KEY, lte->info.apn);
+ g_key_file_set_string(lte->settings,
+ SETTINGS_GROUP, key, value);
storage_sync(lte->imsi, SETTINGS_STORE, lte->settings);
}
- reply = dbus_message_new_method_return(lte->pending);
- __ofono_dbus_pending_reply(<e->pending, reply);
-
ofono_dbus_signal_property_changed(conn, path,
OFONO_CONNECTION_CONTEXT_INTERFACE,
- DEFAULT_APN_KEY,
- DBUS_TYPE_STRING, &apn);
-}
-
-static DBusMessage *lte_set_default_apn(struct ofono_lte *lte,
- DBusConnection *conn, DBusMessage *msg,
- const char *apn)
-{
- if (lte->driver->set_default_attach_info == NULL)
- return __ofono_error_not_implemented(msg);
-
- if (lte->pending)
- return __ofono_error_busy(msg);
+ key,
+ DBUS_TYPE_STRING, &value);
- if (g_str_equal(apn, lte->info.apn))
- return dbus_message_new_method_return(msg);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/main.c
^
|
@@ -32,9 +32,7 @@
#include <gdbus.h>
-#ifdef HAVE_ELL
#include <ell/ell.h>
-#endif
#include "ofono.h"
@@ -174,7 +172,6 @@
{ NULL },
};
-#ifdef HAVE_ELL
struct ell_event_source {
GSource source;
GPollFD pollfd;
@@ -198,7 +195,6 @@
.prepare = event_prepare,
.check = event_check,
};
-#endif
int main(int argc, char **argv)
{
@@ -207,9 +203,7 @@
DBusConnection *conn;
DBusError error;
guint signal;
-#ifdef HAVE_ELL
struct ell_event_source *source;
-#endif
context = g_option_context_new(NULL);
g_option_context_add_main_entries(context, options, NULL);
@@ -241,7 +235,6 @@
event_loop = g_main_loop_new(NULL, FALSE);
-#ifdef HAVE_ELL
l_log_set_stderr();
l_debug_enable("*");
l_main_init();
@@ -255,8 +248,6 @@
g_source_add_poll((GSource *)source, &source->pollfd);
g_source_attach((GSource *) source,
g_main_loop_get_context(event_loop));
-#endif
-
signal = setup_signalfd();
@@ -305,10 +296,9 @@
cleanup:
g_source_remove(signal);
-#ifdef HAVE_ELL
g_source_destroy((GSource *) source);
l_main_exit();
-#endif
+
g_main_loop_unref(event_loop);
__ofono_log_cleanup();
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/modem.c
^
|
@@ -34,15 +34,17 @@
#include "common.h"
-static GSList *g_devinfo_drivers = NULL;
-static GSList *g_driver_list = NULL;
-static GSList *g_modem_list = NULL;
-
-static int next_modem_id = 0;
-static gboolean powering_down = FALSE;
-static int modems_remaining = 0;
+#define DEFAULT_POWERED_TIMEOUT (20)
-static struct ofono_watchlist *g_modemwatches = NULL;
+static GSList *g_devinfo_drivers;
+static GSList *g_driver_list;
+static GSList *g_modem_list;
+
+static int next_modem_id;
+static gboolean powering_down;
+static int modems_remaining;
+
+static struct ofono_watchlist *g_modemwatches;
enum property_type {
PROPERTY_TYPE_INVALID = 0,
@@ -75,6 +77,7 @@
char *lock_owner;
guint lock_watch;
guint timeout;
+ guint timeout_hint;
ofono_bool_t online;
struct ofono_watchlist *online_watches;
struct ofono_watchlist *powered_watches;
@@ -1055,7 +1058,7 @@
}
modem->pending = dbus_message_ref(msg);
- modem->timeout = g_timeout_add_seconds(20,
+ modem->timeout = g_timeout_add_seconds(modem->timeout_hint,
set_powered_timeout, modem);
return NULL;
}
@@ -1133,7 +1136,8 @@
return __ofono_error_failed(msg);
modem->pending = dbus_message_ref(msg);
- modem->timeout = g_timeout_add_seconds(20,
+ modem->timeout = g_timeout_add_seconds(
+ modem->timeout_hint,
set_powered_timeout, modem);
return NULL;
}
@@ -1843,6 +1847,12 @@
return value;
}
+void ofono_modem_set_powered_timeout_hint(struct ofono_modem *modem,
+ unsigned int seconds)
+{
+ modem->timeout_hint = seconds;
+}
+
void ofono_modem_set_name(struct ofono_modem *modem, const char *name)
{
if (modem->name)
@@ -1904,6 +1914,7 @@
modem->driver_type = g_strdup(type);
modem->properties = g_hash_table_new_full(g_str_hash, g_str_equal,
g_free, unregister_property);
+ modem->timeout_hint = DEFAULT_POWERED_TIMEOUT;
g_modem_list = g_slist_prepend(g_modem_list, modem);
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/netmonagent.c
^
|
@@ -2,7 +2,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdint.h>
#include <string.h>
#include <errno.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/ofono.conf
^
|
@@ -16,6 +16,7 @@
<allow send_interface="org.ofono.PositioningRequestAgent"/>
<allow send_interface="org.ofono.HandsfreeAudioAgent"/>
<allow send_interface="org.ofono.NetworkMonitorAgent"/>
+ <allow send_interface="org.ofono.intel.LteCoexistenceAgent"/>
</policy>
<policy at_console="true">
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/phonebook.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/sim-auth.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <glib.h>
#include <errno.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/sim.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <stdint.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/simfs.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/siri.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/sms.c
^
|
@@ -170,6 +170,26 @@
return "spanish";
case SMS_ALPHABET_PORTUGUESE:
return "portuguese";
+ case SMS_ALPHABET_BENGALI:
+ return "bengali";
+ case SMS_ALPHABET_GUJARATI:
+ return "gujarati";
+ case SMS_ALPHABET_HINDI:
+ return "hindi";
+ case SMS_ALPHABET_KANNADA:
+ return "kannada";
+ case SMS_ALPHABET_MALAYALAM:
+ return "malayalam";
+ case SMS_ALPHABET_ORIYA:
+ return "oriya";
+ case SMS_ALPHABET_PUNJABI:
+ return "punjabi";
+ case SMS_ALPHABET_TAMIL:
+ return "tamil";
+ case SMS_ALPHABET_TELUGU:
+ return "telugu";
+ case SMS_ALPHABET_URDU:
+ return "urdu";
case SMS_ALPHABET_DEFAULT:
return "default";
}
@@ -188,6 +208,26 @@
*alphabet = SMS_ALPHABET_SPANISH;
else if (g_str_equal(str, "portuguese"))
*alphabet = SMS_ALPHABET_PORTUGUESE;
+ else if (g_str_equal(str, "bengali"))
+ *alphabet = SMS_ALPHABET_BENGALI;
+ else if (g_str_equal(str, "gujarati"))
+ *alphabet = SMS_ALPHABET_GUJARATI;
+ else if (g_str_equal(str, "hindi"))
+ *alphabet = SMS_ALPHABET_HINDI;
+ else if (g_str_equal(str, "kannada"))
+ *alphabet = SMS_ALPHABET_KANNADA;
+ else if (g_str_equal(str, "malayalam"))
+ *alphabet = SMS_ALPHABET_MALAYALAM;
+ else if (g_str_equal(str, "oriya"))
+ *alphabet = SMS_ALPHABET_ORIYA;
+ else if (g_str_equal(str, "punjabi"))
+ *alphabet = SMS_ALPHABET_PUNJABI;
+ else if (g_str_equal(str, "tamil"))
+ *alphabet = SMS_ALPHABET_TAMIL;
+ else if (g_str_equal(str, "telugu"))
+ *alphabet = SMS_ALPHABET_TELUGU;
+ else if (g_str_equal(str, "urdu"))
+ *alphabet = SMS_ALPHABET_URDU;
else
return FALSE;
@@ -782,6 +822,8 @@
switch (status) {
case NETWORK_REGISTRATION_STATUS_REGISTERED:
case NETWORK_REGISTRATION_STATUS_ROAMING:
+ case NETWORK_REGISTRATION_STATUS_REGISTERED_SMS_EUTRAN:
+ case NETWORK_REGISTRATION_STATUS_ROAMING_SMS_EUTRAN:
sms->registered = TRUE;
break;
default:
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/smsagent.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdint.h>
#include <string.h>
#include <errno.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/smsutil.c
^
|
@@ -2280,10 +2280,10 @@
* If language is not defined in 3GPP TS 23.038,
* implementations are instructed to ignore it
*/
- if (locking_shift > SMS_ALPHABET_PORTUGUESE)
+ if (locking_shift > SMS_ALPHABET_URDU)
locking_shift = GSM_DIALECT_DEFAULT;
- if (single_shift > SMS_ALPHABET_PORTUGUESE)
+ if (single_shift > SMS_ALPHABET_URDU)
single_shift = GSM_DIALECT_DEFAULT;
converted = convert_gsm_to_utf8_with_lang(buf, written,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/smsutil.h
^
|
@@ -159,6 +159,16 @@
SMS_ALPHABET_TURKISH,
SMS_ALPHABET_SPANISH,
SMS_ALPHABET_PORTUGUESE,
+ SMS_ALPHABET_BENGALI,
+ SMS_ALPHABET_GUJARATI,
+ SMS_ALPHABET_HINDI,
+ SMS_ALPHABET_KANNADA,
+ SMS_ALPHABET_MALAYALAM,
+ SMS_ALPHABET_ORIYA,
+ SMS_ALPHABET_PUNJABI,
+ SMS_ALPHABET_TAMIL,
+ SMS_ALPHABET_TELUGU,
+ SMS_ALPHABET_URDU,
};
enum sms_mwi_type {
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/stk.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/stkagent.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdint.h>
#include <string.h>
#include <errno.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/stkutil.c
^
|
@@ -4405,9 +4405,6 @@
const struct stk_ussd_string *ussd = data;
unsigned char tag = STK_DATA_OBJECT_TYPE_USSD_STRING;
- if (ussd->string == NULL)
- return TRUE;
-
return stk_tlv_builder_open_container(tlv, cr, tag, FALSE) &&
stk_tlv_builder_append_byte(tlv, ussd->dcs) &&
stk_tlv_builder_append_bytes(tlv, ussd->string, ussd->len) &&
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/storage.c
^
|
@@ -25,7 +25,6 @@
#include <ofono/storage.h>
-#define _GNU_SOURCE
#include <string.h>
#include <stdarg.h>
#include <sys/types.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/ussd.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <string.h>
#include <stdio.h>
#include <errno.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/util.c
^
|
@@ -288,6 +288,1666 @@
{ 0x20AC, 0x1B65 }
};
+/* Appendix A.2.4. in 3GPP TS23.038 V.8.2.0 */
+static const struct codepoint ben_ext_gsm[] = {
+ { 0x00, 0x0040 },
+ { 0x01, 0x00A3 },
+ { 0x02, 0x0024 },
+ { 0x03, 0x00A5 },
+ { 0x04, 0x00BF },
+ { 0x05, 0x0022 },
+ { 0x06, 0x00A4 },
+ { 0x07, 0x0025 },
+ { 0x08, 0x0026 },
+ { 0x09, 0x0027 },
+ { 0x0A, 0x000C }, /* See NOTE 3 */
+ { 0x0B, 0x002A },
+ { 0x0C, 0x002B },
+ { 0x0E, 0x002D },
+ { 0x0F, 0x002F },
+ { 0x10, 0X003C },
+ { 0x11, 0X003D },
+ { 0x12, 0X003E },
+ { 0x13, 0X00A1 },
+ { 0x14, 0X005E },
+ { 0x15, 0X00A1 },
+ { 0x16, 0X005F },
+ { 0x17, 0X0023 },
+ { 0x18, 0X002A },
+ { 0x19, 0X09E6 },
+ { 0x1A, 0X09E7 },
+ { 0x1B, 0X0020 }, /* See NOTE 1 */
+ { 0x1C, 0X09E8 },
+ { 0x1D, 0X09E9 },
+ { 0x1E, 0X09EA },
+ { 0x1F, 0X09EB },
+ { 0x20, 0x09EC },
+ { 0x21, 0x09ED },
+ { 0x22, 0x09EE },
+ { 0x23, 0x09EF },
+ { 0x24, 0x09DF },
+ { 0x25, 0x09E0 },
+ { 0x26, 0x09E1 },
+ { 0x27, 0x09E2 },
+ { 0x28, 0x007B },
+ { 0x29, 0x007D },
+ { 0x2A, 0x09E3 },
+ { 0x2B, 0x09F2 },
+ { 0x2C, 0x09F3 },
+ { 0x2D, 0x09F4 },
+ { 0x2E, 0x09F5 },
+ { 0x2F, 0x005C },
+ { 0x30, 0x09F6 },
+ { 0x31, 0x09F7 },
+ { 0x32, 0x09F8 },
+ { 0x33, 0x09F9 },
+ { 0x34, 0x09FA },
+ { 0x3C, 0x005B },
+ { 0x3D, 0x007E },
+ { 0x3E, 0x005D },
+ { 0x40, 0x007C },
+ { 0x41, 0x0041 },
+ { 0x42, 0x0042 },
+ { 0x43, 0x0043 },
+ { 0x44, 0x0044 },
+ { 0x45, 0x0045 },
+ { 0x46, 0x0046 },
+ { 0x47, 0x0047 },
+ { 0x48, 0x0048 },
+ { 0x49, 0x0049 },
+ { 0x4A, 0x004A },
+ { 0x4B, 0x004B },
+ { 0x4C, 0x004C },
+ { 0x4D, 0x004D },
+ { 0x4E, 0x004E },
+ { 0x4F, 0x004F },
+ { 0x50, 0x0050 },
+ { 0x51, 0x0051 },
+ { 0x52, 0x0052 },
+ { 0x53, 0x0053 },
+ { 0x54, 0x0054 },
+ { 0x55, 0x0055 },
+ { 0x56, 0x0056 },
+ { 0x57, 0x0057 },
+ { 0x58, 0x0058 },
+ { 0x59, 0x0059 },
+ { 0x5A, 0x005A },
+ { 0x65, 0x20AC }
+};
+
+static const struct codepoint ben_ext_unicode[] = {
+ { 0x000C, 0x1B0A },
+ { 0x0022, 0x1B05 },
+ { 0X0023, 0x1B17 },
+ { 0x0024, 0x1B02 },
+ { 0x0025, 0x1B07 },
+ { 0x0026, 0x1B08 },
+ { 0x0027, 0x1B09 },
+ { 0x002A, 0x1B0B },
+ { 0X002A, 0x1B18 },
+ { 0x002B, 0x1B0C },
+ { 0x002D, 0x1B0E },
+ { 0x002F, 0x1B0F },
+ { 0X003C, 0x1B10 },
+ { 0X003D, 0x1B11 },
+ { 0X003E, 0x1B12 },
+ { 0x0040, 0x1B00 },
+ { 0x0041, 0x1B41 },
+ { 0x0042, 0x1B42 },
+ { 0x0043, 0x1B43 },
+ { 0x0044, 0x1B44 },
+ { 0x0045, 0x1B45 },
+ { 0x0046, 0x1B46 },
+ { 0x0047, 0x1B47 },
+ { 0x0048, 0x1B48 },
+ { 0x0049, 0x1B49 },
+ { 0x004A, 0x1B4A },
+ { 0x004B, 0x1B4B },
+ { 0x004C, 0x1B4C },
+ { 0x004D, 0x1B4D },
+ { 0x004E, 0x1B4E },
+ { 0x004F, 0x1B4F },
+ { 0x0050, 0x1B50 },
+ { 0x0051, 0x1B51 },
+ { 0x0052, 0x1B52 },
+ { 0x0053, 0x1B53 },
+ { 0x0054, 0x1B54 },
+ { 0x0055, 0x1B55 },
+ { 0x0056, 0x1B56 },
+ { 0x0057, 0x1B57 },
+ { 0x0058, 0x1B58 },
+ { 0x0059, 0x1B59 },
+ { 0x005A, 0x1B5A },
+ { 0x005B, 0x1B3C },
+ { 0x005C, 0x1B2F },
+ { 0x005D, 0x1B3E },
+ { 0X005E, 0x1B14 },
+ { 0X005F, 0x1B16 },
+ { 0x007B, 0x1B28 },
+ { 0x007C, 0x1B40 },
+ { 0x007D, 0x1B29 },
+ { 0x007E, 0x1B3D },
+ { 0X00A1, 0x1B13 },
+ { 0X00A1, 0x1B15 },
+ { 0x00A3, 0x1B01 },
+ { 0x00A4, 0x1B06 },
+ { 0x00A5, 0x1B03 },
+ { 0x00BF, 0x1B04 },
+ { 0x09DF, 0x1B24 },
+ { 0x09E0, 0x1B25 },
+ { 0x09E1, 0x1B26 },
+ { 0x09E2, 0x1B27 },
+ { 0x09E3, 0x1B2A },
+ { 0X09E6, 0x1B19 },
+ { 0X09E7, 0x1B1A },
+ { 0X09E8, 0x1B1C },
+ { 0X09E9, 0x1B1D },
+ { 0X09EA, 0x1B1E },
+ { 0X09EB, 0x1B1F },
+ { 0x09EC, 0x1B20 },
+ { 0x09ED, 0x1B21 },
+ { 0x09EE, 0x1B22 },
+ { 0x09EF, 0x1B23 },
+ { 0x09F2, 0x1B2B },
+ { 0x09F3, 0x1B2C },
+ { 0x09F4, 0x1B2D },
+ { 0x09F5, 0x1B2E },
+ { 0x09F6, 0x1B30 },
+ { 0x09F7, 0x1B31 },
+ { 0x09F8, 0x1B32 },
+ { 0x09F9, 0x1B33 },
+ { 0x09FA, 0x1B34 },
+ { 0x20AC, 0x1B65 }
+};
+
+/* Appendix A.2.5. in 3GPP TS23.038 V.8.2.0 */
+static const struct codepoint guj_ext_gsm[] = {
+ { 0x00, 0x0040 },
+ { 0x01, 0x00A3 },
+ { 0x02, 0x0024 },
+ { 0x03, 0x00A5 },
+ { 0x04, 0x00BF },
+ { 0x05, 0x0022 },
+ { 0x06, 0x00A4 },
+ { 0x07, 0x0025 },
+ { 0x08, 0x0026 },
+ { 0x09, 0x0027 },
+ { 0x0A, 0x000C }, /* See NOTE 3 */
+ { 0x0B, 0x002A },
+ { 0x0C, 0x002B },
+ { 0x0E, 0x002D },
+ { 0x0F, 0x002F },
+ { 0x10, 0x003C },
+ { 0x11, 0x003D },
+ { 0x12, 0x003E },
+ { 0x13, 0x00A1 },
+ { 0x14, 0x005E },
+ { 0x15, 0x00A1 },
+ { 0x16, 0x005F },
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/src/util.h
^
|
@@ -24,6 +24,16 @@
GSM_DIALECT_TURKISH,
GSM_DIALECT_SPANISH,
GSM_DIALECT_PORTUGUESE,
+ GSM_DIALECT_BENGALI,
+ GSM_DIALECT_GUJARATI,
+ GSM_DIALECT_HINDI,
+ GSM_DIALECT_KANNADA,
+ GSM_DIALECT_MALAYALAM,
+ GSM_DIALECT_ORIYA,
+ GSM_DIALECT_PUNJABI,
+ GSM_DIALECT_TAMIL,
+ GSM_DIALECT_TELUGU,
+ GSM_DIALECT_URDU,
};
char *convert_gsm_to_utf8(const unsigned char *text, long len, long *items_read,
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/test/change-pin
^
|
@@ -10,7 +10,7 @@
pin_type = sys.argv[2]
old_pin = sys.argv[3]
new_pin = sys.argv[4]
-elif len(sys.argv) == 3:
+elif len(sys.argv) == 4:
manager = dbus.Interface(bus.get_object('org.ofono', '/'),
'org.ofono.Manager')
modems = manager.GetModems()
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/test/set-ddr
^
|
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python3
import sys
import dbus
|
[-]
[+]
|
Added |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/test/set-sms-alphabet
^
|
@@ -0,0 +1,27 @@
+#!/usr/bin/python3
+
+import dbus
+import sys
+
+bus = dbus.SystemBus()
+
+if len(sys.argv) == 3:
+ path = sys.argv[1]
+ alphabet = sys.argv[2]
+elif len(sys.argv) == 2:
+ manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+ modems = manager.GetModems()
+ path = modems[0][0]
+ alphabet = sys.argv[1]
+else:
+ print("%s [PATH] turkish|spanish|portuguese|bengali|gujarati|hindi \
+ |kannada|malayalam|oriya|punjabi|tamil|telugu|urdu" %
+ (sys.argv[0]))
+ sys.exit(1)
+
+print("Setting alphabet for modem %s..." % path)
+sms = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.MessageManager')
+
+sms.SetProperty("Alphabet", dbus.String(alphabet));
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/rilmodem-test-engine.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <stdio.h>
#include <netinet/in.h>
#include <sys/socket.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/rilmodem-test-server.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/un.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/test-rilmodem-cb.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <glib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/test-rilmodem-cs.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <glib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/test-rilmodem-gprs.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <glib.h>
|
[-]
[+]
|
Changed |
_service:tar_git:ofono-1.27+git1.tar.bz2/upstream/unit/test-rilmodem-sms.c
^
|
@@ -23,7 +23,6 @@
#include <config.h>
#endif
-#define _GNU_SOURCE
#include <assert.h>
#include <errno.h>
#include <glib.h>
|