Blame src/profile.h

Packit 34410b
/*
Packit 34410b
 *
Packit 34410b
 *  BlueZ - Bluetooth protocol stack for Linux
Packit 34410b
 *
Packit 34410b
 *  Copyright (C) 2012  Intel Corporation. All rights reserved.
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 BTD_PROFILE_PRIORITY_LOW	0
Packit 34410b
#define BTD_PROFILE_PRIORITY_MEDIUM	1
Packit 34410b
#define BTD_PROFILE_PRIORITY_HIGH	2
Packit 34410b
Packit 34410b
struct btd_service;
Packit 34410b
Packit 34410b
struct btd_profile {
Packit 34410b
	const char *name;
Packit 34410b
	int priority;
Packit 34410b
Packit 34410b
	const char *local_uuid;
Packit 34410b
	const char *remote_uuid;
Packit 34410b
Packit 34410b
	bool auto_connect;
Packit 34410b
	bool external;
Packit 34410b
Packit 34410b
	int (*device_probe) (struct btd_service *service);
Packit 34410b
	void (*device_remove) (struct btd_service *service);
Packit 34410b
Packit 34410b
	int (*connect) (struct btd_service *service);
Packit 34410b
	int (*disconnect) (struct btd_service *service);
Packit 34410b
Packit 34410b
	int (*accept) (struct btd_service *service);
Packit 34410b
Packit 34410b
	int (*adapter_probe) (struct btd_profile *p,
Packit 34410b
						struct btd_adapter *adapter);
Packit 34410b
	void (*adapter_remove) (struct btd_profile *p,
Packit 34410b
						struct btd_adapter *adapter);
Packit 34410b
};
Packit 34410b
Packit 34410b
void btd_profile_foreach(void (*func)(struct btd_profile *p, void *data),
Packit 34410b
								void *data);
Packit 34410b
Packit 34410b
int btd_profile_register(struct btd_profile *profile);
Packit 34410b
void btd_profile_unregister(struct btd_profile *profile);
Packit 34410b
Packit 34410b
typedef bool (*btd_profile_prop_exists)(const char *uuid,
Packit 34410b
						struct btd_device *dev,
Packit 34410b
						void *user_data);
Packit 34410b
Packit 34410b
typedef bool (*btd_profile_prop_get)(const char *uuid,
Packit 34410b
						struct btd_device *dev,
Packit 34410b
						DBusMessageIter *iter,
Packit 34410b
						void *user_data);
Packit 34410b
Packit 34410b
bool btd_profile_add_custom_prop(const char *uuid, const char *type,
Packit 34410b
					const char *name,
Packit 34410b
					btd_profile_prop_exists exists,
Packit 34410b
					btd_profile_prop_get get,
Packit 34410b
					void *user_data);
Packit 34410b
bool btd_profile_remove_custom_prop(const char *uuid, const char *name);
Packit 34410b
Packit 34410b
void btd_profile_init(void);
Packit 34410b
void btd_profile_cleanup(void);