Implement probe/remove for the example plugin

This commit is contained in:
Marcel Holtmann 2008-03-12 19:23:22 +00:00
parent 9a3a941ae4
commit f2e093403e

View File

@ -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)