Esempio n. 1
0
	dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path,
							DBUS_TYPE_INVALID);

	err = __connman_private_network_release(path);
	if (err < 0)
		return __connman_error_failed(msg, -err);

	return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}

static const GDBusMethodTable manager_methods[] = {
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
			NULL, set_property) },
	{ GDBUS_METHOD("GetTechnologies",
			NULL, GDBUS_ARGS({ "technologies", "a(oa{sv})" }),
			get_technologies) },
	{ GDBUS_METHOD("RemoveProvider",
			GDBUS_ARGS({ "provider", "o" }), NULL,
			remove_provider) },
	{ GDBUS_METHOD("GetServices",
			NULL, GDBUS_ARGS({ "services", "a(oa{sv})" }),
			get_services) },
	{ GDBUS_ASYNC_METHOD("ConnectProvider",
			      GDBUS_ARGS({ "provider", "a{sv}" }),
			      GDBUS_ARGS({ "path", "o" }),
			      connect_provider) },
	{ GDBUS_METHOD("RegisterAgent",
Esempio n. 2
0
	hfp->card = NULL;

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

	return dbus_message_new_method_return(msg);

error:
	return g_dbus_create_error(msg,
			BLUEZ_ERROR_INTERFACE ".Rejected",
			"Invalid arguments in method call");
}

static const GDBusMethodTable profile_methods[] = {
	{ GDBUS_ASYNC_METHOD("NewConnection",
				GDBUS_ARGS({ "device", "o"}, { "fd", "h"},
						{ "fd_properties", "a{sv}" }),
				NULL, profile_new_connection) },
	{ GDBUS_NOREPLY_METHOD("Release", NULL, NULL, profile_release) },
	{ GDBUS_METHOD("RequestDisconnection",
				GDBUS_ARGS({"device", "o"}), NULL,
				profile_disconnection) },
	{ }
};

static void connect_handler(DBusConnection *conn, void *user_data)
{
	uint16_t features = HFP_SDP_HF_FEATURE_ECNR |
				HFP_SDP_HF_FEATURE_3WAY |
				HFP_SDP_HF_FEATURE_CLIP |
				HFP_SDP_HF_FEATURE_REMOTE_VOLUME_CONTROL;
Esempio n. 3
0
					"Invalid arguments in method call");
		return;
	}

	if (a2dp->volume != volume)
		avrcp_set_volume(transport->device, volume);

	a2dp->volume = volume;

	g_dbus_pending_property_success(id);
}

static const GDBusMethodTable transport_methods[] = {
	{ GDBUS_ASYNC_METHOD("Acquire",
			NULL,
			GDBUS_ARGS({ "fd", "h" }, { "mtu_r", "q" },
							{ "mtu_w", "q" }),
			acquire) },
	{ GDBUS_ASYNC_METHOD("TryAcquire",
			NULL,
			GDBUS_ARGS({ "fd", "h" }, { "mtu_r", "q" },
							{ "mtu_w", "q" }),
			try_acquire) },
	{ GDBUS_ASYNC_METHOD("Release", NULL, NULL, release) },
	{ },
};

static const GDBusPropertyTable transport_properties[] = {
	{ "Device", "o", get_device },
	{ "UUID", "s", get_uuid },
	{ "Codec", "y", get_codec },
Esempio n. 4
0
static DBusMessage *cancel_request(DBusConnection *conn,
					DBusMessage *msg, void *user_data)
{
	bt_shell_printf("Request canceled\n");

	agent_release_prompt();
	dbus_message_unref(pending_message);
	pending_message = NULL;

	return dbus_message_new_method_return(msg);
}

static const GDBusMethodTable methods[] = {
	{ GDBUS_METHOD("Release", NULL, NULL, release_agent) },
	{ GDBUS_ASYNC_METHOD("RequestPinCode",
			GDBUS_ARGS({ "device", "o" }),
			GDBUS_ARGS({ "pincode", "s" }), request_pincode) },
	{ GDBUS_METHOD("DisplayPinCode",
			GDBUS_ARGS({ "device", "o" }, { "pincode", "s" }),
			NULL, display_pincode) },
	{ GDBUS_ASYNC_METHOD("RequestPasskey",
			GDBUS_ARGS({ "device", "o" }),
			GDBUS_ARGS({ "passkey", "u" }), request_passkey) },
	{ GDBUS_METHOD("DisplayPasskey",
			GDBUS_ARGS({ "device", "o" }, { "passkey", "u" },
							{ "entered", "q" }),
			NULL, display_passkey) },
	{ GDBUS_ASYNC_METHOD("RequestConfirmation",
			GDBUS_ARGS({ "device", "o" }, { "passkey", "u" }),
			NULL, request_confirmation) },
	{ GDBUS_ASYNC_METHOD("RequestAuthorization",
Esempio n. 5
0
	sender = dbus_message_get_sender(msg);

	dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path,
							DBUS_TYPE_INVALID);

	err = connman_agent_unregister(sender, path);
	if (err < 0)
		return __connman_error_failed(msg, -err);

	return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}

static const GDBusMethodTable manager_methods[] = {
	{ GDBUS_ASYNC_METHOD("Create",
			GDBUS_ARGS({ "properties", "a{sv}" }),
			GDBUS_ARGS({ "path", "o" }),
			create) },
	{ GDBUS_ASYNC_METHOD("Remove",
			GDBUS_ARGS({ "identifier", "o" }), NULL,
			remove) },
	{ GDBUS_METHOD("GetConnections", NULL,
			GDBUS_ARGS({ "connections", "a(oa{sv})" }),
			get_connections) },
	{ GDBUS_METHOD("RegisterAgent",
			GDBUS_ARGS({ "path", "o" }), NULL,
			register_agent) },
	{ GDBUS_METHOD("UnregisterAgent",
			GDBUS_ARGS({ "path", "o" }), NULL,
			unregister_agent) },
	{ },
};
Esempio n. 6
0
	dbus_message_iter_next(&args);

	apparam = g_obex_apparam_set_uint8(NULL, MAP_AP_CHARSET, CHARSET_UTF8);

	if (parse_push_options(apparam, &args) == NULL) {
		g_obex_apparam_free(apparam);
		return g_dbus_create_error(message,
				ERROR_INTERFACE ".InvalidArguments", NULL);
	}

	return push_message(map, message, filename, folder, apparam);
}

static const GDBusMethodTable map_methods[] = {
	{ GDBUS_ASYNC_METHOD("SetFolder",
				GDBUS_ARGS({ "name", "s" }), NULL,
				map_setpath) },
	{ GDBUS_ASYNC_METHOD("ListFolders",
			GDBUS_ARGS({ "filters", "a{sv}" }),
			GDBUS_ARGS({ "content", "aa{sv}" }),
			map_list_folders) },
	{ GDBUS_ASYNC_METHOD("ListMessages",
			GDBUS_ARGS({ "folder", "s" }, { "filter", "a{sv}" }),
			GDBUS_ARGS({ "messages", "a{oa{sv}}" }),
			map_list_messages) },
	{ GDBUS_METHOD("ListFilterFields",
			NULL,
			GDBUS_ARGS({ "fields", "as" }),
			map_list_filter_fields) },
	{ GDBUS_ASYNC_METHOD("UpdateInbox",
			NULL,
Esempio n. 7
0
	if (!hf->driver->request_phone_number)
		return __ofono_error_not_supported(msg);

	hf->pending = dbus_message_ref(msg);
	hf->driver->request_phone_number(hf, request_phone_number_cb, hf);

	return NULL;
}

static const GDBusMethodTable handsfree_methods[] = {
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			handsfree_get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
			NULL, handsfree_set_property) },
	{ GDBUS_ASYNC_METHOD("RequestPhoneNumber",
			NULL, GDBUS_ARGS({ "number", "s" }),
			handsfree_request_phone_number) },
	{ }
};

static const GDBusSignalTable handsfree_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
	{ }
};

static void handsfree_remove(struct ofono_atom *atom)
{
Esempio n. 8
0
	if (agent_if->pending_reply != NULL) {
		dbus_message_unref(agent_if->pending_reply);
		agent_if->pending_reply = NULL;
	}

	if (agent_if->cancel_cb != NULL)
		agent_if->cancel_cb();

reply:
	return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
}

static GDBusMethodTable agent_methods[] = {
	{ GDBUS_METHOD("Release", NULL, NULL, agent_release_method) },
	{ GDBUS_ASYNC_METHOD("ReportError",
			GDBUS_ARGS({"service", "o"}, {"error", "s"}),
			NULL, agent_report_error_method) },
	{ GDBUS_ASYNC_METHOD("RequestBrowser",
			GDBUS_ARGS({"service", "o"}, {"url", "s"}),
			NULL, agent_request_browser_method) },
	{ GDBUS_ASYNC_METHOD("RequestInput",
			GDBUS_ARGS({"service", "o"}, {"fields", "a{sv}"}),
			GDBUS_ARGS({"inputs", "a{sv}"}),
			agent_request_input_method) },
	{ GDBUS_METHOD("Cancel", NULL, NULL, agent_cancel_method) },
	{ NULL },
};

static inline void send_agent_reply(DBusMessage *reply)
{
	if (reply == NULL)
Esempio n. 9
0
	if (obc_session_queue(map->session, transfer, buffer_cb, map, &err)) {
		map->msg = dbus_message_ref(message);
		return NULL;
	}

fail:
	reply = g_dbus_create_error(message, "org.openobex.Error.Failed", "%s",
								err->message);
	g_error_free(err);
	return reply;
}

static const GDBusMethodTable map_methods[] = {
	{ GDBUS_ASYNC_METHOD("SetFolder",
				GDBUS_ARGS({ "name", "string" }), NULL,
				map_setpath) },
	{ GDBUS_ASYNC_METHOD("GetFolderListing",
					GDBUS_ARGS({ "dummy", "a{ss}" }),
					GDBUS_ARGS({ "content", "s" }),
					map_get_folder_listing) },
	{ GDBUS_ASYNC_METHOD("GetMessageListing",
			GDBUS_ARGS({ "folder", "s" }, { "dummy", "a{ss}" }),
			GDBUS_ARGS({ "messages", "s" }),
			map_get_message_listing) },
	{ }
};

static void map_free(void *data)
{
	struct map_data *map = data;
Esempio n. 10
0
static DBusMessage *release_method(DBusConnection *dbus_conn,
					DBusMessage *message, void *user_data)
{
	DBG("");

	agent_registered = FALSE;
	g_dbus_unregister_interface(connection,
					AGENT_PATH, NEARD_AGENT_INTERFACE);

	return g_dbus_create_reply(message, DBUS_TYPE_INVALID);
}

static const GDBusMethodTable neard_methods[] = {
{ GDBUS_ASYNC_METHOD("RequestOOB",
		GDBUS_ARGS({ "data", "a{sv}" }),
		GDBUS_ARGS({ "data", "a{sv}" }), request_oob_method) },
	{ GDBUS_ASYNC_METHOD("PushOOB",
		GDBUS_ARGS({ "data", "a{sv}"}), NULL, push_oob_method) },
	{ GDBUS_METHOD("Release", NULL, NULL, release_method) },
	{ },
};

static void cleanup_register_call(void)
{
	if (register_call != NULL) {
		dbus_pending_call_cancel(register_call);
		dbus_pending_call_unref(register_call);
		register_call = NULL;
	}
}
Esempio n. 11
0
	struct media_folder *folder = mp->scope;

	if (folder == NULL)
		return FALSE;

	DBG("%u", folder->number_of_items);

	dbus_message_iter_append_basic(iter, DBUS_TYPE_UINT32,
						&folder->number_of_items);

	return TRUE;
}

static const GDBusMethodTable media_folder_methods[] = {
	{ GDBUS_ASYNC_METHOD("Search",
			GDBUS_ARGS({ "string", "s" }, { "filter", "a{sv}" }),
			GDBUS_ARGS({ "folder", "o" }),
			media_folder_search) },
	{ GDBUS_ASYNC_METHOD("ListItems",
			GDBUS_ARGS({ "filter", "a{sv}" }),
			GDBUS_ARGS({ "items", "a{oa{sv}}" }),
			media_folder_list_items) },
	{ GDBUS_ASYNC_METHOD("ChangeFolder",
			GDBUS_ARGS({ "folder", "o" }), NULL,
			media_folder_change_folder) },
	{ }
};

static const GDBusPropertyTable media_folder_properties[] = {
	{ "Name", "s", get_folder_name, NULL, folder_name_exists,
					G_DBUS_PROPERTY_FLAG_EXPERIMENTAL },
	{ "NumberOfItems", "u", get_items, NULL, items_exists,
Esempio n. 12
0
	dbus_message_iter_open_container(&iter, DBUS_TYPE_ARRAY,
					OFONO_PROPERTIES_ARRAY_SIGNATURE,
					&dict);

	value = ussd_get_state_string(ussd);
	ofono_dbus_dict_append(&dict, "State", DBUS_TYPE_STRING, &value);

	dbus_message_iter_close_container(&iter, &dict);

	return reply;
}

static const GDBusMethodTable ussd_methods[] = {
	{ GDBUS_ASYNC_METHOD("Initiate",
			GDBUS_ARGS({ "command", "s" }),
			GDBUS_ARGS({ "result_name", "s" }, { "value", "v" }),
			ussd_initiate) },
	{ GDBUS_ASYNC_METHOD("Respond",
			GDBUS_ARGS({ "reply", "s" }),
			GDBUS_ARGS({ "result", "s" }),
			ussd_respond) },
	{ GDBUS_ASYNC_METHOD("Cancel", NULL, NULL, ussd_cancel) },
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			ussd_get_properties) },
	{ }
};

static const GDBusSignalTable ussd_signals[] = {
	{ GDBUS_SIGNAL("NotificationReceived",
					GDBUS_ARGS({ "message", "s" })) },
Esempio n. 13
0
	ofono_dbus_dict_append(&dict, "TransmitPowerThrottling",
				DBUS_TYPE_BOOLEAN,
				&tm->throttling);

	dbus_message_iter_close_container(&iter, &dict);

	return reply;
}

static const GDBusMethodTable thermal_management_methods[] = {
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			thermal_management_get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
			NULL, thermal_management_set_property) },
	{}
};

static const GDBusSignalTable thermal_management_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
	{ }
};

static void thermal_management_cleanup(void *data)
{
	struct ril_thermal_management *tm = data;

	if (tm->pending)
Esempio n. 14
0
				ERROR_INTERFACE ".InvalidArguments", NULL);

	sender = dbus_message_get_sender(message);
	if (g_str_equal(sender, obc_session_get_owner(session)) == FALSE)
		return g_dbus_create_error(message,
				ERROR_INTERFACE ".NotAuthorized",
				"Not Authorized");

	release_session(session);

	return dbus_message_new_method_return(message);
}

static const GDBusMethodTable client_methods[] = {
	{ GDBUS_ASYNC_METHOD("CreateSession",
			GDBUS_ARGS({ "destination", "s" }, { "args", "a{sv}" }),
			GDBUS_ARGS({ "session", "o" }), create_session) },
	{ GDBUS_ASYNC_METHOD("RemoveSession",
			GDBUS_ARGS({ "session", "o" }), NULL, remove_session) },
	{ }
};

static DBusConnection *conn = NULL;

static struct obc_module {
	const char *name;
	int (*init) (void);
	void (*exit) (void);
} modules[] = {
	{ "bluetooth", bluetooth_init, bluetooth_exit },
	{ "opp", opp_init, opp_exit },
Esempio n. 15
0
		err = set_powered(conn, mgr, powered);
		if (err < 0)
			return NULL;

		return NULL;
	}

	return __dbus_error_invalid_args(msg);
}

static const GDBusMethodTable manager_methods[] = {
	{ GDBUS_METHOD("GetProperties",
		NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
		manager_get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
		GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
		NULL, manager_set_property) },
	{ }
};

static const GDBusSignalTable manager_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
		GDBUS_ARGS({ "property", "s" }, { "value", "v" })) },
	{ }
};

static void log_handler(const char *message, void *user_data)
{
	g_debug("%s", message);
}
Esempio n. 16
0
						CONNMAN_IPCONFIG_TYPE_IPV4);
	if (!ipconfig)
		return NULL;

	__connman_ipconfig_set_method(ipconfig, CONNMAN_IPCONFIG_METHOD_DHCP);
	__connman_ipconfig_set_data(ipconfig, user_data);
	__connman_ipconfig_set_ops(ipconfig, &peer_ip_ops);

	return ipconfig;
}

static const GDBusMethodTable peer_methods[] = {
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			get_peer_properties) },
	{ GDBUS_ASYNC_METHOD("Connect", NULL, NULL, connect_peer) },
	{ GDBUS_METHOD("Disconnect", NULL, NULL, disconnect_peer) },
	{ },
};

static const GDBusSignalTable peer_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
	{ },
};

static char *get_peer_path(struct connman_device *device,
					const char *identifier)
{
	return g_strdup_printf("%s/peer/peer_%s_%s", CONNMAN_PATH,
				connman_device_get_ident(device), identifier);
Esempio n. 17
0
	/* Store msg to request struct to allow multiple parallel requests */
	req->pending = dbus_message_ref(msg);
	raw->driver->request(raw, req, ofono_oem_raw_query_cb, req);

	return NULL;

error_arg:
	DBG("DBus arg type=%c, msg signature: %s",
		dbus_message_iter_get_arg_type(&iter),
		dbus_message_get_signature(msg));
	return __ofono_error_invalid_args(msg);
}

static const GDBusMethodTable oem_raw_methods[] = {
	{ GDBUS_ASYNC_METHOD("Send",
			GDBUS_ARGS({ "req", "ay" }),
			GDBUS_ARGS({ "response", "ay"}),
			oem_raw_make_request) },
	{ }
};

static const GDBusSignalTable oem_raw_signals[] = {
	{ }
};

static void oem_raw_dbus_unregister(struct ofono_atom *atom)
{
	DBG("");
	struct ofono_oem_raw *oemraw = __ofono_atom_get_data(atom);
	const char *path = __ofono_atom_get_path(oemraw->atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(oemraw->atom);
Esempio n. 18
0
	struct ofono_modem *modem = data;
	struct hfp_data *hfp_data = ofono_modem_get_data(modem);
	const char *obj_path = ofono_modem_get_path(modem);

	g_dbus_unregister_interface(connection, obj_path, HFP_AGENT_INTERFACE);
	hfp_data->agent_registered = FALSE;

	g_hash_table_remove(modem_hash, hfp_data->handsfree_path);
	ofono_modem_remove(modem);

	return dbus_message_new_method_return(msg);
}

static const GDBusMethodTable agent_methods[] = {
	{ GDBUS_ASYNC_METHOD("NewConnection",
				GDBUS_ARGS({ "fd", "h" }, { "version", "q" }),
				NULL, hfp_agent_new_connection) },
	{ GDBUS_METHOD("Release", NULL, NULL, hfp_agent_release) },
	{ }
};

static int hfp_hf_probe(const char *device, const char *dev_addr,
				const char *adapter_addr, const char *alias)
{
	struct ofono_modem *modem;
	struct hfp_data *data;
	char buf[256];

	/* We already have this device in our hash, ignore */
	if (g_hash_table_lookup(modem_hash, device) != NULL)
		return -EALREADY;
Esempio n. 19
0
	propdata->conn = connection;
	pending_property_set = g_slist_prepend(pending_property_set, propdata);

	property->set(property, &sub, propdata->id, iface->user_data);

	return NULL;
}

static const GDBusMethodTable properties_methods[] = {
	{ GDBUS_METHOD("Get",
			GDBUS_ARGS({ "interface", "s" }, { "name", "s" }),
			GDBUS_ARGS({ "value", "v" }),
			properties_get) },
	{ GDBUS_ASYNC_METHOD("Set",
			GDBUS_ARGS({ "interface", "s" }, { "name", "s" },
							{ "value", "v" }),
			NULL,
			properties_set) },
	{ GDBUS_METHOD("GetAll",
			GDBUS_ARGS({ "interface", "s" }),
			GDBUS_ARGS({ "properties", "a{sv}" }),
			properties_get_all) },
	{ }
};

static const GDBusSignalTable properties_signals[] = {
	{ GDBUS_SIGNAL("PropertiesChanged",
			GDBUS_ARGS({ "interface", "s" },
					{ "changed_properties", "a{sv}" },
					{ "invalidated_properties", "as"})) },
	{ }
Esempio n. 20
0
					DBUS_TYPE_INVALID) == FALSE)
		return __ofono_error_invalid_args(msg);

	if (!__ofono_is_valid_sim_pin(pin2, OFONO_SIM_PASSWORD_SIM_PIN2))
		return __ofono_error_invalid_format(msg);

	cm->pending = dbus_message_ref(msg);

	cm->driver->acm_reset(cm, pin2, acm_reset_callback, cm);

	return NULL;
}

static const GDBusMethodTable cm_methods[] = {
	{ GDBUS_ASYNC_METHOD("GetProperties",
				NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
				cm_get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "property", "s" }, { "value", "v" },
							{ "password", "s" }),
			NULL, cm_set_property) },
	{ GDBUS_ASYNC_METHOD("Reset",
				GDBUS_ARGS({ "passoword", "s" }), NULL,
				cm_acm_reset) },
	{ }
};

static const GDBusSignalTable cm_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "property", "s" }, { "value", "v" })) },
	{ GDBUS_SIGNAL("NearMaximumWarning", NULL) },
Esempio n. 21
0
	ret = __connman_peer_service_unregister(owner, spec, spec_len,
						query, query_len, version);
	if (!ret)
		return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
error:
	return __connman_error_failed(msg, -ret);

}

static const GDBusMethodTable manager_methods[] = {
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
			NULL, set_property) },
	{ GDBUS_METHOD("GetTechnologies",
			NULL, GDBUS_ARGS({ "technologies", "a(oa{sv})" }),
			get_technologies) },
	{ GDBUS_DEPRECATED_METHOD("RemoveProvider",
			GDBUS_ARGS({ "provider", "o" }), NULL,
			remove_provider) },
	{ GDBUS_METHOD("GetServices",
			NULL, GDBUS_ARGS({ "services", "a(oa{sv})" }),
			get_services) },
	{ GDBUS_METHOD("GetPeers",
			NULL, GDBUS_ARGS({ "peers", "a(oa{sv})" }),
			get_peers) },
	{ GDBUS_DEPRECATED_ASYNC_METHOD("ConnectProvider",
			      GDBUS_ARGS({ "provider", "a{sv}" }),
Esempio n. 22
0
		return NULL;

	dbus_message_iter_init_append(reply, &iter);

	transport_get_properties(transport, &iter);

	return reply;
}

static const GDBusMethodTable transport_methods[] = {
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			get_properties) },
	{ GDBUS_ASYNC_METHOD("Acquire",
			GDBUS_ARGS({ "access_type", "s" }),
			GDBUS_ARGS({ "fd", "h" }, { "mtu_r", "q" },
							{ "mtu_w", "q" } ),
			acquire) },
	{ GDBUS_ASYNC_METHOD("Release",
			GDBUS_ARGS({ "access_type", "s" }), NULL,
			release ) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
			NULL, set_property) },
	{ },
};

static const GDBusSignalTable transport_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
	{ }
Esempio n. 23
0
fallback:
	/* There's no driver, fallback to direct SCO connection */
	err = ofono_handsfree_card_connect_sco(card);
	if (err < 0)
		return __ofono_error_failed(msg);

	card->msg = dbus_message_ref(msg);

	return NULL;
}

static const GDBusMethodTable card_methods[] = {
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			card_get_properties) },
	{ GDBUS_ASYNC_METHOD("Connect", NULL, NULL, card_connect) },
	{ }
};

static const GDBusSignalTable card_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
	{ }
};

struct ofono_handsfree_card *ofono_handsfree_card_create(unsigned int vendor,
					enum ofono_handsfree_card_type type,
					const char *driver,
					void *data)
{
	struct ofono_handsfree_card *card;
Esempio n. 24
0
	technology->scan_pending =
		g_slist_prepend(technology->scan_pending, msg);

	err = __connman_device_request_scan(technology->type);
	if (err < 0)
		reply_scan_pending(technology, err);

	return NULL;
}

static const GDBusMethodTable technology_methods[] = {
	{ GDBUS_DEPRECATED_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" }),
			NULL, set_property) },
	{ GDBUS_ASYNC_METHOD("Scan", NULL, NULL, scan) },
	{ },
};

static const GDBusSignalTable technology_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
	{ },
};

static gboolean technology_dbus_register(struct connman_technology *technology)
{
	if (technology->dbus_registered == TRUE ||
				(technology->rfkill_driven == TRUE &&
Esempio n. 25
0
fail:
	reply = g_dbus_create_error(message,
					"org.openobex.Error.Failed",
					"%s", gerr->message);
	g_error_free(gerr);
	return reply;

}

static const GDBusMethodTable session_methods[] = {
	{ GDBUS_METHOD("GetProperties",
				NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
				session_get_properties) },
	{ GDBUS_ASYNC_METHOD("GetCapabilities",
				NULL, GDBUS_ARGS({ "capabilities", "s" }),
				get_capabilities) },
	{ }
};

static gboolean session_queue_complete(gpointer data)
{
	struct obc_session *session = data;

	session_process_queue(session);

	session->queue_complete_id = 0;

	return FALSE;
}
Esempio n. 26
0
			return dbus_message_new_method_return(msg);

		rs->pending = dbus_message_ref(msg);
		rs->fast_dormancy_pending = target;

		rs->driver->set_fast_dormancy(rs, target,
					radio_fast_dormancy_set_callback, rs);
		return NULL;
	}

	return __ofono_error_invalid_args(msg);
}

static const GDBusMethodTable radio_methods[] = {
	{ GDBUS_ASYNC_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			radio_get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
			NULL, radio_set_property) },
	{ }
};

static const GDBusSignalTable radio_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
	{ }
};

int ofono_radio_settings_driver_register(const struct ofono_radio_settings_driver *d)
{
Esempio n. 27
0
File: sms.c Progetto: AndriusA/ofono
			g_source_remove(sms->tx_source);
			sms->tx_source = 0;

			if (g_queue_get_length(sms->txq) > 1)
				sms->tx_source = g_timeout_add(0, tx_next, sms);
		}
	}

	sms_tx_queue_remove_entry(sms, l, MESSAGE_STATE_CANCELLED);

	return 0;
}

static const GDBusMethodTable sms_manager_methods[] = {
	{ GDBUS_ASYNC_METHOD("GetProperties",
				NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
				sms_get_properties) },
	{ GDBUS_ASYNC_METHOD("SetProperty",
			GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
			NULL, sms_set_property) },
	{ GDBUS_ASYNC_METHOD("SendMessage",
			GDBUS_ARGS({ "to", "s" }, { "text", "s" }),
			GDBUS_ARGS({ "path", "o" }),
			sms_send_message) },
	{ GDBUS_METHOD("GetMessages",
			NULL, GDBUS_ARGS({ "messages", "a(oa{sv})" }),
			sms_get_messages) },
	{ }
};

static const GDBusSignalTable sms_manager_signals[] = {
Esempio n. 28
0
	if (gnss->posr_agent == NULL)
		return __ofono_error_not_available(msg);

	if (!gnss_agent_sender_matches(gnss->posr_agent, caller))
		return __ofono_error_access_denied(msg);

	gnss->pending = dbus_message_ref(msg);

	gnss->driver->send_element(gnss, xml, gnss_send_element_cb, gnss);

	return NULL;
}

static const GDBusMethodTable gnss_methods[] = {
	{ GDBUS_ASYNC_METHOD("SendPositioningElement",
			GDBUS_ARGS({ "xml_element" "s" }), NULL,
			gnss_send_element) },
	{ GDBUS_ASYNC_METHOD("RegisterPositioningRequestAgent",
			GDBUS_ARGS({ "agent", "o" }), NULL,
			gnss_register_agent) },
	{ GDBUS_ASYNC_METHOD("UnregisterPositioningRequestAgent",
			GDBUS_ARGS({ "agent", "o" }), NULL,
			gnss_unregister_agent) },
	{ }
};

static void gnss_unregister(struct ofono_atom *atom)
{
	struct ofono_gnss *gnss = __ofono_atom_get_data(atom);
	DBusConnection *conn = ofono_dbus_get_connection();
	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
Esempio n. 29
0
    dbus_message_iter_recurse(&iter, &var);

    if (g_str_equal(name, "Active"))
        return set_property_active(device, msg, &var);

    return __dundee_error_invalid_args(msg);
}

static const GDBusMethodTable device_methods[] = {
    {   GDBUS_METHOD("GetProperties",
        NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
        device_get_properties)
    },
    {   GDBUS_ASYNC_METHOD("SetProperty",
        GDBUS_ARGS({ "property", "s" }, { "value", "v" }),
        NULL, device_set_property)
    },
    { }
};

static const GDBusSignalTable device_signals[] = {
    {   GDBUS_SIGNAL("PropertyChanged",
        GDBUS_ARGS({ "name", "s" }, { "value", "v" }))
    },
    { }
};

static int register_device(struct dundee_device *device)
{
    DBusConnection *conn = ofono_dbus_get_connection();
Esempio n. 30
0
	g_free(peer);
}

static void path_unregister(void *data)
{
	struct network_peer *peer = data;

	DBG("Unregistered interface %s on path %s",
		NETWORK_PEER_INTERFACE, peer->path);

	peers = g_slist_remove(peers, peer);
	peer_free(peer);
}

static const GDBusMethodTable connection_methods[] = {
	{ GDBUS_ASYNC_METHOD("Connect",
			NULL, NULL, connection_connect) },
	{ GDBUS_METHOD("Disconnect",
			NULL, NULL, connection_disconnect) },
	{ GDBUS_METHOD("GetProperties",
			NULL, GDBUS_ARGS({ "properties", "a{sv}" }),
			connection_get_properties) },
	{ }
};

static const GDBusSignalTable connection_signals[] = {
	{ GDBUS_SIGNAL("PropertyChanged",
			GDBUS_ARGS({ "name", "s" }, { "value", "v" })) },
	{ }
};

void connection_unregister(const char *path, uint16_t id)