File: manager.c

package info (click to toggle)
bluez 5.83-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 25,664 kB
  • sloc: ansic: 471,418; python: 4,751; sh: 4,580; makefile: 1,042; xml: 126
file content (60 lines) | stat: -rw-r--r-- 1,108 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  BlueZ - Bluetooth protocol stack for Linux
 *
 *  Copyright (C) 2010 Instituto Nokia de Tecnologia - INdT
 *
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdbool.h>

#include "lib/bluetooth.h"
#include "lib/sdp.h"

#include "src/log.h"
#include "src/adapter.h"
#include "src/device.h"
#include "src/profile.h"
#include "src/service.h"

#include "manager.h"
#include "server.h"

static int sap_server_probe(struct btd_profile *p, struct btd_adapter *adapter)
{
	DBG("path %s", adapter_get_path(adapter));

	return sap_server_register(adapter);
}

static void sap_server_remove(struct btd_profile *p,
						struct btd_adapter *adapter)
{
	const char *path = adapter_get_path(adapter);

	DBG("path %s", path);

	sap_server_unregister(path);
}

static struct btd_profile sap_profile = {
	.name		= "sap-server",
	.adapter_probe	= sap_server_probe,
	.adapter_remove	= sap_server_remove,
};

int sap_manager_init(void)
{
	btd_profile_register(&sap_profile);

	return 0;
}

void sap_manager_exit(void)
{
	btd_profile_unregister(&sap_profile);
}