mirror of
https://github.com/sailfishos/ofono
synced 2025-12-02 15:41:03 +08:00
Compare commits
7 Commits
mer/1.23+g
...
mer/1.23+g
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2d5a22284e | ||
|
|
9d742180ab | ||
|
|
7a54bb8cbe | ||
|
|
56e0923dc3 | ||
|
|
22197b5e04 | ||
|
|
3a358ddc9d | ||
|
|
53929f9f1a |
@@ -189,8 +189,8 @@ CFLAGS="$CFLAGS $GLIBUTIL_CFLAGS"
|
|||||||
LIBS="$LIBS $GLIBUTIL_LIBS"
|
LIBS="$LIBS $GLIBUTIL_LIBS"
|
||||||
|
|
||||||
if (test "${enable_sailfish_rilmodem}" = "yes"); then
|
if (test "${enable_sailfish_rilmodem}" = "yes"); then
|
||||||
PKG_CHECK_MODULES(GRILIO, libgrilio >= 1.0.35, dummy=yes,
|
PKG_CHECK_MODULES(GRILIO, libgrilio >= 1.0.38, dummy=yes,
|
||||||
AC_MSG_ERROR(libgrilio >= 1.0.35 is required))
|
AC_MSG_ERROR(libgrilio >= 1.0.38 is required))
|
||||||
PKG_CHECK_MODULES(LIBMCE, libmce-glib >= 1.0.6, dummy=yes,
|
PKG_CHECK_MODULES(LIBMCE, libmce-glib >= 1.0.6, dummy=yes,
|
||||||
AC_MSG_ERROR(libmce-glib >= 1.0.6 is required))
|
AC_MSG_ERROR(libmce-glib >= 1.0.6 is required))
|
||||||
CFLAGS="$CFLAGS $GRILIO_CFLAGS $LIBMCE_CFLAGS"
|
CFLAGS="$CFLAGS $GRILIO_CFLAGS $LIBMCE_CFLAGS"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* oFono - Open Source Telephony - RIL-based devices
|
* oFono - Open Source Telephony - RIL-based devices
|
||||||
*
|
*
|
||||||
* Copyright (C) 2015-2017 Jolla Ltd.
|
* Copyright (C) 2015-2020 Jolla Ltd.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -144,10 +144,19 @@ static void ril_cbs_notify(GRilIoChannel *io, guint code,
|
|||||||
const void *data, guint len, void *user_data)
|
const void *data, guint len, void *user_data)
|
||||||
{
|
{
|
||||||
struct ril_cbs *cd = user_data;
|
struct ril_cbs *cd = user_data;
|
||||||
|
GRilIoParser rilp;
|
||||||
|
guint32 pdu_len;
|
||||||
|
|
||||||
GASSERT(code == RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS);
|
GASSERT(code == RIL_UNSOL_RESPONSE_NEW_BROADCAST_SMS);
|
||||||
DBG_(cd, "%u bytes", len);
|
grilio_parser_init(&rilp, data, len);
|
||||||
ofono_cbs_notify(cd->cbs, data, len);
|
if (grilio_parser_get_uint32(&rilp, &pdu_len)) {
|
||||||
|
const void* pdu = grilio_parser_get_bytes(&rilp, pdu_len);
|
||||||
|
|
||||||
|
if (pdu) {
|
||||||
|
DBG_(cd, "%u bytes", pdu_len);
|
||||||
|
ofono_cbs_notify(cd->cbs, pdu, pdu_len);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ril_cbs_probe_done_cb(GRilIoChannel *io, int status,
|
static void ril_cbs_probe_done_cb(GRilIoChannel *io, int status,
|
||||||
|
|||||||
@@ -384,6 +384,7 @@ static void ril_plugin_shutdown_slot(ril_slot *slot, gboolean kill_io)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (slot->cell_info) {
|
if (slot->cell_info) {
|
||||||
|
sailfish_manager_set_cell_info(slot->handle, NULL);
|
||||||
sailfish_cell_info_unref(slot->cell_info);
|
sailfish_cell_info_unref(slot->cell_info);
|
||||||
slot->cell_info = NULL;
|
slot->cell_info = NULL;
|
||||||
}
|
}
|
||||||
@@ -1041,13 +1042,13 @@ static void ril_plugin_slot_connected(ril_slot *slot)
|
|||||||
slot->path, slot->config.techs, slot->imei,
|
slot->path, slot->config.techs, slot->imei,
|
||||||
slot->imeisv, ril_plugin_sim_state(slot),
|
slot->imeisv, ril_plugin_sim_state(slot),
|
||||||
slot->slot_flags);
|
slot->slot_flags);
|
||||||
sailfish_manager_set_cell_info(slot->handle, slot->cell_info);
|
|
||||||
grilio_channel_set_enabled(slot->io, slot->handle->enabled);
|
grilio_channel_set_enabled(slot->io, slot->handle->enabled);
|
||||||
|
|
||||||
/* Check if this was the last slot we were waiting for */
|
/* Check if this was the last slot we were waiting for */
|
||||||
ril_plugin_check_if_started(plugin);
|
ril_plugin_check_if_started(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sailfish_manager_set_cell_info(slot->handle, slot->cell_info);
|
||||||
ril_plugin_check_modem(slot);
|
ril_plugin_check_modem(slot);
|
||||||
ril_plugin_check_ready(slot);
|
ril_plugin_check_ready(slot);
|
||||||
}
|
}
|
||||||
@@ -1063,8 +1064,11 @@ static void ril_plugin_slot_connected_cb(GRilIoChannel *io, void *user_data)
|
|||||||
static void ril_plugin_init_io(ril_slot *slot)
|
static void ril_plugin_init_io(ril_slot *slot)
|
||||||
{
|
{
|
||||||
if (!slot->io) {
|
if (!slot->io) {
|
||||||
slot->io = grilio_channel_new(ofono_ril_transport_connect
|
struct grilio_transport *transport =
|
||||||
(slot->transport_name, slot->transport_params));
|
ofono_ril_transport_connect(slot->transport_name,
|
||||||
|
slot->transport_params);
|
||||||
|
|
||||||
|
slot->io = grilio_channel_new(transport);
|
||||||
if (slot->io) {
|
if (slot->io) {
|
||||||
ril_debug_trace_update(slot);
|
ril_debug_trace_update(slot);
|
||||||
ril_debug_dump_update(slot);
|
ril_debug_dump_update(slot);
|
||||||
@@ -1096,6 +1100,7 @@ static void ril_plugin_init_io(ril_slot *slot)
|
|||||||
slot);
|
slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
grilio_transport_unref(transport);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!slot->io) {
|
if (!slot->io) {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
* Copyright (C) 2008-2011 Intel Corporation. All rights reserved.
|
||||||
* Copyright (C) 2013 Jolla Ltd. All rights reserved.
|
* Copyright (C) 2013 Jolla Ltd. All rights reserved.
|
||||||
|
* Copyright (C) 2020 Open Mobile Platform LLС. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
@@ -26,6 +27,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <errno.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <gdbus.h>
|
#include <gdbus.h>
|
||||||
|
|
||||||
@@ -40,58 +42,42 @@
|
|||||||
|
|
||||||
#define SMS_HISTORY_INTERFACE "org.ofono.SmsHistory"
|
#define SMS_HISTORY_INTERFACE "org.ofono.SmsHistory"
|
||||||
|
|
||||||
gboolean sms_history_interface_registered = FALSE;
|
|
||||||
|
|
||||||
static const GDBusSignalTable sms_history_signals[] = {
|
static const GDBusSignalTable sms_history_signals[] = {
|
||||||
{ GDBUS_SIGNAL("StatusReport",
|
{ GDBUS_SIGNAL("StatusReport",
|
||||||
GDBUS_ARGS({ "message", "s" }, { "Delivered", "a{b}" })) },
|
GDBUS_ARGS({ "message", "s" }, { "Delivered", "a{b}" })) },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
|
||||||
static void sms_history_cleanup(gpointer user)
|
static int sms_history_probe(struct ofono_history_context *context)
|
||||||
{
|
{
|
||||||
struct ofono_modem *modem = user;
|
|
||||||
DBG("modem %p", modem);
|
|
||||||
ofono_modem_remove_interface(modem, SMS_HISTORY_INTERFACE);
|
|
||||||
sms_history_interface_registered = FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean sms_history_ensure_interface(
|
|
||||||
struct ofono_modem *modem) {
|
|
||||||
|
|
||||||
if (sms_history_interface_registered)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
/* Late initialization of the D-Bus interface */
|
|
||||||
DBusConnection *conn = ofono_dbus_get_connection();
|
DBusConnection *conn = ofono_dbus_get_connection();
|
||||||
if (conn == NULL)
|
struct ofono_modem *modem = context->modem;
|
||||||
return FALSE;
|
|
||||||
|
ofono_debug("SMS History Probe for modem: %p", modem);
|
||||||
|
|
||||||
if (!g_dbus_register_interface(conn,
|
if (!g_dbus_register_interface(conn,
|
||||||
ofono_modem_get_path(modem),
|
ofono_modem_get_path(modem),
|
||||||
SMS_HISTORY_INTERFACE,
|
SMS_HISTORY_INTERFACE,
|
||||||
NULL, sms_history_signals, NULL,
|
NULL, sms_history_signals,
|
||||||
modem, sms_history_cleanup)) {
|
NULL, NULL, NULL)) {
|
||||||
ofono_error("Could not create %s interface",
|
ofono_error("Could not create %s interface",
|
||||||
SMS_HISTORY_INTERFACE);
|
SMS_HISTORY_INTERFACE);
|
||||||
return FALSE;
|
return -EIO;
|
||||||
}
|
}
|
||||||
sms_history_interface_registered = TRUE;
|
|
||||||
ofono_modem_add_interface(modem, SMS_HISTORY_INTERFACE);
|
ofono_modem_add_interface(modem, SMS_HISTORY_INTERFACE);
|
||||||
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int sms_history_probe(struct ofono_history_context *context)
|
|
||||||
{
|
|
||||||
ofono_debug("SMS History Probe for modem: %p", context->modem);
|
|
||||||
sms_history_ensure_interface(context->modem);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sms_history_remove(struct ofono_history_context *context)
|
static void sms_history_remove(struct ofono_history_context *context)
|
||||||
{
|
{
|
||||||
ofono_debug("SMS History Remove for modem: %p", context->modem);
|
DBusConnection *conn = ofono_dbus_get_connection();
|
||||||
|
struct ofono_modem *modem = context->modem;
|
||||||
|
|
||||||
|
ofono_debug("SMS History remove for modem: %p", modem);
|
||||||
|
ofono_modem_remove_interface(modem, SMS_HISTORY_INTERFACE);
|
||||||
|
g_dbus_unregister_interface(conn, ofono_modem_get_path(modem),
|
||||||
|
SMS_HISTORY_INTERFACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sms_history_sms_send_status(
|
static void sms_history_sms_send_status(
|
||||||
@@ -102,9 +88,6 @@ static void sms_history_sms_send_status(
|
|||||||
{
|
{
|
||||||
DBG("");
|
DBG("");
|
||||||
|
|
||||||
if (!sms_history_ensure_interface(context->modem))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ((s == OFONO_HISTORY_SMS_STATUS_DELIVERED)
|
if ((s == OFONO_HISTORY_SMS_STATUS_DELIVERED)
|
||||||
|| (s == OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED)) {
|
|| (s == OFONO_HISTORY_SMS_STATUS_DELIVER_FAILED)) {
|
||||||
|
|
||||||
@@ -174,4 +157,3 @@ static void sms_history_exit(void)
|
|||||||
OFONO_PLUGIN_DEFINE(sms_history, "SMS History Plugin",
|
OFONO_PLUGIN_DEFINE(sms_history, "SMS History Plugin",
|
||||||
VERSION, OFONO_PLUGIN_PRIORITY_DEFAULT,
|
VERSION, OFONO_PLUGIN_PRIORITY_DEFAULT,
|
||||||
sms_history_init, sms_history_exit)
|
sms_history_init, sms_history_exit)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ License: GPLv2
|
|||||||
URL: https://git.sailfishos.org/mer-core/ofono
|
URL: https://git.sailfishos.org/mer-core/ofono
|
||||||
Source: %{name}-%{version}.tar.bz2
|
Source: %{name}-%{version}.tar.bz2
|
||||||
|
|
||||||
%define libgrilio_version 1.0.35
|
%define libgrilio_version 1.0.38
|
||||||
%define libglibutil_version 1.0.30
|
%define libglibutil_version 1.0.30
|
||||||
%define libmce_version 1.0.6
|
%define libmce_version 1.0.6
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user