Blame src/agent.h

Packit 34410b
/*
Packit 34410b
 *
Packit 34410b
 *  BlueZ - Bluetooth protocol stack for Linux
Packit 34410b
 *
Packit 34410b
 *  Copyright (C) 2006-2010  Nokia Corporation
Packit 34410b
 *  Copyright (C) 2004-2010  Marcel Holtmann <marcel@holtmann.org>
Packit 34410b
 *
Packit 34410b
 *
Packit 34410b
 *  This program is free software; you can redistribute it and/or modify
Packit 34410b
 *  it under the terms of the GNU General Public License as published by
Packit 34410b
 *  the Free Software Foundation; either version 2 of the License, or
Packit 34410b
 *  (at your option) any later version.
Packit 34410b
 *
Packit 34410b
 *  This program is distributed in the hope that it will be useful,
Packit 34410b
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 34410b
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 34410b
 *  GNU General Public License for more details.
Packit 34410b
 *
Packit 34410b
 *  You should have received a copy of the GNU General Public License
Packit 34410b
 *  along with this program; if not, write to the Free Software
Packit 34410b
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
Packit 34410b
 *
Packit 34410b
 */
Packit 34410b
Packit 34410b
#define IO_CAPABILITY_DISPLAYONLY	0x00
Packit 34410b
#define IO_CAPABILITY_DISPLAYYESNO	0x01
Packit 34410b
#define IO_CAPABILITY_KEYBOARDONLY	0x02
Packit 34410b
#define IO_CAPABILITY_NOINPUTNOOUTPUT	0x03
Packit 34410b
#define IO_CAPABILITY_KEYBOARDDISPLAY	0x04
Packit 34410b
#define IO_CAPABILITY_INVALID		0xFF
Packit 34410b
Packit 34410b
struct agent;
Packit 34410b
Packit 34410b
typedef void (*agent_cb) (struct agent *agent, DBusError *err,
Packit 34410b
				void *user_data);
Packit 34410b
Packit 34410b
typedef void (*agent_pincode_cb) (struct agent *agent, DBusError *err,
Packit 34410b
					const char *pincode, void *user_data);
Packit 34410b
Packit 34410b
typedef void (*agent_passkey_cb) (struct agent *agent, DBusError *err,
Packit 34410b
					uint32_t passkey, void *user_data);
Packit 34410b
Packit 34410b
struct agent *agent_ref(struct agent *agent);
Packit 34410b
void agent_unref(struct agent *agent);
Packit 34410b
Packit 34410b
struct agent *agent_get(const char *owner);
Packit 34410b
Packit 34410b
int agent_authorize_service(struct agent *agent, const char *path,
Packit 34410b
				const char *uuid, agent_cb cb,
Packit 34410b
				void *user_data, GDestroyNotify destroy);
Packit 34410b
Packit 34410b
int agent_request_pincode(struct agent *agent, struct btd_device *device,
Packit 34410b
				agent_pincode_cb cb, gboolean secure,
Packit 34410b
				void *user_data, GDestroyNotify destroy);
Packit 34410b
Packit 34410b
int agent_request_passkey(struct agent *agent, struct btd_device *device,
Packit 34410b
				agent_passkey_cb cb, void *user_data,
Packit 34410b
				GDestroyNotify destroy);
Packit 34410b
Packit 34410b
int agent_request_confirmation(struct agent *agent, struct btd_device *device,
Packit 34410b
				uint32_t passkey, agent_cb cb,
Packit 34410b
				void *user_data, GDestroyNotify destroy);
Packit 34410b
Packit 34410b
int agent_request_authorization(struct agent *agent, struct btd_device *device,
Packit 34410b
						agent_cb cb, void *user_data,
Packit 34410b
						GDestroyNotify destroy);
Packit 34410b
Packit 34410b
int agent_display_passkey(struct agent *agent, struct btd_device *device,
Packit 34410b
				uint32_t passkey, uint16_t entered);
Packit 34410b
Packit 34410b
int agent_display_pincode(struct agent *agent, struct btd_device *device,
Packit 34410b
				const char *pincode, agent_cb cb,
Packit 34410b
				void *user_data, GDestroyNotify destroy);
Packit 34410b
Packit 34410b
int agent_cancel(struct agent *agent);
Packit 34410b
Packit 34410b
uint8_t agent_get_io_capability(struct agent *agent);
Packit 34410b
Packit 34410b
void btd_agent_init(void);
Packit 34410b
void btd_agent_cleanup(void);