Exemplo n.º 1
0
static void strength_notify_common(struct ofono_cdma_netreg *netreg,
					int strength, const char *property,
					int *dest)
{
	if (netreg == NULL)
		return;

	if (*dest == strength)
		return;

	/*
	 * Theoretically we can get signal strength even when not registered
	 * to any network.  However, what do we do with it in that case?
	 */
	if (netreg->status == CDMA_NETWORK_REGISTRATION_STATUS_NOT_REGISTERED)
		return;

	*dest = strength;

	if (strength != -1) {
		DBusConnection *conn = ofono_dbus_get_connection();
		const char *path = __ofono_atom_get_path(netreg->atom);
		unsigned char val = strength;

		ofono_dbus_signal_property_changed(conn, path,
				OFONO_CDMA_NETWORK_REGISTRATION_INTERFACE,
				property, DBUS_TYPE_BYTE, &val);
	}
}
Exemplo n.º 2
0
static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
{
    DBusConnection *conn = ofono_dbus_get_connection();
    struct dundee_device *device = user_data;

    DBG("%p", device);
    DBG("PPP Link down: %d\n", reason);

    g_at_ppp_unref(device->ppp);
    device->ppp = NULL;

    g_at_chat_resume(device->chat);

    g_free(device->settings.interface);
    g_free(device->settings.ip);
    g_strfreev(device->settings.nameservers);
    device->settings.interface = NULL;
    device->settings.ip = NULL;
    device->settings.nameservers = NULL;

    device->active = FALSE;

    settings_changed(device);
    ofono_dbus_signal_property_changed(conn, device->path,
                                       DUNDEE_DEVICE_INTERFACE, "Active",
                                       DBUS_TYPE_BOOLEAN, &device->active);

    device->driver->disconnect(device, disconnect_callback, device);
}
Exemplo n.º 3
0
static void location_reporting_enable_cb(const struct ofono_error *error,
							int fd,	void *data)
{
	struct ofono_location_reporting *lr = data;
	DBusConnection *conn = ofono_dbus_get_connection();
	DBusMessage *reply;

	if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
		ofono_error("Enabling location-reporting failed");

		reply = __ofono_error_failed(lr->pending);
		__ofono_dbus_pending_reply(&lr->pending, reply);

		return;
	}

	lr->enabled = TRUE;
	lr->client_owner = g_strdup(dbus_message_get_sender(lr->pending));
	lr->disconnect_watch = g_dbus_add_disconnect_watch(conn,
				lr->client_owner, client_exited, lr, NULL);

	reply = dbus_message_new_method_return(lr->pending);
	dbus_message_append_args(reply, DBUS_TYPE_UNIX_FD, &fd,
							DBUS_TYPE_INVALID);

	__ofono_dbus_pending_reply(&lr->pending, reply);

	signal_enabled(lr);
}
Exemplo n.º 4
0
static void ppp_connect(const char *iface, const char *local, const char *peer,
                        const char *dns1, const char *dns2,
                        gpointer user_data)
{
    DBusConnection *conn = ofono_dbus_get_connection();
    struct dundee_device *device = user_data;
    const char *dns[3] = { dns1, dns2, 0 };

    DBG("%p", device);
    DBG("Network Device: %s\n", iface);
    DBG("IP Address: %s\n", local);
    DBG("Peer IP Address: %s\n", peer);
    DBG("Primary DNS Server: %s\n", dns1);
    DBG("Secondary DNS Server: %s\n", dns2);

    if (device->connect_timeout > 0) {
        g_source_remove(device->connect_timeout);
        device->connect_timeout = 0;
    }

    g_free(device->settings.interface);
    device->settings.interface = g_strdup(iface);
    if (device->settings.interface == NULL)
        goto err;

    g_free(device->settings.ip);
    device->settings.ip = g_strdup(local);
    if (device->settings.ip == NULL)
        goto err;

    g_strfreev(device->settings.nameservers);
    device->settings.nameservers = g_strdupv((gchar **)dns);
    if (device->settings.nameservers == NULL)
        goto err;

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

    device->active = TRUE;

    settings_changed(device);
    ofono_dbus_signal_property_changed(conn, device->path,
                                       DUNDEE_DEVICE_INTERFACE, "Active",
                                       DBUS_TYPE_BOOLEAN, &device->active);

    return;

err:
    g_free(device->settings.interface);
    g_free(device->settings.ip);
    g_strfreev(device->settings.nameservers);
    device->settings.interface = NULL;
    device->settings.ip = NULL;
    device->settings.nameservers = NULL;

    __ofono_dbus_pending_reply(&device->pending,
                               __dundee_error_failed(device->pending));
    device->pending = NULL;
}
Exemplo n.º 5
0
static void get_property(struct accounts_data *accounts, int id)
{
	DBusMessageIter iter;
	DBusMessage *msg;
	const char *iface = ACCOUNTS_PHONE_INTERFACE;
	DBusConnection *conn = ofono_dbus_get_connection();
	DBusPendingCall *call;
	struct get_property_data *gpd;

	msg = dbus_message_new_method_call(ACCOUNTS_SERVICE, accounts->uid_path,
						DBUS_PROPERTIES_INTERFACE,
						"Get");
	if (msg == NULL) {
		ofono_error("%s: dbus_message_new_method failed", __func__);
		return;
	}

	dbus_message_iter_init_append(msg, &iter);
	dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &iface);
	dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING,
					&setting_names[id].property_name);

	if (!dbus_connection_send_with_reply(conn, msg, &call, -1)) {
		ofono_error("%s: Sending Get failed", __func__);
		goto done;
	}

	gpd = g_malloc0(sizeof(*gpd));
	gpd->accounts = accounts;
	gpd->prop_id = id;
	dbus_pending_call_set_notify(call, get_property_reply, gpd, NULL);

done:
	dbus_message_unref(msg);
}
Exemplo n.º 6
0
static int ril_disable(struct ofono_modem *modem)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ril_data *rd = ofono_modem_get_data(modem);
	const char *path = ofono_modem_get_path(modem);
	struct parcel rilp;
	int cmd_id;
	char buf[4];

	DBG("%p", modem);

	if (g_dbus_unregister_interface(conn, path,
					THERMAL_MANAGEMENT_INTERFACE))
		ofono_modem_remove_interface(modem,
						THERMAL_MANAGEMENT_INTERFACE);

	/* RIL_OEM_HOOK_STRING_SET_MODEM_OFF = 0x000000CF */
	cmd_id = 0x000000CF;
	sprintf(buf, "%d", cmd_id);
	parcel_init(&rilp);
	parcel_w_int32(&rilp, 1);
	parcel_w_string(&rilp, buf);

	g_ril_append_print_buf(rd->ril, "{cmd_id=0x%02X}", cmd_id);

	g_ril_send(rd->ril, RIL_REQUEST_OEM_HOOK_STRINGS, &rilp,
					ril_send_power_off_cb, modem, NULL);

	return -EINPROGRESS;
}
Exemplo n.º 7
0
static void set_rf_power_status_cb(struct ril_msg *message, gpointer user_data)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ril_thermal_management *tm = user_data;
	struct ril_data *rd = ofono_modem_get_data(tm->modem);
	const char *path = ofono_modem_get_path(tm->modem);

	DBG("");

	if (message->error != RIL_E_SUCCESS) {
		ofono_error("%s RILD reply failure: %s",
			g_ril_request_id_to_string(rd->ril, message->req),
			ril_error_to_string(message->error));

		__ofono_dbus_pending_reply(&tm->pending,
					__ofono_error_failed(tm->pending));
		return;
	}

	/* Change the throttling state */
	tm->throttling = tm->throttling ? false : true;

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

	ofono_dbus_signal_property_changed(conn, path,
					THERMAL_MANAGEMENT_INTERFACE,
					"TransmitPowerThrottling",
					DBUS_TYPE_BOOLEAN,
					&tm->throttling);
}
Exemplo n.º 8
0
static void set_currency(struct ofono_call_meter *cm, const char *value)
{
	DBusConnection *conn;
	const char *path;
	const char *dbusval;

	if (strlen(value) > 3) {
		ofono_error("Currency reported with size > 3: %s", value);
		return;
	}

	if (!strcmp(cm->currency, value))
		return;

	strncpy(cm->currency, value, 3);
	cm->currency[3] = '\0';

	conn = ofono_dbus_get_connection();
	path = __ofono_atom_get_path(cm->atom);
	dbusval = cm->currency;

	ofono_dbus_signal_property_changed(conn, path,
						OFONO_CALL_METER_INTERFACE,
						"Currency", DBUS_TYPE_STRING,
						&dbusval);
}
Exemplo n.º 9
0
static int hfp_ag_init(void)
{
	DBusConnection *conn = ofono_dbus_get_connection();

	if (DBUS_TYPE_UNIX_FD < 0)
		return -EBADF;

	/* Registers External Profile handler */
	if (!g_dbus_register_interface(conn, HFP_AG_EXT_PROFILE_PATH,
					BLUEZ_PROFILE_INTERFACE,
					profile_methods, NULL,
					NULL, NULL, NULL)) {
		ofono_error("Register Profile interface failed: %s",
						HFP_AG_EXT_PROFILE_PATH);
		return -EIO;
	}

	sim_hash = g_hash_table_new(g_direct_hash, g_direct_equal);

	modemwatch_id = __ofono_modemwatch_add(modem_watch, NULL, NULL);
	__ofono_modem_foreach(call_modemwatch, NULL);

	connection_hash = g_hash_table_new_full(g_str_hash, g_str_equal,
					g_free, connection_destroy);

	return 0;
}
Exemplo n.º 10
0
void message_emit_added(struct message *m, const char *interface)
{
	DBusMessage *signal;
	DBusMessageIter iter;
	DBusMessageIter dict;
	const char *path;
	const char *atompath = __ofono_atom_get_path(m->atom);

	signal = dbus_message_new_signal(atompath, interface, "MessageAdded");
	if (signal == NULL)
		return;

	path = message_path_from_uuid(m->atom, &m->uuid);

	dbus_message_iter_init_append(signal, &iter);

	dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH, &path);

	dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
					OFONO_PROPERTIES_ARRAY_SIGNATURE,
					&dict);
	message_append_properties(m, &dict);
	dbus_message_iter_close_container(&iter, &dict);

	g_dbus_send_message(ofono_dbus_get_connection(), signal);
}
Exemplo n.º 11
0
static void emit_modem_added(struct ofono_modem *modem)
{
	DBusMessage *signal;
	DBusMessageIter iter;
	DBusMessageIter dict;
	const char *path;

	DBG("%p", modem);

	signal = dbus_message_new_signal(OFONO_MANAGER_PATH,
						OFONO_MANAGER_INTERFACE,
						"ModemAdded");

	if (signal == NULL)
		return;

	dbus_message_iter_init_append(signal, &iter);

	path = modem->path;
	dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH, &path);
	dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
					OFONO_PROPERTIES_ARRAY_SIGNATURE,
					&dict);
	__ofono_modem_append_properties(modem, &dict);
	dbus_message_iter_close_container(&iter, &dict);

	g_dbus_send_message(ofono_dbus_get_connection(), signal);
}
Exemplo n.º 12
0
static void sms_watch(struct ofono_atom *atom,
				enum ofono_atom_watch_condition cond,
				void *data)
{
	struct push_notification *pn = data;
	DBusConnection *conn = ofono_dbus_get_connection();

	if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) {
		g_dbus_unregister_interface(conn,
					ofono_modem_get_path(pn->modem),
					PUSH_NOTIFICATION_INTERFACE);
		return;
	}

	DBG("registered");
	pn->sms = __ofono_atom_get_data(atom);

	if (!g_dbus_register_interface(conn, ofono_modem_get_path(pn->modem),
					PUSH_NOTIFICATION_INTERFACE,
					push_notification_methods, NULL, NULL,
					pn, push_notification_cleanup)) {
		ofono_error("Could not create %s interface",
				PUSH_NOTIFICATION_INTERFACE);

		return;
	}

	ofono_modem_add_interface(pn->modem, PUSH_NOTIFICATION_INTERFACE);
}
Exemplo n.º 13
0
static void emit_card_added(struct ofono_handsfree_card *card)
{
	DBusMessage *signal;
	DBusMessageIter iter;
	DBusMessageIter dict;
	const char *path;

	signal = dbus_message_new_signal(OFONO_MANAGER_PATH,
						HFP_AUDIO_MANAGER_INTERFACE,
						"CardAdded");

	if (signal == NULL)
		return;

	dbus_message_iter_init_append(signal, &iter);

	path = card->path;
	dbus_message_iter_append_basic(&iter, DBUS_TYPE_OBJECT_PATH, &path);
	dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
					OFONO_PROPERTIES_ARRAY_SIGNATURE,
					&dict);
	card_append_properties(card, &dict);
	dbus_message_iter_close_container(&iter, &dict);

	g_dbus_send_message(ofono_dbus_get_connection(), signal);
}
Exemplo n.º 14
0
static void radio_set_band(struct ofono_radio_settings *rs)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path;
	const char *str_band;

	path = __ofono_atom_get_path(rs->atom);

	if (rs->band_gsm != rs->pending_band_gsm) {
		rs->band_gsm = rs->pending_band_gsm;
		str_band = radio_band_gsm_to_string(rs->band_gsm);

		ofono_dbus_signal_property_changed(conn, path,
						OFONO_RADIO_SETTINGS_INTERFACE,
						"GsmBand", DBUS_TYPE_STRING,
						&str_band);
	}

	if (rs->band_umts != rs->pending_band_umts) {
		rs->band_umts = rs->pending_band_umts;
		str_band = radio_band_umts_to_string(rs->band_umts);

		ofono_dbus_signal_property_changed(conn, path,
						OFONO_RADIO_SETTINGS_INTERFACE,
						"UmtsBand", DBUS_TYPE_STRING,
						&str_band);
	}

}
Exemplo n.º 15
0
static inline void emit_barring_changed(struct ofono_call_barring *cb,
					int start, int end,
					const char *type, int cls)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = __ofono_atom_get_path(cb->atom);
	char property_name[64];
	const char *value;
	int i;
	int j;

	for (i = start; i <= end; i++)
		if (cb->cur_locks[i] & cls)
			break;

	for (j = start; j <= end; j++)
		if (cb->new_locks[j] & cls)
			break;

	if (i == j)
		return;

	if (j > end)
		value = "disabled";
	else
		value = cb_locks[j].value;

	snprintf(property_name, sizeof(property_name), "%s%s",
			bearer_class_to_string(cls), type);

	ofono_dbus_signal_property_changed(conn, path,
						OFONO_CALL_BARRING_INTERFACE,
						property_name, DBUS_TYPE_STRING,
						&value);
}
Exemplo n.º 16
0
void __ofono_manager_cleanup()
{
	DBusConnection *conn = ofono_dbus_get_connection();

	g_dbus_unregister_interface(conn, OFONO_MANAGER_PATH,
					OFONO_MANAGER_INTERFACE);
}
Exemplo n.º 17
0
Arquivo: sms.c Projeto: AndriusA/ofono
/*
 * Indicate oFono that a SMS driver is ready for operation
 *
 * This is called after ofono_sms_create() was done and the modem
 * driver determined that a modem supports SMS correctly. Once this
 * call succeeds, the D-BUS interface for SMS goes live.
 */
void ofono_sms_register(struct ofono_sms *sms)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(sms->atom);
	const char *path = __ofono_atom_get_path(sms->atom);
	struct ofono_sim *sim;

	if (!g_dbus_register_interface(conn, path,
					OFONO_MESSAGE_MANAGER_INTERFACE,
					sms_manager_methods,
					sms_manager_signals,
					NULL, sms, NULL)) {
		ofono_error("Could not create %s interface",
				OFONO_MESSAGE_MANAGER_INTERFACE);
		return;
	}

	ofono_modem_add_interface(modem, OFONO_MESSAGE_MANAGER_INTERFACE);

	sms->mw_watch = __ofono_modem_add_atom_watch(modem,
					OFONO_ATOM_TYPE_MESSAGE_WAITING,
					mw_watch, sms, NULL);

	sms->netreg_watch = __ofono_modem_add_atom_watch(modem,
					OFONO_ATOM_TYPE_NETREG,
					netreg_watch, sms, NULL);

	sim = __ofono_atom_find(OFONO_ATOM_TYPE_SIM, modem);

	/*
	 * If we have a sim atom, we can uniquely identify the SIM,
	 * otherwise create an sms assembly which doesn't backup the fragment
	 * store.
	 */
	if (sim) {
		const char *imsi;

		imsi = ofono_sim_get_imsi(sim);
		sms->assembly = sms_assembly_new(imsi);

		sms->sr_assembly = status_report_assembly_new(imsi);

		sms_load_settings(sms, imsi);
	} else {
		sms->assembly = sms_assembly_new(NULL);
		sms->sr_assembly = status_report_assembly_new(NULL);
		sms->bearer = 3; /* Default to CS then PS */
	}

	if (sms->driver->bearer_set)
		sms->driver->bearer_set(sms, sms->bearer,
						bearer_init_callback, sms);

	sms_restore_tx_queue(sms);

	sms->text_handlers = __ofono_watchlist_new(g_free);
	sms->datagram_handlers = __ofono_watchlist_new(g_free);

	__ofono_atom_register(sms->atom, sms_unregister);
}
Exemplo n.º 18
0
static gboolean trigger_interface_update(void *data)
{
	struct ofono_modem *modem = data;
	DBusConnection *conn = ofono_dbus_get_connection();
	char **interfaces;
	char **features;
	GSList *l;
	int i;

	interfaces = g_new0(char *, g_slist_length(modem->interface_list) + 1);
	for (i = 0, l = modem->interface_list; l; l = l->next, i++)
		interfaces[i] = l->data;
	ofono_dbus_signal_array_property_changed(conn, modem->path,
						OFONO_MODEM_INTERFACE,
						"Interfaces", DBUS_TYPE_STRING,
						&interfaces);
	g_free(interfaces);

	features = g_new0(char *, g_slist_length(modem->feature_list) + 1);
	for (i = 0, l = modem->feature_list; l; l = l->next, i++)
		features[i] = l->data;
	ofono_dbus_signal_array_property_changed(conn, modem->path,
						OFONO_MODEM_INTERFACE,
						"Features", DBUS_TYPE_STRING,
						&features);
	g_free(features);

	modem->interface_update = 0;

	return FALSE;
}
Exemplo n.º 19
0
static void voicecall_watch(struct ofono_atom *atom,
				enum ofono_atom_watch_condition cond,
				void *data)
{
	struct ofono_atom *sim_atom;
	struct ofono_sim *sim;
	struct ofono_modem *modem;
	DBusConnection *conn = ofono_dbus_get_connection();

	if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED)
		return;

	/*
	 * This logic is only intended to handle voicecall atoms
	 * registered in post_sim state or later
	 */
	modem = __ofono_atom_get_modem(atom);

	sim_atom = __ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_SIM);
	if (sim_atom == NULL)
		return;

	sim = __ofono_atom_get_data(sim_atom);
	if (ofono_sim_get_state(sim) != OFONO_SIM_STATE_READY)
		return;

	modems = g_list_append(modems, modem);

	if (modems->next != NULL)
		return;

	bt_register_profile(conn, HFP_AG_UUID, HFP_VERSION_1_5, "hfp_ag",
					HFP_AG_EXT_PROFILE_PATH, NULL, 0);
}
Exemplo n.º 20
0
static void sim_state_watch(enum ofono_sim_state new_state, void *data)
{
	struct ofono_modem *modem = data;
	DBusConnection *conn = ofono_dbus_get_connection();

	if (new_state != OFONO_SIM_STATE_READY) {
		if (modems == NULL)
			return;

		modems = g_list_remove(modems, modem);
		if (modems != NULL)
			return;

		bt_unregister_profile(conn, HFP_AG_EXT_PROFILE_PATH);

		return;
	}

	if (__ofono_modem_find_atom(modem, OFONO_ATOM_TYPE_VOICECALL) == NULL)
		return;

	modems = g_list_append(modems, modem);

	if (modems->next != NULL)
		return;

	bt_register_profile(conn, HFP_AG_UUID, HFP_VERSION_1_5, "hfp_ag",
					HFP_AG_EXT_PROFILE_PATH, NULL, 0);
}
Exemplo n.º 21
0
void ofono_call_meter_maximum_notify(struct ofono_call_meter *cm)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = __ofono_atom_get_path(cm->atom);

	g_dbus_emit_signal(conn, path, OFONO_CALL_METER_INTERFACE,
			"NearMaximumWarning", DBUS_TYPE_INVALID);
}
Exemplo n.º 22
0
static void agent_release(struct agent *agent)
{
	DBusMessage *msg;

	msg = dbus_message_new_method_call(agent->owner, agent->path,
					HFP_AUDIO_AGENT_INTERFACE, "Release");

	g_dbus_send_message(ofono_dbus_get_connection(), msg);
}
Exemplo n.º 23
0
static void agent_free(struct agent *agent)
{
	if (agent->watch > 0)
		g_dbus_remove_watch(ofono_dbus_get_connection(), agent->watch);

	g_free(agent->owner);
	g_free(agent->path);
	g_free(agent);
}
Exemplo n.º 24
0
void __ofono_dbus_cleanup(void)
{
	DBusConnection *conn = ofono_dbus_get_connection();

	if (conn == NULL || !dbus_connection_get_is_connected(conn))
		return;

	dbus_gsm_set_connection(NULL);
}
Exemplo n.º 25
0
void message_dbus_unregister(struct message *m)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = message_path_from_uuid(m->atom, &m->uuid);

	g_dbus_unregister_interface(conn, path, OFONO_MESSAGE_INTERFACE);

	return;
}
Exemplo n.º 26
0
void __ofono_dbus_pending_reply(DBusMessage **msg, DBusMessage *reply)
{
	DBusConnection *conn = ofono_dbus_get_connection();

	g_dbus_send_message(conn, reply);

	dbus_message_unref(*msg);
	*msg = NULL;
}
Exemplo n.º 27
0
Arquivo: stk.c Projeto: yongsu/oFono
static void emit_menu_changed(struct ofono_stk *stk)
{
	static struct stk_menu_item end_item = {};
	static struct stk_menu no_menu = {
		.title = "",
		.items = &end_item,
		.has_help = FALSE,
		.default_item = -1,
	};
	static char *name = "MainMenu";
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = __ofono_atom_get_path(stk->atom);
	struct stk_menu *menu = stk->main_menu ? stk->main_menu : &no_menu;
	DBusMessage *signal;
	DBusMessageIter iter;

	ofono_dbus_signal_property_changed(conn, path,
						OFONO_STK_INTERFACE,
						"MainMenuTitle",
						DBUS_TYPE_STRING, &menu->title);

	signal = dbus_message_new_signal(path, OFONO_STK_INTERFACE,
						"PropertyChanged");
	if (!signal) {
		ofono_error("Unable to allocate new %s.PropertyChanged signal",
				OFONO_SIM_APP_INTERFACE);

		return;
	}

	dbus_message_iter_init_append(signal, &iter);

	dbus_message_iter_append_basic(&iter, DBUS_TYPE_STRING, &name);

	append_menu_items_variant(&iter, menu->items);

	g_dbus_send_message(conn, signal);
}

static void dict_append_menu(DBusMessageIter *dict, struct stk_menu *menu)
{
	DBusMessageIter entry;
	const char *key = "MainMenu";

	ofono_dbus_dict_append(dict, "MainMenuTitle",
				DBUS_TYPE_STRING, &menu->title);

	dbus_message_iter_open_container(dict, DBUS_TYPE_DICT_ENTRY,
						NULL, &entry);

	dbus_message_iter_append_basic(&entry, DBUS_TYPE_STRING, &key);

	append_menu_items_variant(&entry, menu->items);

	dbus_message_iter_close_container(dict, &entry);
}
Exemplo n.º 28
0
static void emit_card_removed(struct ofono_handsfree_card *card)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	const char *path = card->path;

	g_dbus_emit_signal(conn, OFONO_MANAGER_PATH,
				HFP_AUDIO_MANAGER_INTERFACE,
				"CardRemoved", DBUS_TYPE_OBJECT_PATH, &path,
				DBUS_TYPE_INVALID);
}
Exemplo n.º 29
0
static void call_volume_unregister(struct ofono_atom *atom)
{
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
	const char *path = __ofono_atom_get_path(atom);

	ofono_modem_remove_interface(modem, OFONO_CALL_VOLUME_INTERFACE);
	g_dbus_unregister_interface(conn, path,
					OFONO_CALL_VOLUME_INTERFACE);
}
Exemplo n.º 30
0
static void audio_settings_unregister(struct ofono_atom *atom)
{
	struct ofono_audio_settings *as = __ofono_atom_get_data(atom);
	const char *path = __ofono_atom_get_path(as->atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(as->atom);

	ofono_modem_remove_interface(modem, OFONO_AUDIO_SETTINGS_INTERFACE);
	g_dbus_unregister_interface(conn, path, OFONO_AUDIO_SETTINGS_INTERFACE);
}