Esempio n. 1
0
File: sms.c Progetto: AndriusA/ofono
static void sms_unregister(struct ofono_atom *atom)
{
	struct ofono_sms *sms = __ofono_atom_get_data(atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);

	g_dbus_unregister_interface(conn, path,
					OFONO_MESSAGE_MANAGER_INTERFACE);
	ofono_modem_remove_interface(modem, OFONO_MESSAGE_MANAGER_INTERFACE);

	if (sms->mw_watch) {
		__ofono_modem_remove_atom_watch(modem, sms->mw_watch);
		sms->mw_watch = 0;
		sms->mw = NULL;
	}

	if (sms->status_watch) {
		__ofono_netreg_remove_status_watch(sms->netreg,
							sms->status_watch);
		sms->status_watch = 0;
	}

	if (sms->netreg_watch) {
		__ofono_modem_remove_atom_watch(modem, sms->netreg_watch);
		sms->netreg_watch = 0;
	}

	sms->netreg = NULL;

	if (sms->messages) {
		GHashTableIter iter;
		struct message *m;
		gpointer key, value;

		g_hash_table_iter_init(&iter, sms->messages);

		while (g_hash_table_iter_next(&iter, &key, &value)) {
			m = value;
			message_dbus_unregister(m);
		}

		g_hash_table_destroy(sms->messages);
		sms->messages = NULL;
	}

	__ofono_watchlist_free(sms->text_handlers);
	sms->text_handlers = NULL;

	__ofono_watchlist_free(sms->datagram_handlers);
	sms->datagram_handlers = NULL;
}
Esempio n. 2
0
void ril_radio_settings_remove(struct ofono_radio_settings *rs)
{
	struct radio_data *rd = ofono_radio_settings_get_data(rs);

	ofono_radio_settings_set_data(rs, NULL);

	if (rd->gprs_atom_watch)
		__ofono_modem_remove_atom_watch(rd->modem, rd->gprs_atom_watch);

	g_ril_unref(rd->ril);
	g_free(rd);
}
Esempio n. 3
0
static int phonesim_disable(struct ofono_modem *modem)
{
	struct phonesim_data *data = ofono_modem_get_data(modem);

	DBG("%p", modem);

	__ofono_modem_remove_atom_watch(modem, data->hfp_watch);

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

	if (data->mux) {
		g_at_mux_shutdown(data->mux);

		g_at_mux_unref(data->mux);
		data->mux = NULL;
	}

	return 0;
}