mirror of git://git.sysmocom.de/ofono
Evolve the netreg driver
This commit is contained in:
parent
a5617250a1
commit
5b1f5ba084
|
@ -4,7 +4,8 @@ includedir = @includedir@/ofono
|
||||||
include_HEADERS = log.h plugin.h history.h dbus.h modem.h \
|
include_HEADERS = log.h plugin.h history.h dbus.h modem.h \
|
||||||
types.h call-barring.h call-forwarding.h \
|
types.h call-barring.h call-forwarding.h \
|
||||||
call-meter.h call-settings.h phonebook.h \
|
call-meter.h call-settings.h phonebook.h \
|
||||||
ssn.h ussd.h sms.h sim.h message-waiting.h
|
ssn.h ussd.h sms.h sim.h message-waiting.h \
|
||||||
|
netreg.h
|
||||||
|
|
||||||
nodist_include_HEADERS = version.h
|
nodist_include_HEADERS = version.h
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,112 @@
|
||||||
|
/*
|
||||||
|
*
|
||||||
|
* 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_NETREG_H
|
||||||
|
#define __OFONO_NETREG_H
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <ofono/types.h>
|
||||||
|
|
||||||
|
struct ofono_netreg;
|
||||||
|
|
||||||
|
/* Theoretical limit is 16, but each GSM char can be encoded into
|
||||||
|
* * 3 UTF8 characters resulting in 16*3=48 chars
|
||||||
|
* */
|
||||||
|
#define OFONO_MAX_OPERATOR_NAME_LENGTH 63
|
||||||
|
|
||||||
|
struct ofono_network_operator {
|
||||||
|
char name[OFONO_MAX_OPERATOR_NAME_LENGTH + 1];
|
||||||
|
char mcc[OFONO_MAX_MCC_LENGTH + 1];
|
||||||
|
char mnc[OFONO_MAX_MNC_LENGTH + 1];
|
||||||
|
int status;
|
||||||
|
int tech;
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef void (*ofono_netreg_operator_cb_t)(const struct ofono_error *error,
|
||||||
|
const struct ofono_network_operator *op,
|
||||||
|
void *data);
|
||||||
|
|
||||||
|
typedef void (*ofono_netreg_register_cb_t)(const struct ofono_error *error,
|
||||||
|
void *data);
|
||||||
|
|
||||||
|
typedef void (*ofono_netreg_operator_list_cb_t)(const struct ofono_error *error,
|
||||||
|
int total,
|
||||||
|
const struct ofono_network_operator *list,
|
||||||
|
void *data);
|
||||||
|
|
||||||
|
typedef void (*ofono_netreg_status_cb_t)(const struct ofono_error *error,
|
||||||
|
int status, int lac, int ci, int tech,
|
||||||
|
void *data);
|
||||||
|
|
||||||
|
typedef void (*ofono_netreg_strength_cb_t)(const struct ofono_error *error,
|
||||||
|
int strength, void *data);
|
||||||
|
|
||||||
|
/* Network related functions, including registration status, operator selection
|
||||||
|
* and signal strength indicators.
|
||||||
|
*
|
||||||
|
* It is up to the plugin to implement CSQ polling if the modem does not support
|
||||||
|
* vendor extensions for signal strength notification.
|
||||||
|
*/
|
||||||
|
struct ofono_netreg_driver {
|
||||||
|
const char *name;
|
||||||
|
int (*probe)(struct ofono_netreg *netreg);
|
||||||
|
int (*remove)(struct ofono_netreg *netreg);
|
||||||
|
void (*registration_status)(struct ofono_netreg *netreg,
|
||||||
|
ofono_netreg_status_cb_t cb, void *data);
|
||||||
|
void (*current_operator)(struct ofono_netreg *netreg,
|
||||||
|
ofono_netreg_operator_cb_t cb, void *data);
|
||||||
|
void (*list_operators)(struct ofono_netreg *netreg,
|
||||||
|
ofono_netreg_operator_list_cb_t cb, void *data);
|
||||||
|
void (*register_auto)(struct ofono_netreg *netreg,
|
||||||
|
ofono_netreg_register_cb_t cb, void *data);
|
||||||
|
void (*register_manual)(struct ofono_netreg *netreg,
|
||||||
|
const struct ofono_network_operator *oper,
|
||||||
|
ofono_netreg_register_cb_t cb, void *data);
|
||||||
|
void (*deregister)(struct ofono_netreg *netreg,
|
||||||
|
ofono_netreg_register_cb_t cb, void *data);
|
||||||
|
void (*strength)(struct ofono_netreg *netreg,
|
||||||
|
ofono_netreg_strength_cb_t, void *data);
|
||||||
|
};
|
||||||
|
|
||||||
|
void ofono_netreg_strength_notify(struct ofono_netreg *netreg, int strength);
|
||||||
|
void ofono_netreg_status_notify(struct ofono_netreg *netreg, int status,
|
||||||
|
int lac, int ci, int tech);
|
||||||
|
|
||||||
|
int ofono_netreg_driver_register(const struct ofono_netreg_driver *d);
|
||||||
|
void ofono_netreg_driver_unregister(const struct ofono_netreg_driver *d);
|
||||||
|
|
||||||
|
struct ofono_netreg *ofono_netreg_create(struct ofono_modem *modem,
|
||||||
|
const char *driver, void *data);
|
||||||
|
|
||||||
|
void ofono_netreg_register(struct ofono_netreg *netreg);
|
||||||
|
void ofono_netreg_remove(struct ofono_netreg *netreg);
|
||||||
|
|
||||||
|
void ofono_netreg_set_data(struct ofono_netreg *netreg, void *data);
|
||||||
|
void *ofono_netreg_get_data(struct ofono_netreg *netreg);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* __OFONO_SSN_H */
|
60
src/driver.h
60
src/driver.h
|
@ -39,19 +39,6 @@ struct ofono_call {
|
||||||
int clip_validity;
|
int clip_validity;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Theoretical limit is 16, but each GSM char can be encoded into
|
|
||||||
* * 3 UTF8 characters resulting in 16*3=48 chars
|
|
||||||
* */
|
|
||||||
#define OFONO_MAX_OPERATOR_NAME_LENGTH 63
|
|
||||||
|
|
||||||
struct ofono_network_operator {
|
|
||||||
char name[OFONO_MAX_OPERATOR_NAME_LENGTH + 1];
|
|
||||||
char mcc[OFONO_MAX_MCC_LENGTH + 1];
|
|
||||||
char mnc[OFONO_MAX_MNC_LENGTH + 1];
|
|
||||||
int status;
|
|
||||||
int tech;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Notification functions, the integer values here should map to
|
/* Notification functions, the integer values here should map to
|
||||||
* values obtained from the modem. The enumerations are the same
|
* values obtained from the modem. The enumerations are the same
|
||||||
* as the values for the fields found in 3GPP TS 27.007
|
* as the values for the fields found in 3GPP TS 27.007
|
||||||
|
@ -67,22 +54,6 @@ typedef void (*ofono_call_list_cb_t)(const struct ofono_error *error,
|
||||||
const struct ofono_call *call_list,
|
const struct ofono_call *call_list,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
typedef void (*ofono_current_operator_cb_t)(const struct ofono_error *error,
|
|
||||||
const struct ofono_network_operator *op,
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
typedef void (*ofono_operator_list_cb_t)(const struct ofono_error *error,
|
|
||||||
int total,
|
|
||||||
const struct ofono_network_operator *list,
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
typedef void (*ofono_registration_status_cb_t)(const struct ofono_error *error,
|
|
||||||
int status, int lac, int ci, int tech,
|
|
||||||
void *data);
|
|
||||||
|
|
||||||
typedef void (*ofono_signal_strength_cb_t)(const struct ofono_error *error,
|
|
||||||
int strength, void *data);
|
|
||||||
|
|
||||||
typedef void (*ofono_modem_attribute_query_cb_t)(const struct ofono_error *error,
|
typedef void (*ofono_modem_attribute_query_cb_t)(const struct ofono_error *error,
|
||||||
const char *attribute, void *data);
|
const char *attribute, void *data);
|
||||||
|
|
||||||
|
@ -100,37 +71,6 @@ struct ofono_modem_attribute_ops {
|
||||||
struct ofono_modem *ofono_modem_register(struct ofono_modem_attribute_ops *ops);
|
struct ofono_modem *ofono_modem_register(struct ofono_modem_attribute_ops *ops);
|
||||||
int ofono_modem_unregister(struct ofono_modem *modem);
|
int ofono_modem_unregister(struct ofono_modem *modem);
|
||||||
|
|
||||||
/* Network related functions, including registration status, operator selection
|
|
||||||
* and signal strength indicators.
|
|
||||||
*
|
|
||||||
* It is up to the plugin to implement CSQ polling if the modem does not support
|
|
||||||
* vendor extensions for signal strength notification.
|
|
||||||
*/
|
|
||||||
struct ofono_network_registration_ops {
|
|
||||||
void (*registration_status)(struct ofono_modem *modem,
|
|
||||||
ofono_registration_status_cb_t cb, void *data);
|
|
||||||
void (*current_operator)(struct ofono_modem *modem,
|
|
||||||
ofono_current_operator_cb_t cb, void *data);
|
|
||||||
void (*list_operators)(struct ofono_modem *modem,
|
|
||||||
ofono_operator_list_cb_t cb, void *data);
|
|
||||||
void (*register_auto)(struct ofono_modem *modem,
|
|
||||||
ofono_generic_cb_t cb, void *data);
|
|
||||||
void (*register_manual)(struct ofono_modem *modem,
|
|
||||||
const struct ofono_network_operator *oper,
|
|
||||||
ofono_generic_cb_t cb, void *data);
|
|
||||||
void (*deregister)(struct ofono_modem *modem,
|
|
||||||
ofono_generic_cb_t cb, void *data);
|
|
||||||
void (*signal_strength)(struct ofono_modem *modem,
|
|
||||||
ofono_signal_strength_cb_t, void *data);
|
|
||||||
};
|
|
||||||
|
|
||||||
void ofono_signal_strength_notify(struct ofono_modem *modem, int strength);
|
|
||||||
void ofono_network_registration_notify(struct ofono_modem *modem, int status,
|
|
||||||
int lac, int ci, int tech);
|
|
||||||
int ofono_network_registration_register(struct ofono_modem *modem,
|
|
||||||
struct ofono_network_registration_ops *ops);
|
|
||||||
void ofono_network_registration_unregister(struct ofono_modem *modem);
|
|
||||||
|
|
||||||
/* Voice call related functionality, including ATD, ATA, +CHLD, CTFR, CLCC
|
/* Voice call related functionality, including ATD, ATA, +CHLD, CTFR, CLCC
|
||||||
* and VTS.
|
* and VTS.
|
||||||
*
|
*
|
||||||
|
|
607
src/network.c
607
src/network.c
File diff suppressed because it is too large
Load Diff
|
@ -91,7 +91,7 @@ enum ofono_atom_type {
|
||||||
OFONO_ATOM_TYPE_CALL_FORWARDING = 2,
|
OFONO_ATOM_TYPE_CALL_FORWARDING = 2,
|
||||||
OFONO_ATOM_TYPE_CALL_METER = 3,
|
OFONO_ATOM_TYPE_CALL_METER = 3,
|
||||||
OFONO_ATOM_TYPE_CALL_SETTINGS = 4,
|
OFONO_ATOM_TYPE_CALL_SETTINGS = 4,
|
||||||
OFONO_ATOM_TYPE_NETWORK_REGISTRATION = 5,
|
OFONO_ATOM_TYPE_NETREG = 5,
|
||||||
OFONO_ATOM_TYPE_PHONEBOOK = 6,
|
OFONO_ATOM_TYPE_PHONEBOOK = 6,
|
||||||
OFONO_ATOM_TYPE_SMS = 7,
|
OFONO_ATOM_TYPE_SMS = 7,
|
||||||
OFONO_ATOM_TYPE_SIM = 8,
|
OFONO_ATOM_TYPE_SIM = 8,
|
||||||
|
@ -185,6 +185,8 @@ gboolean __ofono_ussd_passwd_register(struct ofono_ussd *ussd, const char *sc,
|
||||||
ofono_destroy_func destroy);
|
ofono_destroy_func destroy);
|
||||||
void __ofono_ussd_passwd_unregister(struct ofono_ussd *ussd, const char *sc);
|
void __ofono_ussd_passwd_unregister(struct ofono_ussd *ussd, const char *sc);
|
||||||
|
|
||||||
|
#include <ofono/netreg.h>
|
||||||
|
|
||||||
#include <ofono/history.h>
|
#include <ofono/history.h>
|
||||||
|
|
||||||
void __ofono_history_probe_drivers(struct ofono_modem *modem);
|
void __ofono_history_probe_drivers(struct ofono_modem *modem);
|
||||||
|
|
Loading…
Reference in New Issue