mirror of git://git.sysmocom.de/ofono
Rename modem_add_interface / modem_remove_interface
Move to ofono_modem_add_interface, ofono_modem_remove_interface and put in ofono/modem.h
This commit is contained in:
parent
be064f92a5
commit
19eeb7f1ba
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
includedir = @includedir@/ofono
|
includedir = @includedir@/ofono
|
||||||
|
|
||||||
include_HEADERS = log.h plugin.h history.h dbus.h
|
include_HEADERS = log.h plugin.h history.h dbus.h modem.h
|
||||||
|
|
||||||
nodist_include_HEADERS = version.h
|
nodist_include_HEADERS = version.h
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* oFono - Open Source Telephony
|
||||||
|
*
|
||||||
|
* Copyright (C) 2008-2009 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
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __OFONO_MODEM_H
|
||||||
|
#define __OFONO_MODEM_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void ofono_modem_add_interface(struct ofono_modem *modem,
|
||||||
|
const char *interface);
|
||||||
|
|
||||||
|
void ofono_modem_remove_interface(struct ofono_modem *modem,
|
||||||
|
const char *interface);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __OFONO_MODEM_H */
|
|
@ -1102,7 +1102,7 @@ int ofono_call_barring_register(struct ofono_modem *modem,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
modem_add_interface(modem, CALL_BARRING_INTERFACE);
|
ofono_modem_add_interface(modem, CALL_BARRING_INTERFACE);
|
||||||
|
|
||||||
cb_register_ss_controls(modem);
|
cb_register_ss_controls(modem);
|
||||||
|
|
||||||
|
@ -1121,7 +1121,7 @@ void ofono_call_barring_unregister(struct ofono_modem *modem)
|
||||||
if (!modem->call_barring)
|
if (!modem->call_barring)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
modem_remove_interface(modem, CALL_BARRING_INTERFACE);
|
ofono_modem_remove_interface(modem, CALL_BARRING_INTERFACE);
|
||||||
g_dbus_unregister_interface(conn, modem->path, CALL_BARRING_INTERFACE);
|
g_dbus_unregister_interface(conn, modem->path, CALL_BARRING_INTERFACE);
|
||||||
|
|
||||||
cb_unregister_ss_controls(modem);
|
cb_unregister_ss_controls(modem);
|
||||||
|
|
|
@ -1166,7 +1166,7 @@ int ofono_call_forwarding_register(struct ofono_modem *modem,
|
||||||
|
|
||||||
cf_register_ss_controls(modem);
|
cf_register_ss_controls(modem);
|
||||||
|
|
||||||
modem_add_interface(modem, CALL_FORWARDING_INTERFACE);
|
ofono_modem_add_interface(modem, CALL_FORWARDING_INTERFACE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1179,7 +1179,7 @@ void ofono_call_forwarding_unregister(struct ofono_modem *modem)
|
||||||
if (!cf)
|
if (!cf)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
modem_remove_interface(modem, CALL_FORWARDING_INTERFACE);
|
ofono_modem_remove_interface(modem, CALL_FORWARDING_INTERFACE);
|
||||||
g_dbus_unregister_interface(conn, modem->path,
|
g_dbus_unregister_interface(conn, modem->path,
|
||||||
CALL_FORWARDING_INTERFACE);
|
CALL_FORWARDING_INTERFACE);
|
||||||
|
|
||||||
|
|
|
@ -741,7 +741,7 @@ int ofono_call_meter_register(struct ofono_modem *modem,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
modem_add_interface(modem, CALL_METER_INTERFACE);
|
ofono_modem_add_interface(modem, CALL_METER_INTERFACE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -753,7 +753,7 @@ void ofono_call_meter_unregister(struct ofono_modem *modem)
|
||||||
if (!modem->call_meter)
|
if (!modem->call_meter)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
modem_remove_interface(modem, CALL_METER_INTERFACE);
|
ofono_modem_remove_interface(modem, CALL_METER_INTERFACE);
|
||||||
g_dbus_unregister_interface(conn, modem->path, CALL_METER_INTERFACE);
|
g_dbus_unregister_interface(conn, modem->path, CALL_METER_INTERFACE);
|
||||||
|
|
||||||
modem->call_meter = NULL;
|
modem->call_meter = NULL;
|
||||||
|
|
|
@ -1232,7 +1232,7 @@ int ofono_call_settings_register(struct ofono_modem *modem,
|
||||||
|
|
||||||
cs_register_ss_controls(modem);
|
cs_register_ss_controls(modem);
|
||||||
|
|
||||||
modem_add_interface(modem, CALL_SETTINGS_INTERFACE);
|
ofono_modem_add_interface(modem, CALL_SETTINGS_INTERFACE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1244,7 +1244,7 @@ void ofono_call_settings_unregister(struct ofono_modem *modem)
|
||||||
if (!cs)
|
if (!cs)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
modem_remove_interface(modem, CALL_SETTINGS_INTERFACE);
|
ofono_modem_remove_interface(modem, CALL_SETTINGS_INTERFACE);
|
||||||
g_dbus_unregister_interface(conn, modem->path,
|
g_dbus_unregister_interface(conn, modem->path,
|
||||||
CALL_SETTINGS_INTERFACE);
|
CALL_SETTINGS_INTERFACE);
|
||||||
|
|
||||||
|
|
|
@ -224,7 +224,8 @@ static gboolean trigger_interface_update(void *data)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void modem_add_interface(struct ofono_modem *modem, const char *interface)
|
void ofono_modem_add_interface(struct ofono_modem *modem,
|
||||||
|
const char *interface)
|
||||||
{
|
{
|
||||||
struct ofono_modem_data *info = modem->modem_info;
|
struct ofono_modem_data *info = modem->modem_info;
|
||||||
|
|
||||||
|
@ -236,7 +237,8 @@ void modem_add_interface(struct ofono_modem *modem, const char *interface)
|
||||||
g_timeout_add(0, trigger_interface_update, modem);
|
g_timeout_add(0, trigger_interface_update, modem);
|
||||||
}
|
}
|
||||||
|
|
||||||
void modem_remove_interface(struct ofono_modem *modem, const char *interface)
|
void ofono_modem_remove_interface(struct ofono_modem *modem,
|
||||||
|
const char *interface)
|
||||||
{
|
{
|
||||||
struct ofono_modem_data *info = modem->modem_info;
|
struct ofono_modem_data *info = modem->modem_info;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,3 @@ struct ofono_modem_attribute_ops;
|
||||||
|
|
||||||
struct ofono_modem *modem_create(int id, struct ofono_modem_attribute_ops *ops);
|
struct ofono_modem *modem_create(int id, struct ofono_modem_attribute_ops *ops);
|
||||||
void modem_remove(struct ofono_modem *modem);
|
void modem_remove(struct ofono_modem *modem);
|
||||||
|
|
||||||
void modem_add_interface(struct ofono_modem *modem, const char *interface);
|
|
||||||
void modem_remove_interface(struct ofono_modem *modem, const char *interface);
|
|
||||||
|
|
||||||
|
|
|
@ -919,7 +919,7 @@ static void initialize_network_registration(struct ofono_modem *modem)
|
||||||
ofono_debug("NetworkRegistration interface for modem: %s created",
|
ofono_debug("NetworkRegistration interface for modem: %s created",
|
||||||
modem->path);
|
modem->path);
|
||||||
|
|
||||||
modem_add_interface(modem, NETWORK_REGISTRATION_INTERFACE);
|
ofono_modem_add_interface(modem, NETWORK_REGISTRATION_INTERFACE);
|
||||||
ofono_sim_ready_notify_register(modem, network_sim_ready);
|
ofono_sim_ready_notify_register(modem, network_sim_ready);
|
||||||
|
|
||||||
if (modem->network_registration->ops->list_operators) {
|
if (modem->network_registration->ops->list_operators) {
|
||||||
|
@ -1405,6 +1405,6 @@ void ofono_network_registration_unregister(struct ofono_modem *modem)
|
||||||
|
|
||||||
g_dbus_unregister_interface(conn, modem->path,
|
g_dbus_unregister_interface(conn, modem->path,
|
||||||
NETWORK_REGISTRATION_INTERFACE);
|
NETWORK_REGISTRATION_INTERFACE);
|
||||||
modem_remove_interface(modem, NETWORK_REGISTRATION_INTERFACE);
|
ofono_modem_remove_interface(modem, NETWORK_REGISTRATION_INTERFACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -83,6 +83,8 @@ struct ofono_modem {
|
||||||
GSList *history_contexts;
|
GSList *history_contexts;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#include <ofono/modem.h>
|
||||||
|
|
||||||
unsigned int __ofono_modem_alloc_callid(struct ofono_modem *modem);
|
unsigned int __ofono_modem_alloc_callid(struct ofono_modem *modem);
|
||||||
void __ofono_modem_release_callid(struct ofono_modem *modem, int id);
|
void __ofono_modem_release_callid(struct ofono_modem *modem, int id);
|
||||||
|
|
||||||
|
|
|
@ -525,7 +525,7 @@ int ofono_phonebook_register(struct ofono_modem *modem,
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
modem_add_interface(modem, PHONEBOOK_INTERFACE);
|
ofono_modem_add_interface(modem, PHONEBOOK_INTERFACE);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,7 +536,7 @@ void ofono_phonebook_unregister(struct ofono_modem *modem)
|
||||||
if (modem->phonebook == NULL)
|
if (modem->phonebook == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
modem_remove_interface(modem, PHONEBOOK_INTERFACE);
|
ofono_modem_remove_interface(modem, PHONEBOOK_INTERFACE);
|
||||||
g_dbus_unregister_interface(conn, modem->path,
|
g_dbus_unregister_interface(conn, modem->path,
|
||||||
PHONEBOOK_INTERFACE);
|
PHONEBOOK_INTERFACE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -666,7 +666,7 @@ static void initialize_sim_manager(struct ofono_modem *modem)
|
||||||
ofono_debug("SIMManager interface for modem: %s created",
|
ofono_debug("SIMManager interface for modem: %s created",
|
||||||
modem->path);
|
modem->path);
|
||||||
|
|
||||||
modem_add_interface(modem, SIM_MANAGER_INTERFACE);
|
ofono_modem_add_interface(modem, SIM_MANAGER_INTERFACE);
|
||||||
|
|
||||||
ofono_sim_ready_notify_register(modem, sim_ready);
|
ofono_sim_ready_notify_register(modem, sim_ready);
|
||||||
|
|
||||||
|
@ -775,7 +775,7 @@ void ofono_sim_manager_unregister(struct ofono_modem *modem)
|
||||||
|
|
||||||
g_dbus_unregister_interface(conn, modem->path,
|
g_dbus_unregister_interface(conn, modem->path,
|
||||||
SIM_MANAGER_INTERFACE);
|
SIM_MANAGER_INTERFACE);
|
||||||
modem_remove_interface(modem, SIM_MANAGER_INTERFACE);
|
ofono_modem_remove_interface(modem, SIM_MANAGER_INTERFACE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ofono_sim_manager_init(struct ofono_modem *modem)
|
void ofono_sim_manager_init(struct ofono_modem *modem)
|
||||||
|
|
|
@ -812,7 +812,7 @@ int ofono_sms_manager_register(struct ofono_modem *modem,
|
||||||
ofono_debug("SmsManager interface for modem: %s created",
|
ofono_debug("SmsManager interface for modem: %s created",
|
||||||
modem->path);
|
modem->path);
|
||||||
|
|
||||||
modem_add_interface(modem, SMS_MANAGER_INTERFACE);
|
ofono_modem_add_interface(modem, SMS_MANAGER_INTERFACE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -824,5 +824,5 @@ void ofono_sms_manager_unregister(struct ofono_modem *modem)
|
||||||
g_dbus_unregister_interface(conn, modem->path,
|
g_dbus_unregister_interface(conn, modem->path,
|
||||||
SMS_MANAGER_INTERFACE);
|
SMS_MANAGER_INTERFACE);
|
||||||
|
|
||||||
modem_remove_interface(modem, SMS_MANAGER_INTERFACE);
|
ofono_modem_remove_interface(modem, SMS_MANAGER_INTERFACE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -572,7 +572,7 @@ int ofono_ussd_register(struct ofono_modem *modem, struct ofono_ussd_ops *ops)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
modem_add_interface(modem, SUPPLEMENTARY_SERVICES_INTERFACE);
|
ofono_modem_add_interface(modem, SUPPLEMENTARY_SERVICES_INTERFACE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -584,7 +584,7 @@ void ofono_ussd_unregister(struct ofono_modem *modem)
|
||||||
if (modem->ussd == NULL)
|
if (modem->ussd == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
modem_remove_interface(modem, SUPPLEMENTARY_SERVICES_INTERFACE);
|
ofono_modem_remove_interface(modem, SUPPLEMENTARY_SERVICES_INTERFACE);
|
||||||
g_dbus_unregister_interface(conn, modem->path,
|
g_dbus_unregister_interface(conn, modem->path,
|
||||||
SUPPLEMENTARY_SERVICES_INTERFACE);
|
SUPPLEMENTARY_SERVICES_INTERFACE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1677,7 +1677,7 @@ int ofono_voicecall_register(struct ofono_modem *modem, struct ofono_voicecall_o
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
modem_add_interface(modem, VOICECALL_MANAGER_INTERFACE);
|
ofono_modem_add_interface(modem, VOICECALL_MANAGER_INTERFACE);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -1689,7 +1689,7 @@ void ofono_voicecall_unregister(struct ofono_modem *modem)
|
||||||
if (!modem->voicecalls)
|
if (!modem->voicecalls)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
modem_remove_interface(modem, VOICECALL_MANAGER_INTERFACE);
|
ofono_modem_remove_interface(modem, VOICECALL_MANAGER_INTERFACE);
|
||||||
g_dbus_unregister_interface(conn, modem->path,
|
g_dbus_unregister_interface(conn, modem->path,
|
||||||
VOICECALL_MANAGER_INTERFACE);
|
VOICECALL_MANAGER_INTERFACE);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue