mirror of git://git.sysmocom.de/ofono
Rename ofono_modem_userdata
This commit is contained in:
parent
4fbca244ea
commit
cb75833fc8
|
@ -203,7 +203,7 @@ static void at_query_manufacturer(struct ofono_modem *modem,
|
|||
ofono_modem_attribute_query_cb_t cb, void *data)
|
||||
{
|
||||
struct attr_cb_info *info = attr_cb_info_new(cb, data, "+CGMI:");
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!info)
|
||||
goto error;
|
||||
|
@ -226,7 +226,7 @@ static void at_query_model(struct ofono_modem *modem,
|
|||
ofono_modem_attribute_query_cb_t cb, void *data)
|
||||
{
|
||||
struct attr_cb_info *info = attr_cb_info_new(cb, data, "+CGMM:");
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!info)
|
||||
goto error;
|
||||
|
@ -249,7 +249,7 @@ static void at_query_revision(struct ofono_modem *modem,
|
|||
ofono_modem_attribute_query_cb_t cb, void *data)
|
||||
{
|
||||
struct attr_cb_info *info = attr_cb_info_new(cb, data, "+CGMR:");
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!info)
|
||||
goto error;
|
||||
|
@ -272,7 +272,7 @@ static void at_query_serial(struct ofono_modem *modem,
|
|||
ofono_modem_attribute_query_cb_t cb, void *data)
|
||||
{
|
||||
struct attr_cb_info *info = attr_cb_info_new(cb, data, "+CGSN:");
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!info)
|
||||
goto error;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
|
||||
#include "gatchat.h"
|
||||
|
@ -81,7 +82,7 @@ static void at_call_barring_query(struct ofono_modem *modem, const char *lock,
|
|||
int cls, ofono_call_barring_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
int len;
|
||||
|
@ -120,7 +121,7 @@ static void at_call_barring_set(struct ofono_modem *modem, const char *lock,
|
|||
int enable, const char *passwd, int cls,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
int len;
|
||||
|
@ -168,7 +169,7 @@ static void at_call_barring_set_passwd(struct ofono_modem *modem,
|
|||
const char *old_passwd, const char *new_passwd,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
|
||||
#include "gatchat.h"
|
||||
|
@ -124,7 +125,7 @@ out:
|
|||
static void at_ccfc_query(struct ofono_modem *modem, int type, int cls,
|
||||
ofono_call_forwarding_query_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -167,7 +168,7 @@ static void ccfc_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_ccfc_set(struct ofono_modem *modem, const char *buf,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
|
||||
#include "gatchat.h"
|
||||
|
@ -112,7 +113,7 @@ static void cccm_notify(GAtResult *result, gpointer user_data)
|
|||
static void at_caoc_query(struct ofono_modem *modem, ofono_call_meter_query_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -136,7 +137,7 @@ error:
|
|||
static void at_cacm_query(struct ofono_modem *modem, ofono_call_meter_query_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -172,7 +173,7 @@ static void generic_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_cacm_set(struct ofono_modem *modem, const char *passwd,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -198,7 +199,7 @@ error:
|
|||
static void at_camm_query(struct ofono_modem *modem, ofono_call_meter_query_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -222,7 +223,7 @@ error:
|
|||
static void at_camm_set(struct ofono_modem *modem, int accmax, const char *passwd,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -285,7 +286,7 @@ static void cpuc_query_cb(gboolean ok,
|
|||
static void at_cpuc_query(struct ofono_modem *modem,
|
||||
ofono_call_meter_puct_query_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -310,7 +311,7 @@ static void at_cpuc_set(struct ofono_modem *modem, const char *currency,
|
|||
double ppu, const char *passwd, ofono_generic_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -362,7 +363,7 @@ static void at_call_meter_initialized(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
g_at_chat_register(at->parser, "+CCCM:",
|
||||
cccm_notify, FALSE, modem, NULL);
|
||||
|
@ -374,7 +375,7 @@ static void at_call_meter_initialized(gboolean ok, GAtResult *result,
|
|||
|
||||
void at_call_meter_init(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
g_at_chat_send(at->parser, "AT+CAOC=2", NULL, NULL, NULL, NULL);
|
||||
g_at_chat_send(at->parser, "AT+CCWE=1", NULL,
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
|
||||
#include "gatchat.h"
|
||||
|
@ -79,7 +80,7 @@ out:
|
|||
static void at_ccwa_query(struct ofono_modem *modem, int cls,
|
||||
ofono_call_waiting_status_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -122,7 +123,7 @@ static void ccwa_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_ccwa_set(struct ofono_modem *modem, int mode, int cls,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -183,7 +184,7 @@ static void clip_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_clip_query(struct ofono_modem *modem,
|
||||
ofono_call_setting_status_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -240,7 +241,7 @@ static void colp_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_colp_query(struct ofono_modem *modem,
|
||||
ofono_call_setting_status_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -297,7 +298,7 @@ static void clir_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_clir_query(struct ofono_modem *modem,
|
||||
ofono_clir_setting_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -332,7 +333,7 @@ static void clir_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_clir_set(struct ofono_modem *modem, int mode,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
|
||||
#include "gatchat.h"
|
||||
|
@ -113,7 +114,7 @@ static void at_registration_status(struct ofono_modem *modem,
|
|||
ofono_registration_status_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -136,7 +137,7 @@ error:
|
|||
static void cops_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(cbd->modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(cbd->modem);
|
||||
ofono_current_operator_cb_t cb = cbd->cb;
|
||||
struct ofono_network_operator op;
|
||||
GAtResultIter iter;
|
||||
|
@ -206,7 +207,7 @@ error:
|
|||
static void cops_numeric_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(cbd->modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(cbd->modem);
|
||||
GAtResultIter iter;
|
||||
const char *str;
|
||||
int format;
|
||||
|
@ -247,7 +248,7 @@ error:
|
|||
static void at_current_operator(struct ofono_modem *modem,
|
||||
ofono_current_operator_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
gboolean ok;
|
||||
|
||||
|
@ -388,7 +389,7 @@ static void cops_list_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_list_operators(struct ofono_modem *modem, ofono_operator_list_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -423,7 +424,7 @@ static void register_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_register_auto(struct ofono_modem *modem, ofono_generic_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -447,7 +448,7 @@ static void at_register_manual(struct ofono_modem *modem,
|
|||
const struct ofono_network_operator *oper,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[128];
|
||||
|
||||
|
@ -473,7 +474,7 @@ error:
|
|||
static void at_deregister(struct ofono_modem *modem, ofono_generic_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -559,7 +560,7 @@ static void csq_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_signal_strength(struct ofono_modem *modem,
|
||||
ofono_signal_strength_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -628,7 +629,7 @@ static void at_network_registration_initialized(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!ok) {
|
||||
ofono_error("Unable to initialize Network Registration");
|
||||
|
@ -645,7 +646,7 @@ static void at_network_registration_initialized(gboolean ok, GAtResult *result,
|
|||
|
||||
void at_network_registration_init(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
at->netreg = g_try_new0(struct netreg_data, 1);
|
||||
|
||||
|
@ -659,7 +660,7 @@ void at_network_registration_init(struct ofono_modem *modem)
|
|||
|
||||
void at_network_registration_exit(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!at->netreg)
|
||||
return;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
#include "util.h"
|
||||
|
||||
|
@ -102,7 +103,7 @@ static void at_cpbr_notify(GAtResult *result, gpointer user_data)
|
|||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct ofono_modem *modem = cbd->modem;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
GAtResultIter iter;
|
||||
int current;
|
||||
|
||||
|
@ -202,7 +203,7 @@ static void at_cpbr_notify(GAtResult *result, gpointer user_data)
|
|||
static void export_failed(struct cb_data *cbd)
|
||||
{
|
||||
struct ofono_modem *modem = cbd->modem;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
ofono_generic_cb_t cb = cbd->cb;
|
||||
|
||||
{
|
||||
|
@ -223,7 +224,7 @@ static void at_read_entries_cb(gboolean ok, GAtResult *result,
|
|||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct ofono_modem *modem = cbd->modem;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
ofono_generic_cb_t cb = cbd->cb;
|
||||
const char *charset;
|
||||
struct ofono_error error;
|
||||
|
@ -247,7 +248,7 @@ static void at_read_entries_cb(gboolean ok, GAtResult *result,
|
|||
static void at_read_entries(struct cb_data *cbd)
|
||||
{
|
||||
struct ofono_modem *modem = cbd->modem;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
char buf[32];
|
||||
|
||||
sprintf(buf, "AT+CPBR=%d,%d", at->pb->index_min, at->pb->index_max);
|
||||
|
@ -280,7 +281,7 @@ static void at_read_charset_cb(gboolean ok, GAtResult *result,
|
|||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct ofono_modem *modem = cbd->modem;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
GAtResultIter iter;
|
||||
const char *charset;
|
||||
char buf[32];
|
||||
|
@ -320,7 +321,7 @@ static void at_list_indices_cb(gboolean ok, GAtResult *result,
|
|||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct ofono_modem *modem = cbd->modem;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
GAtResultIter iter;
|
||||
|
||||
if (!ok)
|
||||
|
@ -356,7 +357,7 @@ static void at_select_storage_cb(gboolean ok, GAtResult *result,
|
|||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct ofono_modem *modem = cbd->modem;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
dump_response("at_select_storage_cb", ok, result);
|
||||
|
||||
|
@ -374,7 +375,7 @@ error:
|
|||
static void at_export_entries(struct ofono_modem *modem, const char *storage,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[32];
|
||||
|
||||
|
@ -402,7 +403,7 @@ static struct ofono_phonebook_ops ops = {
|
|||
|
||||
static void phonebook_not_supported(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
ofono_error("Phonebook not supported by this modem. If this is in "
|
||||
"error please submit patches to support this hardware");
|
||||
|
@ -459,7 +460,7 @@ static void at_list_charsets_cb(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
gboolean in_list = FALSE;
|
||||
GAtResultIter iter;
|
||||
const char *charset;
|
||||
|
@ -516,7 +517,7 @@ error:
|
|||
|
||||
static void at_list_charsets(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (g_at_chat_send(at->parser, "AT+CSCS=?", cscs_prefix,
|
||||
at_list_charsets_cb, modem, NULL) > 0)
|
||||
|
@ -527,7 +528,7 @@ static void at_list_charsets(struct ofono_modem *modem)
|
|||
|
||||
void at_phonebook_init(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
at->pb = phonebook_create();
|
||||
at_list_charsets(modem);
|
||||
|
@ -535,7 +536,7 @@ void at_phonebook_init(struct ofono_modem *modem)
|
|||
|
||||
void at_phonebook_exit(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!at->pb)
|
||||
return;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
|
||||
#include "gatchat.h"
|
||||
|
@ -104,7 +105,7 @@ static void at_sim_read_info(struct ofono_modem *modem, int fileid,
|
|||
ofono_sim_file_info_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -175,7 +176,7 @@ static void at_sim_read_binary(struct ofono_modem *modem, int fileid,
|
|||
int start, int length,
|
||||
ofono_sim_read_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -203,7 +204,7 @@ static void at_sim_read_record(struct ofono_modem *modem, int fileid,
|
|||
int record, int length,
|
||||
ofono_sim_read_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -274,7 +275,7 @@ static void at_sim_update_binary(struct ofono_modem *modem, int fileid,
|
|||
const unsigned char *value,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char *buf = g_try_new(char, 36 + length * 2);
|
||||
int len, ret;
|
||||
|
@ -311,7 +312,7 @@ static void at_sim_update_record(struct ofono_modem *modem, int fileid,
|
|||
const unsigned char *value,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char *buf = g_try_new(char, 36 + length * 2);
|
||||
int len, ret;
|
||||
|
@ -347,7 +348,7 @@ static void at_sim_update_cyclic(struct ofono_modem *modem, int fileid,
|
|||
int length, const unsigned char *value,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char *buf = g_try_new(char, 36 + length * 2);
|
||||
int len, ret;
|
||||
|
@ -410,7 +411,7 @@ static void at_cimi_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_read_imsi(struct ofono_modem *modem, ofono_imsi_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
#include "smsutil.h"
|
||||
#include "util.h"
|
||||
|
@ -108,7 +109,7 @@ static void at_csca_set(struct ofono_modem *modem,
|
|||
const struct ofono_phone_number *sca,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[64];
|
||||
|
||||
|
@ -183,7 +184,7 @@ err:
|
|||
static void at_csca_query(struct ofono_modem *modem, ofono_sca_query_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -243,7 +244,7 @@ static void at_cmgs(struct ofono_modem *modem, unsigned char *pdu, int pdu_len,
|
|||
int tpdu_len, int mms, ofono_sms_submit_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[512];
|
||||
int len;
|
||||
|
@ -326,7 +327,7 @@ static void at_cbm_notify(GAtResult *result, gpointer user_data)
|
|||
static void at_cds_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
int pdulen;
|
||||
const char *pdu;
|
||||
char buf[256];
|
||||
|
@ -353,7 +354,7 @@ static void at_cds_notify(GAtResult *result, gpointer user_data)
|
|||
static void at_cmt_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
const char *hexpdu;
|
||||
long pdu_len;
|
||||
int tpdu_len;
|
||||
|
@ -435,7 +436,7 @@ static void at_cmti_cpms_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
{
|
||||
struct cpms_request *req = user_data;
|
||||
struct ofono_modem *modem = req->modem;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
char buf[128];
|
||||
|
||||
if (!ok) {
|
||||
|
@ -456,7 +457,7 @@ static void at_cmti_cpms_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_cmti_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
const char *strstore;
|
||||
int store;
|
||||
GAtResultIter iter;
|
||||
|
@ -516,7 +517,7 @@ err:
|
|||
|
||||
static void at_sms_initialized(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
g_at_chat_register(at->parser, "+CMTI:", at_cmti_notify, FALSE,
|
||||
modem, NULL);
|
||||
|
@ -536,7 +537,7 @@ static void at_sms_initialized(struct ofono_modem *modem)
|
|||
|
||||
static void at_sms_not_supported(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
ofono_error("SMS not supported by this modem. If this is in error"
|
||||
" please submit patches to support this hardware");
|
||||
|
@ -651,7 +652,7 @@ err:
|
|||
static void at_cnmi_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
GAtResultIter iter;
|
||||
int cnmi_opts[5]; /* See 27.005 Section 3.4.1 */
|
||||
int opt;
|
||||
|
@ -702,7 +703,7 @@ out:
|
|||
|
||||
static void at_query_cnmi(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
g_at_chat_send(at->parser, "AT+CNMI=?", cnmi_prefix,
|
||||
at_cnmi_query_cb, modem, NULL);
|
||||
|
@ -711,7 +712,7 @@ static void at_query_cnmi(struct ofono_modem *modem)
|
|||
static void at_cpms_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
dump_response("at_cpms_set_cb", ok, result);
|
||||
|
||||
|
@ -731,7 +732,7 @@ static void at_cpms_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static gboolean set_cpms(gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
const char *store = storages[at->sms->store];
|
||||
const char *incoming = storages[at->sms->incoming];
|
||||
char buf[128];
|
||||
|
@ -746,7 +747,7 @@ static gboolean set_cpms(gpointer user_data)
|
|||
static void at_cmgf_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
dump_response("at_cmgf_set_cb", ok, result);
|
||||
|
||||
|
@ -769,7 +770,7 @@ static void at_cmgf_set_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static gboolean set_cmgf(gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
g_at_chat_send(at->parser, "AT+CMGF=0", cmgf_prefix,
|
||||
at_cmgf_set_cb, modem, NULL);
|
||||
|
@ -780,7 +781,7 @@ static void at_cpms_query_cb(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
gboolean supported = FALSE;
|
||||
|
||||
dump_response("cpms_query_cb", ok, result);
|
||||
|
@ -856,7 +857,7 @@ static void at_cmgf_query_cb(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
gboolean supported = FALSE;
|
||||
|
||||
dump_response("cmgf_query_cb", ok, result);
|
||||
|
@ -891,7 +892,7 @@ static void at_csms_status_cb(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
gboolean supported = FALSE;
|
||||
|
||||
dump_response("csms_status_cb", ok, result);
|
||||
|
@ -936,7 +937,7 @@ static void at_csms_set_cb(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
g_at_chat_send(at->parser, "AT+CSMS?", csms_prefix,
|
||||
at_csms_status_cb, modem, NULL);
|
||||
|
@ -946,7 +947,7 @@ static void at_csms_query_cb(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
gboolean cnma_supported = FALSE;
|
||||
GAtResultIter iter;
|
||||
int status;
|
||||
|
@ -984,7 +985,7 @@ out:
|
|||
|
||||
void at_sms_init(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
g_at_chat_send(at->parser, "AT+CSMS=?", csms_prefix,
|
||||
at_csms_query_cb, modem, NULL);
|
||||
|
@ -992,7 +993,7 @@ void at_sms_init(struct ofono_modem *modem)
|
|||
|
||||
void at_sms_exit(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!at->sms)
|
||||
return;
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
#include "util.h"
|
||||
|
||||
|
@ -56,7 +57,7 @@ static void cusd_request_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_ussd_request(struct ofono_modem *modem, const char *str,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
unsigned char *converted;
|
||||
int dcs;
|
||||
|
@ -113,7 +114,7 @@ static void cusd_cancel_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_ussd_cancel(struct ofono_modem *modem,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include <glib.h>
|
||||
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
|
||||
#include "gatchat.h"
|
||||
|
@ -238,7 +239,7 @@ static GSList *parse_clcc(GAtResult *result)
|
|||
static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
GSList *calls;
|
||||
GSList *n, *o;
|
||||
struct ofono_call *nc, *oc;
|
||||
|
@ -320,7 +321,7 @@ static void clcc_poll_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static gboolean poll_clcc(gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
g_at_chat_send(at->parser, "AT+CLCC", clcc_prefix,
|
||||
clcc_poll_cb, modem, NULL);
|
||||
|
@ -333,7 +334,7 @@ static gboolean poll_clcc(gpointer user_data)
|
|||
static void generic_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(cbd->modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(cbd->modem);
|
||||
ofono_generic_cb_t cb = cbd->cb;
|
||||
unsigned int released_status = GPOINTER_TO_UINT(cbd->user);
|
||||
struct ofono_error error;
|
||||
|
@ -366,7 +367,7 @@ static void release_id_cb(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(cbd->modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(cbd->modem);
|
||||
ofono_generic_cb_t cb = cbd->cb;
|
||||
struct ofono_error error;
|
||||
|
||||
|
@ -386,7 +387,7 @@ static void release_id_cb(gboolean ok, GAtResult *result,
|
|||
static void atd_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct cb_data *cbd = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(cbd->modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(cbd->modem);
|
||||
ofono_generic_cb_t cb = cbd->cb;
|
||||
GAtResultIter iter;
|
||||
const char *num;
|
||||
|
@ -446,7 +447,7 @@ static void at_dial(struct ofono_modem *modem,
|
|||
enum ofono_clir_option clir, enum ofono_cug_option cug,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[256];
|
||||
|
||||
|
@ -497,7 +498,7 @@ static void at_template(const char *cmd, struct ofono_modem *modem,
|
|||
GAtResultFunc result_cb, unsigned int released_status,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -579,7 +580,7 @@ out:
|
|||
static void at_list_calls(struct ofono_modem *modem, ofono_call_list_cb_t cb,
|
||||
void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
|
||||
if (!cbd)
|
||||
|
@ -629,7 +630,7 @@ static void at_release_all_active(struct ofono_modem *modem, ofono_generic_cb_t
|
|||
static void at_release_specific(struct ofono_modem *modem, int id,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
char buf[32];
|
||||
|
||||
|
@ -708,7 +709,7 @@ static void vts_cb(gboolean ok, GAtResult *result, gpointer user_data)
|
|||
static void at_send_dtmf(struct ofono_modem *modem, const char *dtmf,
|
||||
ofono_generic_cb_t cb, void *data)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct cb_data *cbd = cb_data_new(modem, cb, data);
|
||||
int len = strlen(dtmf);
|
||||
int s;
|
||||
|
@ -750,7 +751,7 @@ error:
|
|||
static void ring_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
struct ofono_call *call;
|
||||
|
||||
dump_response("ring_notify", TRUE, result);
|
||||
|
@ -776,7 +777,7 @@ static void ring_notify(GAtResult *result, gpointer user_data)
|
|||
static void cring_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
GAtResultIter iter;
|
||||
const char *line;
|
||||
int type;
|
||||
|
@ -822,7 +823,7 @@ static void cring_notify(GAtResult *result, gpointer user_data)
|
|||
static void clip_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
GAtResultIter iter;
|
||||
const char *num;
|
||||
int type, validity;
|
||||
|
@ -888,7 +889,7 @@ static void clip_notify(GAtResult *result, gpointer user_data)
|
|||
static void ccwa_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
GAtResultIter iter;
|
||||
const char *num;
|
||||
int num_type, validity, cls;
|
||||
|
@ -943,7 +944,7 @@ static void ccwa_notify(GAtResult *result, gpointer user_data)
|
|||
static void no_carrier_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (at->voicecall->poll_clcc)
|
||||
g_at_chat_send(at->parser, "AT+CLCC", clcc_prefix,
|
||||
|
@ -953,7 +954,7 @@ static void no_carrier_notify(GAtResult *result, gpointer user_data)
|
|||
static void no_answer_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (at->voicecall->poll_clcc)
|
||||
g_at_chat_send(at->parser, "AT+CLCC", clcc_prefix,
|
||||
|
@ -963,7 +964,7 @@ static void no_answer_notify(GAtResult *result, gpointer user_data)
|
|||
static void busy_notify(GAtResult *result, gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
/* Call was rejected, most likely due to network congestion
|
||||
* or UDUB on the other side
|
||||
|
@ -1057,7 +1058,7 @@ static void at_voicecall_initialized(gboolean ok, GAtResult *result,
|
|||
gpointer user_data)
|
||||
{
|
||||
struct ofono_modem *modem = user_data;
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
ofono_debug("voicecall_init: registering to notifications");
|
||||
|
||||
|
@ -1089,7 +1090,7 @@ static void at_voicecall_initialized(gboolean ok, GAtResult *result,
|
|||
|
||||
void at_voicecall_init(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
at->voicecall = g_try_new0(struct voicecall_data, 1);
|
||||
|
||||
|
@ -1110,7 +1111,7 @@ void at_voicecall_init(struct ofono_modem *modem)
|
|||
|
||||
void at_voicecall_exit(struct ofono_modem *modem)
|
||||
{
|
||||
struct at_data *at = ofono_modem_userdata(modem);
|
||||
struct at_data *at = ofono_modem_get_userdata(modem);
|
||||
|
||||
if (!at->voicecall)
|
||||
return;
|
||||
|
|
|
@ -35,6 +35,7 @@
|
|||
|
||||
#include <ofono/plugin.h>
|
||||
#include <ofono/log.h>
|
||||
#include <ofono/modem.h>
|
||||
#include "driver.h"
|
||||
|
||||
#include "isi.h"
|
||||
|
|
|
@ -26,6 +26,8 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct ofono_modem;
|
||||
|
||||
void ofono_modem_add_interface(struct ofono_modem *modem,
|
||||
const char *interface);
|
||||
|
||||
|
@ -34,6 +36,9 @@ void ofono_modem_remove_interface(struct ofono_modem *modem,
|
|||
|
||||
const char *ofono_modem_get_path(struct ofono_modem *modem);
|
||||
|
||||
void ofono_modem_set_userdata(struct ofono_modem *modem, void *data);
|
||||
void *ofono_modem_get_userdata(struct ofono_modem *modem);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -193,9 +193,6 @@ struct ofono_modem_attribute_ops {
|
|||
struct ofono_modem *ofono_modem_register(struct ofono_modem_attribute_ops *ops);
|
||||
int ofono_modem_unregister(struct ofono_modem *modem);
|
||||
|
||||
void ofono_modem_set_userdata(struct ofono_modem *modem, void *data);
|
||||
void *ofono_modem_userdata(struct ofono_modem *modem);
|
||||
|
||||
/* Network related functions, including registration status, operator selection
|
||||
* and signal strength indicators.
|
||||
*
|
||||
|
|
|
@ -85,7 +85,7 @@ void ofono_modem_set_userdata(struct ofono_modem *modem, void *userdata)
|
|||
modem->userdata = userdata;
|
||||
}
|
||||
|
||||
void *ofono_modem_userdata(struct ofono_modem *modem)
|
||||
void *ofono_modem_get_userdata(struct ofono_modem *modem)
|
||||
{
|
||||
if (modem)
|
||||
return modem->userdata;
|
||||
|
|
Loading…
Reference in New Issue