mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2024-11-16 08:44:38 +08:00
Implement probe/remove for the example plugin
This commit is contained in:
parent
9a3a941ae4
commit
f2e093403e
@ -28,18 +28,39 @@
|
||||
#include <errno.h>
|
||||
|
||||
#include "plugin.h"
|
||||
#include "server.h"
|
||||
#include "logging.h"
|
||||
|
||||
static int echo_probe(const char *adapter)
|
||||
{
|
||||
debug("echo probe adapter %s", adapter);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void echo_remove(const char *adapter)
|
||||
{
|
||||
debug("echo remove adapter %s", adapter);
|
||||
}
|
||||
|
||||
static struct bt_server echo_server = {
|
||||
.uuid = "00001101-0000-1000-8000-00805F9B34FB",
|
||||
.probe = echo_probe,
|
||||
.remove = echo_remove,
|
||||
};
|
||||
|
||||
static int echo_init(void)
|
||||
{
|
||||
debug("Setup echo plugin");
|
||||
|
||||
return -EIO;
|
||||
return bt_register_server(&echo_server);
|
||||
}
|
||||
|
||||
static void echo_exit(void)
|
||||
{
|
||||
debug("Cleanup echo plugin");
|
||||
|
||||
bt_unregister_server(&echo_server);
|
||||
}
|
||||
|
||||
BLUETOOTH_PLUGIN_DEFINE("echo", echo_init, echo_exit)
|
||||
|
Loading…
Reference in New Issue
Block a user