Exemplo n.º 1
0
static int u8500_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
				void *user)
{
	GIsiModem *idx = user;
	struct devinfo_data *data = g_try_new0(struct devinfo_data, 1);

	if (data == NULL)
		return -ENOMEM;

	data->client = g_isi_client_create(idx, PN_MODEM_INFO);
	if (data->client == NULL)
		goto nomem;

	ofono_devinfo_set_data(info, data);

	g_isi_client_set_timeout(data->client, INFO_TIMEOUT);
	g_isi_client_verify(data->client, u8500_devinfo_reachable_cb,
				info, NULL);

	return 0;

nomem:
	g_isi_client_destroy(data->client);

	g_free(data);
	return -ENOMEM;

}
Exemplo n.º 2
0
Arquivo: devinfo.c Projeto: 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;
}
Exemplo n.º 3
0
static void ril_devinfo_remove(struct ofono_devinfo *info)
{
	GRil *ril = ofono_devinfo_get_data(info);

	ofono_devinfo_set_data(info, NULL);

	g_ril_unref(ril);
}
Exemplo n.º 4
0
static void at_devinfo_remove(struct ofono_devinfo *info)
{
	GAtChat *chat = ofono_devinfo_get_data(info);

	ofono_devinfo_set_data(info, NULL);

	g_at_chat_unref(chat);
}
Exemplo n.º 5
0
static void u8500_devinfo_remove(struct ofono_devinfo *info)
{
	struct devinfo_data *data = ofono_devinfo_get_data(info);

	ofono_devinfo_set_data(info, NULL);

	if (data == NULL)
		return;

	g_isi_client_destroy(data->client);
	g_free(data);
}
Exemplo n.º 6
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;
}
Exemplo n.º 7
0
static int ril_devinfo_probe(struct ofono_devinfo *info, unsigned int vendor,
				void *data)
{
	struct ril_modem *modem = data;
	struct ril_devinfo *di = g_new0(struct ril_devinfo, 1);

	DBG("");
	di->q = grilio_queue_new(ril_modem_io(modem));
	di->info = info;

	di->timer_id = g_idle_add(ril_devinfo_register, di);
	ofono_devinfo_set_data(info, di);
	return 0;
}
Exemplo n.º 8
0
static void ril_devinfo_remove(struct ofono_devinfo *info)
{
	struct ril_devinfo *di = ril_devinfo_get_data(info);

	DBG("");
	ofono_devinfo_set_data(info, NULL);

	if (di->timer_id > 0) {
		g_source_remove(di->timer_id);
	}

	grilio_queue_cancel_all(di->q, FALSE);
	grilio_queue_unref(di->q);
	g_free(di);
}
Exemplo n.º 9
0
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;
}