Пример #1
0
static int at_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
				void *data)
{
	GAtChat *chat = data;
	struct netreg_data *nd;

	nd = g_new0(struct netreg_data, 1);

	nd->chat = g_at_chat_clone(chat);
	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);

	g_at_chat_send(nd->chat, "AT+CREG=?", creg_prefix,
			at_creg_test_cb, netreg, NULL);

	return 0;
}
Пример #2
0
static int at_gprs_context_probe(struct ofono_gprs_context *gc,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct gprs_context_data *gcd;
	struct stat st;

	DBG("");

	if (stat(TUN_SYSFS_DIR, &st) < 0) {
		ofono_error("Missing support for TUN/TAP devices");
		return -ENODEV;
	}

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

	gcd->chat = g_at_chat_clone(chat);
	gcd->vendor = vendor;

	ofono_gprs_context_set_data(gc, gcd);

	chat = g_at_chat_get_slave(gcd->chat);
	if (chat == NULL)
		return 0;

	g_at_chat_register(chat, "+CGEV:", cgev_notify, FALSE, gc, NULL);

	return 0;
}
Пример #3
0
static int at_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
				void *data)
{
	GAtChat *chat = g_at_chat_clone(data);

	ofono_devinfo_set_data(info, chat);

	g_at_chat_send(chat, "AT+GCAP", gcap_prefix,
				capability_cb, info, NULL);

	return 0;
}
Пример #4
0
static int huawei_cdma_netreg_probe(struct ofono_cdma_netreg *netreg,
				unsigned int vendor, void *data)
{
	GAtChat *chat = g_at_chat_clone(data);

	ofono_cdma_netreg_set_data(netreg, chat);

	g_at_chat_send(chat, "AT^SYSINFO", sysinfo_prefix,
				probe_cb, netreg, NULL);

	return 0;
}
Пример #5
0
static int at_sim_auth_probe(struct ofono_sim_auth *sa, unsigned int vendor,
				void *data)
{
	GAtChat *chat = data;
	struct sim_auth_data *sad;

	sad = g_new0(struct sim_auth_data, 1);
	sad->chat = g_at_chat_clone(chat);
	sad->vendor = vendor;

	ofono_sim_auth_set_data(sa, sad);
	g_idle_add(at_sim_auth_register, sa);

	return 0;
}
Пример #6
0
static int hso_gprs_context_probe(struct ofono_gprs_context *gc,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct gprs_context_data *gcd;

	gcd = g_new0(struct gprs_context_data, 1);
	gcd->chat = g_at_chat_clone(chat);

	g_at_chat_register(gcd->chat, "_OWANCALL:", owancall_notifier,
				FALSE, gc, NULL);

	ofono_gprs_context_set_data(gc, gcd);

	return 0;
}
Пример #7
0
static int phonesim_ctm_probe(struct ofono_ctm *ctm,
				unsigned int vendor, void *data)
{
	GAtChat *chat;

	DBG("");

	chat = g_at_chat_clone(data);

	ofono_ctm_set_data(ctm, chat);

	g_at_chat_send(chat, "AT+PTTY=?", ptty_prefix, phonesim_ctm_support_cb,
			ctm, NULL);

	return 0;
}
Пример #8
0
static int phonesim_context_probe(struct ofono_gprs_context *gc,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct gprs_context_data *gcd;

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

	gcd->chat = g_at_chat_clone(chat);
	gcd->interface = g_strdup_printf("dummy%d", next_iface++);

	ofono_gprs_context_set_data(gc, gcd);

	return 0;
}
Пример #9
0
static int ste_radio_settings_probe(struct ofono_radio_settings *rs,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct radio_settings_data *rsd;

	rsd = g_try_new0(struct radio_settings_data, 1);
	if (rsd == NULL)
		return -ENOMEM;

	rsd->chat = g_at_chat_clone(chat);

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

	return 0;
}
Пример #10
0
static int at_sms_probe(struct ofono_sms *sms, unsigned int vendor,
				void *user)
{
	GAtChat *chat = user;
	struct sms_data *data;

	data = g_new0(struct sms_data, 1);
	data->chat = g_at_chat_clone(chat);
	data->vendor = vendor;

	ofono_sms_set_data(sms, data);

	g_at_chat_send(data->chat, "AT+CSMS=?", csms_prefix,
			at_csms_query_cb, sms, NULL);

	return 0;
}
Пример #11
0
static int cdma_voicecall_probe(struct ofono_cdma_voicecall *vc,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct voicecall_data *vd;

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

	vd->chat = g_at_chat_clone(chat);
	vd->vendor = vendor;

	ofono_cdma_voicecall_set_data(vc, vd);
	g_idle_add(cdma_voicecall_initialized, vc);

	return 0;
}
Пример #12
0
static int hfp_netreg_probe(struct ofono_netreg *netreg, unsigned int vendor,
				void *user_data)
{
	struct hfp_slc_info *info = user_data;
	struct netreg_data *nd;

	nd = g_new0(struct netreg_data, 1);

	nd->chat = g_at_chat_clone(info->chat);
	memcpy(nd->cind_pos, info->cind_pos, HFP_INDICATOR_LAST);
	memcpy(nd->cind_val, info->cind_val, HFP_INDICATOR_LAST);

	ofono_netreg_set_data(netreg, nd);

	nd->register_source = g_idle_add(hfp_netreg_register, netreg);

	return 0;
}
Пример #13
0
static int icera_radio_settings_probe(struct ofono_radio_settings *rs,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct radio_settings_data *rsd;

	rsd = g_try_new0(struct radio_settings_data, 1);
	if (rsd == NULL)
		return -ENOMEM;

	rsd->chat = g_at_chat_clone(chat);

	ofono_radio_settings_set_data(rs, rsd);

	g_at_chat_send(rsd->chat, "AT%IPSYS=?", ipsys_prefix,
					ipsys_support_cb, rs, NULL);

	return 0;
}
Пример #14
0
static int ifx_ctm_probe(struct ofono_ctm *ctm,
				unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct ctm_data *ctmd;

	ctmd = g_try_new0(struct ctm_data, 1);
	if (ctmd == NULL)
		return -ENOMEM;

	ctmd->chat = g_at_chat_clone(chat);

	ofono_ctm_set_data(ctm, ctmd);

	g_at_chat_send(ctmd->chat, "AT+XCTMS=?", xctms_prefix,
			xctms_support_cb, ctm, NULL);

	return 0;
}
Пример #15
0
static int huawei_audio_settings_probe(struct ofono_audio_settings *as,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct audio_settings_data *asd;

	asd = g_try_new0(struct audio_settings_data, 1);
	if (asd == NULL)
		return -ENOMEM;

	asd->chat = g_at_chat_clone(chat);

	ofono_audio_settings_set_data(as, asd);

	g_at_chat_send(asd->chat, "AT^CVOICE=?", cvoice_prefix,
					cvoice_support_cb, as, NULL);

	return 0;
}
Пример #16
0
static int telit_location_reporting_probe(struct ofono_location_reporting *lr,
						unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct gps_data *gd;

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

	gd->chat = g_at_chat_clone(chat);

	ofono_location_reporting_set_data(lr, gd);

	g_at_chat_send(gd->chat, "AT$GPSP=?", gpsctl_prefix,
					telit_location_reporting_support_cb,
					lr, NULL);

	return 0;
}
Пример #17
0
static int at_gprs_probe(struct ofono_gprs *gprs,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct gprs_data *gd;

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

	gd->chat = g_at_chat_clone(chat);
	gd->vendor = vendor;

	ofono_gprs_set_data(gprs, gd);

	g_at_chat_send(gd->chat, "AT+CGDCONT=?", cgdcont_prefix,
			at_cgdcont_test_cb, gprs, NULL);

	return 0;
}
Пример #18
0
static int ublox_gprs_context_probe(struct ofono_gprs_context *gc,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct gprs_context_data *gcd;

	DBG("");

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

	gcd->chat = g_at_chat_clone(chat);

	ofono_gprs_context_set_data(gc, gcd);

	g_at_chat_register(chat, "+CGEV:", cgev_notify, FALSE, gc, NULL);

	return 0;
}
Пример #19
0
static int cdma_connman_probe(struct ofono_cdma_connman *cm,
					unsigned int vendor, void *data)
{
	GAtChat *chat = data;
	struct connman_data *cd;

	DBG("");

	cd = g_try_new0(struct connman_data, 1);
	if (cd == NULL)
		return -ENOMEM;

	cd->chat = g_at_chat_clone(chat);

	ofono_cdma_connman_set_data(cm, cd);

	g_at_chat_send(cd->chat, "AT&C0", none_prefix, at_c0_cb, cm, NULL);

	return 0;
}
Пример #20
0
static int hfp_siri_probe(struct ofono_siri *siri, unsigned int vendor,
				void *data)
{
	struct hfp_slc_info *info = data;
	struct siri_data *sd;
	char at_command[64];

	DBG("");

	sd = g_new0(struct siri_data, 1);
	sd->chat = g_at_chat_clone(info->chat);

	ofono_siri_set_data(siri, sd);

	snprintf(at_command, sizeof(at_command),
			"AT+XAPL=Linux-oFono-%s,%d",
			VERSION, APPLE_SIRI_STATUS_FEATURE);

	g_at_chat_send(sd->chat, at_command, xapl_prefix, xapl_cb, siri, NULL);

	return 0;
}