コード例 #1
0
ファイル: voicecall.c プロジェクト: jusa/ofono
static int ril_voicecall_probe(struct ofono_voicecall *vc, unsigned int vendor,
				void *data)
{
	GRil *ril = data;
	struct voicecall_data *vd;

	vd = g_try_new0(struct voicecall_data, 1);
	if (vd == NULL)
		return -ENOMEM;

	vd->ril = g_ril_clone(ril);
	vd->vendor = vendor;
	vd->tone_duration = TONE_DURATION;

	ofono_voicecall_set_data(vc, vd);

        /*
	 * TODO: analyze if capability check is needed
	 * and/or timer should be adjusted.
	 *
	 * ofono_voicecall_register() needs to be called after
	 * the driver has been set in ofono_voicecall_create(),
	 * which calls this function.  Most other drivers make
         * some kind of capabilities query to the modem, and then
	 * call register in the callback; we use a timer instead.
	 */
        g_timeout_add_seconds(2, ril_delayed_register, vc);

	return 0;
}
コード例 #2
0
ファイル: network-registration.c プロジェクト: saukko/ofono
static int ril_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
				void *data)
{
	GRil *ril = data;
	struct netreg_data *nd;

	nd = g_new0(struct netreg_data, 1);

	nd->ril = g_ril_clone(ril);
	nd->vendor = vendor;
	nd->tech = -1;
	nd->time.sec = -1;
	nd->time.min = -1;
	nd->time.hour = -1;
	nd->time.mday = -1;
	nd->time.mon = -1;
	nd->time.year = -1;
	nd->time.dst = 0;
	nd->time.utcoff = 0;
	ofono_netreg_set_data(netreg, nd);

        /*
	 * TODO: analyze if capability check is needed
	 * and/or timer should be adjusted.
	 *
	 * ofono_netreg_register() needs to be called after
	 * the driver has been set in ofono_netreg_create(),
	 * which calls this function.  Most other drivers make
	 * some kind of capabilities query to the modem, and then
	 * call register in the callback; we use a timer instead.
	 */
        g_timeout_add_seconds(1, ril_delayed_register, netreg);

	return 0;
}
コード例 #3
0
ファイル: gprs.c プロジェクト: mkuukkane/ofono
static int ril_gprs_probe(struct ofono_gprs *gprs,
				unsigned int vendor, void *data)
{
	GRil *ril = data;
	struct gprs_data *gd;

	gd = g_try_new0(struct gprs_data, 1);
	if (gd == NULL)
		return -ENOMEM;

	gd->ril = g_ril_clone(ril);
	gd->ofono_attached = FALSE;
	gd->max_cids = 0;
	gd->rild_status = -1;
	gd->true_status = -1;
	gd->notified = FALSE;
	gd->registerid = -1;
	gd->timer_id = 0;
	gd->fake_timer_id = 0;
	gd->fake_cbd = NULL;

	registered = FALSE;

	ofono_gprs_set_data(gprs, gd);

	ril_gprs_registration_status(gprs, NULL, NULL);

	return 0;
}
コード例 #4
0
ファイル: sms.c プロジェクト: leinomii/ofono
static int ril_sms_probe(struct ofono_sms *sms, unsigned int vendor,
				void *user)
{
	GRil *ril = user;
	struct sms_data *data;

	data = g_new0(struct sms_data, 1);
	data->ril = g_ril_clone(ril);
	data->vendor = vendor;

	ofono_sms_set_data(sms, data);

	/*
	 * TODO: analyze if capability check is needed
	 * and/or timer should be adjusted.
	 *
	 * ofono_sms_register() needs to be called after
	 * the driver has been set in ofono_sms_create(), which
	 * calls this function.  Most other drivers make some
	 * kind of capabilities query to the modem, and then
	 * call register in the callback; we use a timer instead.
	 */
	data->timer_id = g_timeout_add_seconds(2, ril_delayed_register, sms);

	return 0;
}
コード例 #5
0
ファイル: devinfo.c プロジェクト: jusa/ofono
static int ril_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
				void *data)
{
	GRil *ril = NULL;

	if (data != NULL)
		ril = g_ril_clone(data);

	ofono_devinfo_set_data(info, ril);

	DBG("");

        /*
	 * TODO: analyze if capability check is needed
	 * and/or timer should be adjusted.
	 *
	 * ofono_devinfo_register() needs to be called after
	 * the driver has been set in ofono_devinfo_create(),
	 * which calls this function.  Most other drivers make
	 * some kind of capabilities query to the modem, and then
	 * call register in the callback; we use a timer instead.
	 */
        g_timeout_add_seconds(1, ril_delayed_register, info);

	return 0;
}
コード例 #6
0
ファイル: call-volume.c プロジェクト: dzemskov/ofono
static int ril_call_volume_probe(struct ofono_call_volume *cv,
					unsigned int vendor, void *data)
{
	GRil *ril = data;
	struct cv_data *cvd;

	cvd = g_new0(struct cv_data, 1);
	if (cvd == NULL)
		return -ENOMEM;

	cvd->ril = g_ril_clone(ril);
	cvd->vendor = vendor;

	ofono_call_volume_set_data(cv, cvd);

	/*
	 * ofono_call_volume_register() needs to be called after
	 * the driver has been set in ofono_call_volume_create(),
	 * which calls this function.  Most other drivers make
	 * some kind of capabilities query to the modem, and then
	 * call register in the callback; we use an idle event instead.
	 */
	g_idle_add(ril_delayed_register, cv);

	return 0;
}
コード例 #7
0
ファイル: network-registration.c プロジェクト: morphis/ofono
static int ril_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
				void *data)
{
	GRil *ril = data;
	struct netreg_data *nd;

	nd = g_new0(struct netreg_data, 1);

	nd->ril = g_ril_clone(ril);
	nd->vendor = vendor;
	nd->tech = RADIO_TECH_UNKNOWN;
	nd->time.sec = -1;
	nd->time.min = -1;
	nd->time.hour = -1;
	nd->time.mday = -1;
	nd->time.mon = -1;
	nd->time.year = -1;
	nd->time.dst = 0;
	nd->time.utcoff = 0;
	ofono_netreg_set_data(netreg, nd);

	/*
	 * ofono_netreg_register() needs to be called after
	 * the driver has been set in ofono_netreg_create(),
	 * which calls this function.  Most other drivers make
	 * some kind of capabilities query to the modem, and then
	 * call register in the callback; we use the idle loop here.
	 */
	g_idle_add(ril_delayed_register, netreg);

	return 0;
}
コード例 #8
0
ファイル: sim.c プロジェクト: impegoraro/ofono
static int ril_sim_probe(struct ofono_sim *sim, unsigned int vendor,
				void *data)
{
	GRil *ril = data;
	struct sim_data *sd;
	int i;

	DBG("");

	sd = g_new0(struct sim_data, 1);
	sd->ril = g_ril_clone(ril);

	for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
		sd->retries[i] = -1;

	current_sim = sim;

	ofono_sim_set_data(sim, sd);

	/*
	 * TODO: analyze if capability check is needed
	 * and/or timer should be adjusted.
	 *
	 * ofono_sim_register() needs to be called after the
	 * driver has been set in ofono_sim_create(), which
	 * calls this function.  Most other drivers make some
	 * kind of capabilities query to the modem, and then
	 * call register in the callback; we use an idle event
	 * instead.
	 */
	sd->idle_id = g_idle_add(ril_sim_register, sim);

	return 0;
}
コード例 #9
0
ファイル: ussd.c プロジェクト: leinomii/ofono
static int ril_ussd_probe(struct ofono_ussd *ussd,
					unsigned int vendor,
					void *user)
{
	GRil *ril = user;
	struct ussd_data *ud = g_try_new0(struct ussd_data, 1);
	ud->ril = g_ril_clone(ril);
	ofono_ussd_set_data(ussd, ud);
	ud->timer_id = g_timeout_add_seconds(2, ril_delayed_register, ussd);

	return 0;
}
コード例 #10
0
ファイル: call-barring.c プロジェクト: CODeRUS/ofono
static int ril_call_barring_probe(struct ofono_call_barring *cb,
					unsigned int vendor, void *user)
{
	GRil *ril = user;
	struct barring_data *bd = g_try_new0(struct barring_data, 1);

	bd->ril = g_ril_clone(ril);
	ofono_call_barring_set_data(cb, bd);
	bd->timer_id = g_timeout_add_seconds(2, ril_delayed_register, cb);

	return 0;
}
コード例 #11
0
ファイル: radio-settings.c プロジェクト: ClementFan/ofono
static int ril_radio_settings_probe(struct ofono_radio_settings *rs,
					unsigned int vendor,
					void *user)
{
	GRil *ril = user;
	struct radio_data *rsd = g_try_new0(struct radio_data, 1);
	rsd->ril = g_ril_clone(ril);
	ofono_radio_settings_set_data(rs, rsd);
	g_timeout_add_seconds(2, ril_delayed_register, rs);

	return 0;
}
コード例 #12
0
static int ril_call_settings_probe(struct ofono_call_settings *cs,
					unsigned int vendor, void *user)
{
	GRil *ril = user;
	struct settings_data *sd = g_new0(struct settings_data, 1);

	sd->ril = g_ril_clone(ril);

	ofono_call_settings_set_data(cs, sd);

	g_idle_add(ril_delayed_register, cs);

	return 0;
}
コード例 #13
0
ファイル: netmon.c プロジェクト: endocode/ofono
static int ril_netmon_probe(struct ofono_netmon *netmon,
		unsigned int vendor, void *user)
{
	GRil *ril = user;
	struct netmon_data *ud = g_new0(struct netmon_data, 1);

	ud->ril = g_ril_clone(ril);

	ofono_netmon_set_data(netmon, ud);

	g_idle_add(ril_delayed_register, netmon);

	return 0;
}
コード例 #14
0
ファイル: cbs.c プロジェクト: ClementFan/ofono
static int ril_cbs_probe(struct ofono_cbs *cbs, unsigned int vendor,
				void *user)
{
	GRil *ril = user;

	struct cbs_data *cd = g_try_new0(struct cbs_data, 1);

	cd->ril = g_ril_clone(ril);

	ofono_cbs_set_data(cbs, cd);

	g_timeout_add_seconds(2, ril_delayed_register, cbs);

	return 0;
}
コード例 #15
0
ファイル: call-barring.c プロジェクト: dzemskov/ofono
static int ril_call_barring_probe(struct ofono_call_barring *cb,
					unsigned int vendor, void *user)
{
	GRil *ril = user;
	struct barring_data *bd = g_try_new0(struct barring_data, 1);
	if (bd == NULL)
		return -ENOMEM;

	bd->ril = g_ril_clone(ril);
	ofono_call_barring_set_data(cb, bd);

	g_idle_add(ril_delayed_register, cb);

	return 0;
}
コード例 #16
0
ファイル: gprs.c プロジェクト: alfonsosanchezbeato/ofono
void ril_gprs_start(struct ril_gprs_driver_data *driver_data,
			struct ofono_gprs *gprs, struct ril_gprs_data *gd)
{
	gd->ril = g_ril_clone(driver_data->gril);
	gd->modem = driver_data->modem;
	gd->ofono_attached = FALSE;
	gd->max_cids = 0;
	gd->rild_status = -1;
	gd->tech = RADIO_TECH_UNKNOWN;
	/* AOSP RILD tracks data network state together with voice */
	gd->state_changed_unsol =
		RIL_UNSOL_RESPONSE_VOICE_NETWORK_STATE_CHANGED;

	ofono_gprs_set_data(gprs, gd);

	get_active_data_calls(gprs);
}
コード例 #17
0
ファイル: radio-settings.c プロジェクト: jpakkane/ofono
static int ril_radio_settings_probe(struct ofono_radio_settings *rs,
					unsigned int vendor, void *user)
{
	GRil *ril = user;
	struct radio_data *rsd = g_try_new0(struct radio_data, 1);

	if (rsd == NULL) {
		ofono_error("%s: cannot allocate memory", __func__);
		return -ENOMEM;
	}

	rsd->ril = g_ril_clone(ril);

	ofono_radio_settings_set_data(rs, rsd);
	g_idle_add(ril_delayed_register, rs);

	return 0;
}
コード例 #18
0
ファイル: radio-settings.c プロジェクト: morphis/ofono
static int mtk_radio_settings_probe(struct ofono_radio_settings *rs,
					unsigned int vendor, void *user)
{
	struct ril_radio_settings_driver_data* rs_init_data = user;
	struct radio_data *rsd = g_try_new0(struct radio_data, 1);

	if (rsd == NULL) {
		ofono_error("%s: cannot allocate memory", __func__);
		return -ENOMEM;
	}

	rsd->ril = g_ril_clone(rs_init_data->gril);
	rsd->modem = rs_init_data->modem;

	ofono_radio_settings_set_data(rs, rsd);

	mtk_set_fast_dormancy(rs, FALSE, ril_delayed_register, rs);

	return 0;
}
コード例 #19
0
ファイル: gprs-context.c プロジェクト: marttipiirainen/ofono
static int ril_gprs_context_probe(struct ofono_gprs_context *gc,
					unsigned int vendor, void *data)
{
	GRil *ril = data;
	struct gprs_context_data *gcd;

	gcd = g_try_new0(struct gprs_context_data, 1);
	if (gcd == NULL)
		return -ENOMEM;

	gcd->ril = g_ril_clone(ril);
	set_context_disconnected(gcd);

	ofono_gprs_context_set_data(gc, gcd);
	gcd->regid = -1;

	gcd->regid = g_ril_register(gcd->ril, RIL_UNSOL_DATA_CALL_LIST_CHANGED,
					ril_gprs_context_call_list_changed, gc);
	return 0;
}
コード例 #20
0
ファイル: devinfo.c プロジェクト: chihchun/ofono
static int ril_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
				void *data)
{
	GRil *ril = NULL;

	if (data != NULL)
		ril = g_ril_clone(data);

	ofono_devinfo_set_data(info, ril);

	/*
	 * ofono_devinfo_register() needs to be called after
	 * the driver has been set in ofono_devinfo_create(),
	 * which calls this function.  Most other drivers make
	 * some kind of capabilities query to the modem, and then
	 * call register in the callback; we use an idle event instead.
	 */
	g_idle_add(ril_delayed_register, info);

	return 0;
}
コード例 #21
0
ファイル: gprs.c プロジェクト: ClementFan/ofono
static int ril_gprs_probe(struct ofono_gprs *gprs,
				unsigned int vendor, void *data)
{
	GRil *ril = data;
	struct gprs_data *gd;

        DBG("");

	gd = g_try_new0(struct gprs_data, 1);
	if (gd == NULL)
		return -ENOMEM;

	gd->ril = g_ril_clone(ril);
	gd->max_cids = 0;
	gd->status = -1;

	ofono_gprs_set_data(gprs, gd);

	ril_gprs_registration_status(gprs, NULL, NULL);

	return 0;
}
コード例 #22
0
ファイル: sim.c プロジェクト: morphis/ofono
static int ril_sim_probe(struct ofono_sim *sim, unsigned int vendor,
				void *data)
{
	struct ril_sim_data *ril_data = data;
	GRil *ril = ril_data->gril;
	struct sim_data *sd;
	int i;

	sd = g_new0(struct sim_data, 1);
	sd->ril = g_ril_clone(ril);
	sd->vendor = vendor;
	sd->aid_str = NULL;
	sd->app_str = NULL;
	sd->app_type = RIL_APPTYPE_UNKNOWN;
	sd->passwd_state = OFONO_SIM_PASSWORD_NONE;
	sd->passwd_type = OFONO_SIM_PASSWORD_NONE;
	sd->modem = ril_data->modem;
	sd->ril_state_watch = ril_data->ril_state_watch;

	for (i = 0; i < OFONO_SIM_PASSWORD_INVALID; i++)
		sd->retries[i] = -1;

	ofono_sim_set_data(sim, sd);

	/*
	 * TODO: analyze if capability check is needed
	 * and/or timer should be adjusted.
	 *
	 * ofono_sim_register() needs to be called after the
	 * driver has been set in ofono_sim_create(), which
	 * calls this function.  Most other drivers make some
	 * kind of capabilities query to the modem, and then
	 * call register in the callback; we use an idle event
	 * instead.
	 */
	g_idle_add(ril_sim_register, sim);

	return 0;
}
コード例 #23
0
ファイル: radio-settings.c プロジェクト: plundstr/ofono
static int ril_radio_settings_probe(struct ofono_radio_settings *rs,
					unsigned int vendor,
					void *user)
{
	GRil *ril = user;
	struct cb_data *cbd = NULL;
	int ret;
	struct radio_data *rsd = g_try_new0(struct radio_data, 1);
	rsd->ril = g_ril_clone(ril);
	if (ril_get_net_config(rsd)) {
		cbd = cb_data_new2(rsd, NULL, NULL);
		ret = g_ril_send(rsd->ril,
					RIL_REQUEST_GET_PREFERRED_NETWORK_TYPE,
					NULL, 0, ril_rat_mode_cb, cbd, g_free);
		if (ret <= 0)
			g_free(cbd);
	}

	ofono_radio_settings_set_data(rs, rsd);
	rsd->timer_id = g_timeout_add_seconds(2, ril_delayed_register, rs);

	return 0;
}
コード例 #24
0
ファイル: stk.c プロジェクト: CODeRUS/ofono
static int ril_stk_probe(struct ofono_stk *stk, unsigned int vendor, void *data)
{
	GRil *ril = data;
	struct stk_data *sd;

	DBG("");

	sd = g_try_new0(struct stk_data, 1);
	if (sd == NULL)
		return -ENOMEM;

	sd->ril = g_ril_clone(ril);
	ofono_stk_set_data(stk, sd);

	/* Register interface in this phase for stk agent */
	ofono_stk_register(stk);

	subscribed = FALSE;

	/* UI language for local info */
	ril_stk_set_lang();

	return 0;
}