コード例 #1
0
ファイル: he910.c プロジェクト: Informatic/ofono
static void he910_remove(struct ofono_modem *modem)
{
	struct he910_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	ofono_modem_set_data(modem, NULL);

	/* Cleanup after hot-unplug */
	g_at_chat_unref(data->chat);
	g_at_chat_unref(data->modem);

	g_free(data);
}
コード例 #2
0
ファイル: test-caif.c プロジェクト: Conjuror/ofono
static void caif_init(gboolean ok, GAtResult *result, gpointer data)
{
	GAtChat *chat = data;

	g_print("caif_init: %d\n", ok);

	if (ok == FALSE) {
		g_at_chat_unref(chat);
		g_main_loop_quit(mainloop);
		return;
	}

	g_at_chat_unref(chat);
	g_main_loop_quit(mainloop);
}
コード例 #3
0
ファイル: telit.c プロジェクト: AndriusA/ofono
static void telit_remove(struct ofono_modem *modem)
{
	struct telit_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	bluetooth_sap_client_unregister(modem);

	ofono_modem_set_data(modem, NULL);

	/* Cleanup after hot-unplug */
	g_at_chat_unref(data->chat);
	g_at_chat_unref(data->modem);

	g_free(data);
}
コード例 #4
0
ファイル: device.c プロジェクト: dzemskov/ofono
void dundee_device_disconnect(const struct dundee_error *error,
                              struct dundee_device *device)
{
    if (device == NULL)
        return;

    DBG("%s", device->path);

    g_at_chat_unref(device->chat);
    device->chat = NULL;

    if (device->pending == NULL)
        return;

    if (error->type != DUNDEE_ERROR_TYPE_NO_ERROR) {
        __ofono_dbus_pending_reply(&device->pending,
                                   __dundee_error_failed(device->pending));
        goto out;
    }

    __ofono_dbus_pending_reply(&device->pending,
                               dbus_message_new_method_return(device->pending));

out:
    device->pending = NULL;
}
コード例 #5
0
ファイル: hfp_hf_bluez5.c プロジェクト: morphis/ofono
static int hfp_disable(struct ofono_modem *modem)
{
	struct hfp *hfp = ofono_modem_get_data(modem);
	struct hfp_slc_info *info = &hfp->info;
	GIOChannel *channel;
	int fd;

	DBG("%p", modem);

	/*
	 * Instead of triggering two round trips to BlueZ (DisconnectProfile,
	 * RequestDisconnection) simply kill the connection on the RFCOMM fd
	 * we already have.  But for this we have to call shutdown().
	 */
	channel = g_at_chat_get_channel(info->chat);
	fd = g_io_channel_unix_get_fd(channel);
	shutdown(fd, SHUT_RDWR);

	ofono_handsfree_card_remove(hfp->card);
	hfp->card = NULL;

	g_at_chat_unref(info->chat);
	info->chat = NULL;

	return 0;
}
コード例 #6
0
ファイル: ifx.c プロジェクト: AndriusA/ofono
static void shutdown_device(struct ifx_data *data)
{
	int i, fd;

	DBG("");

	if (data->dlc_init_source > 0) {
		g_source_remove(data->dlc_init_source);
		data->dlc_init_source = 0;
	}

	for (i = 0; i < NUM_DLC; i++) {
		if (data->dlcs[i] == NULL)
			continue;

		g_at_chat_unref(data->dlcs[i]);
		data->dlcs[i] = NULL;
	}

	if (data->mux) {
		g_at_mux_shutdown(data->mux);
		g_at_mux_unref(data->mux);
		data->mux = NULL;
		goto done;
	}

	fd = g_io_channel_unix_get_fd(data->device);

	if (ioctl(fd, TIOCSETD, &data->saved_ldisc) < 0)
		ofono_warn("Failed to restore line discipline");

done:
	g_io_channel_unref(data->device);
	data->device = NULL;
}
コード例 #7
0
ファイル: gatmux.c プロジェクト: Conjuror/ofono
static void mux_setup_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
	struct mux_setup_data *msd = user_data;
	GIOFlags flags;
	GIOChannel *channel;
	GAtMux *mux = NULL;

	if (!ok)
		goto error;

	channel = g_at_chat_get_channel(msd->chat);
	channel = g_io_channel_ref(channel);

	g_at_chat_unref(msd->chat);
	msd->chat = NULL;

	flags = g_io_channel_get_flags(channel) | G_IO_FLAG_NONBLOCK;
	g_io_channel_set_flags(channel, flags, NULL);

	g_io_channel_set_encoding(channel, NULL, NULL);
	g_io_channel_set_buffered(channel, FALSE);

	if (msd->mode == 0)
		mux = g_at_mux_new_gsm0710_basic(channel, msd->frame_size);
	else
		mux = g_at_mux_new_gsm0710_advanced(channel, msd->frame_size);

	g_io_channel_unref(channel);

error:
	msd->func(mux, msd->user);

	if (msd->destroy)
		msd->destroy(msd->user);
}
コード例 #8
0
ファイル: telit.c プロジェクト: Conjuror/ofono
static void cfun_enable_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
	struct ofono_modem *modem = user_data;
	struct telit_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	if (!ok) {
		g_at_chat_unref(data->chat);
		data->chat = NULL;
		ofono_modem_set_powered(modem, FALSE);
		return;
	}

	ofono_modem_set_powered(modem, TRUE);

	/* Enable sim state notification */
	g_at_chat_send(data->chat, "AT#QSS=1", none_prefix, NULL, NULL, NULL);

	/* Follow sim state */
	g_at_chat_register(data->chat, "#QSS:", telit_qss_notify,
				FALSE, modem, NULL);

	/* Query current sim state */
	g_at_chat_send(data->chat, "AT#QSS?", qss_prefix,
				telit_qss_cb, modem, NULL);
}
コード例 #9
0
ファイル: he910.c プロジェクト: Informatic/ofono
static int he910_enable(struct ofono_modem *modem)
{
	struct he910_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	data->modem = open_device(modem, "Modem", "Modem: ");
	if (data->modem == NULL)
		return -EINVAL;

	data->chat = open_device(modem, "Aux", "Aux: ");
	if (data->chat == NULL) {
		g_at_chat_unref(data->modem);
		data->modem = NULL;
		return -EIO;
	}

	g_at_chat_set_slave(data->modem, data->chat);

	/*
	 * Disable command echo and
	 * enable the Extended Error Result Codes
	 */
	g_at_chat_send(data->chat, "ATE0 +CMEE=1", none_prefix,
				NULL, NULL, NULL);

	/* Set phone functionality */
	g_at_chat_send(data->chat, "AT+CFUN=1", none_prefix,
				cfun_enable_cb, modem, NULL);

	return -EINPROGRESS;
}
コード例 #10
0
ファイル: he910.c プロジェクト: Informatic/ofono
static void cfun_enable_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
	struct ofono_modem *modem = user_data;
	struct he910_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	if (!ok) {
		g_at_chat_unref(data->chat);
		data->chat = NULL;

		g_at_chat_unref(data->modem);
		data->modem = NULL;

		ofono_modem_set_powered(modem, FALSE);
		return;
	}

	/*
	 * Switch data carrier detect signal off.
	 * When the DCD is disabled the modem does not hangup anymore
	 * after the data connection.
	 */
	g_at_chat_send(data->chat, "AT&C0", NULL, NULL, NULL, NULL);

	data->have_sim = FALSE;
	data->sms_phonebook_added = FALSE;

	ofono_modem_set_powered(modem, TRUE);

	/*
	 * Tell the modem not to automatically initiate auto-attach
	 * proceedures on its own.
	 */
	g_at_chat_send(data->chat, "AT#AUTOATT=0", none_prefix,
				NULL, NULL, NULL);

	/* Follow sim state */
	g_at_chat_register(data->chat, "#QSS:", he910_qss_notify,
				FALSE, modem, NULL);

	/* Enable sim state notification */
	g_at_chat_send(data->chat, "AT#QSS=2", none_prefix, NULL, NULL, NULL);

	g_at_chat_send(data->chat, "AT#QSS?", qss_prefix,
			qss_query_cb, modem, NULL);
}
コード例 #11
0
ファイル: devinfo.c プロジェクト: Conjuror/ofono
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);
}
コード例 #12
0
ファイル: cdma-netreg.c プロジェクト: AndriusA/ofono
static void huawei_cdma_netreg_remove(struct ofono_cdma_netreg *netreg)
{
	GAtChat *chat = ofono_cdma_netreg_get_data(netreg);

	ofono_cdma_netreg_set_data(netreg, NULL);

	g_at_chat_unref(chat);
}
コード例 #13
0
ファイル: radio-settings.c プロジェクト: Conjuror/ofono
static void ste_radio_settings_remove(struct ofono_radio_settings *rs)
{
	struct radio_settings_data *rsd = ofono_radio_settings_get_data(rs);
	ofono_radio_settings_set_data(rs, NULL);

	g_at_chat_unref(rsd->chat);
	g_free(rsd);
}
コード例 #14
0
ファイル: ctm.c プロジェクト: AndriusA/ofono
static void ifx_ctm_remove(struct ofono_ctm *ctm)
{
	struct ctm_data *ctmd = ofono_ctm_get_data(ctm);

	ofono_ctm_set_data(ctm, NULL);

	g_at_chat_unref(ctmd->chat);
	g_free(ctmd);
}
コード例 #15
0
ファイル: siri.c プロジェクト: Herrie82/ofono-fix2
static void hfp_siri_remove(struct ofono_siri *siri)
{
	struct siri_data *sd = ofono_siri_get_data(siri);

	ofono_siri_set_data(siri, NULL);

	g_at_chat_unref(sd->chat);
	g_free(sd);
}
コード例 #16
0
ファイル: gprs-context.c プロジェクト: AndriusA/ofono
static void hso_gprs_context_remove(struct ofono_gprs_context *gc)
{
	struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);

	ofono_gprs_context_set_data(gc, NULL);

	g_at_chat_unref(gcd->chat);
	g_free(gcd);
}
コード例 #17
0
ファイル: gprs.c プロジェクト: endocode/ofono
static void at_gprs_remove(struct ofono_gprs *gprs)
{
	struct gprs_data *gd = ofono_gprs_get_data(gprs);

	ofono_gprs_set_data(gprs, NULL);

	g_at_chat_unref(gd->chat);
	g_free(gd);
}
コード例 #18
0
static void telit_location_reporting_remove(struct ofono_location_reporting *lr)
{
	struct gps_data *gd = ofono_location_reporting_get_data(lr);

	ofono_location_reporting_set_data(lr, NULL);

	g_at_chat_unref(gd->chat);
	g_free(gd);
}
コード例 #19
0
ファイル: gatmux.c プロジェクト: Conjuror/ofono
static void msd_free(gpointer user_data)
{
	struct mux_setup_data *msd = user_data;

	if (msd->chat)
		g_at_chat_unref(msd->chat);

	g_free(msd);
}
コード例 #20
0
ファイル: sim-auth.c プロジェクト: Conjuror/ofono
static void at_sim_auth_remove(struct ofono_sim_auth *sa)
{
	struct sim_auth_data *sad = ofono_sim_auth_get_data(sa);

	ofono_sim_auth_set_data(sa, NULL);

	g_at_chat_unref(sad->chat);
	g_free(sad);
}
コード例 #21
0
ファイル: audio-settings.c プロジェクト: AndriusA/ofono
static void huawei_audio_settings_remove(struct ofono_audio_settings *as)
{
	struct audio_settings_data *asd = ofono_audio_settings_get_data(as);

	ofono_audio_settings_set_data(as, NULL);

	g_at_chat_unref(asd->chat);
	g_free(asd);
}
コード例 #22
0
ファイル: voicecall.c プロジェクト: AndriusA/ofono
static void cdma_voicecall_remove(struct ofono_cdma_voicecall *vc)
{
	struct voicecall_data *vd = ofono_cdma_voicecall_get_data(vc);

	ofono_cdma_voicecall_set_data(vc, NULL);

	g_at_chat_unref(vd->chat);
	g_free(vd);
}
コード例 #23
0
ファイル: phonesim.c プロジェクト: jkangas/ofono-1
static int localhfp_disable(struct ofono_modem *modem)
{
	struct hfp_slc_info *info = ofono_modem_get_data(modem);

	g_at_chat_unref(info->chat);
	info->chat = NULL;

	return 0;
}
コード例 #24
0
ファイル: hfp_hf_bluez4.c プロジェクト: Herrie82/ofono-fix2
static void hfp_disconnected_cb(gpointer user_data)
{
	struct ofono_modem *modem = user_data;
	struct hfp_data *data = ofono_modem_get_data(modem);

	ofono_modem_set_powered(modem, FALSE);

	g_at_chat_unref(data->info.chat);
	data->info.chat = NULL;
}
コード例 #25
0
ファイル: phonesim.c プロジェクト: jkangas/ofono-1
static void slc_failed(gpointer userdata)
{
	struct ofono_modem *modem = userdata;
	struct hfp_slc_info *info = ofono_modem_get_data(modem);

	ofono_modem_set_powered(modem, FALSE);

	g_at_chat_unref(info->chat);
	info->chat = NULL;
}
コード例 #26
0
ファイル: phonesim.c プロジェクト: jkangas/ofono-1
static void phonesim_ctm_remove(struct ofono_ctm *ctm)
{
	GAtChat *chat = ofono_ctm_get_data(ctm);

	DBG("");

	ofono_ctm_set_data(ctm, NULL);

	g_at_chat_unref(chat);
}
コード例 #27
0
static void hfp_netreg_remove(struct ofono_netreg *netreg)
{
	struct netreg_data *nd = ofono_netreg_get_data(netreg);

	if (nd->register_source != 0)
		g_source_remove(nd->register_source);

	ofono_netreg_set_data(netreg, NULL);

	g_at_chat_unref(nd->chat);
	g_free(nd);
}
コード例 #28
0
ファイル: atgen.c プロジェクト: yongsu/oFono
static int atgen_disable(struct ofono_modem *modem)
{
    GAtChat *chat = ofono_modem_get_data(modem);

    DBG("%p", modem);

    ofono_modem_set_data(modem, NULL);

    g_at_chat_unref(chat);

    return 0;
}
コード例 #29
0
ファイル: network-registration.c プロジェクト: Conjuror/ofono
static void at_netreg_remove(struct ofono_netreg *netreg)
{
	struct netreg_data *nd = ofono_netreg_get_data(netreg);

	if (nd->nitz_timeout)
		g_source_remove(nd->nitz_timeout);

	ofono_netreg_set_data(netreg, NULL);

	g_at_chat_unref(nd->chat);
	g_free(nd);
}
コード例 #30
0
ファイル: phonesim.c プロジェクト: jkangas/ofono-1
static void phonesim_context_remove(struct ofono_gprs_context *gc)
{
	struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);

	DBG("");

	ofono_gprs_context_set_data(gc, NULL);

	g_at_chat_unref(gcd->chat);
	g_free(gcd->interface);

	g_free(gcd);
}