summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-03-12 19:23:22 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-03-12 19:23:22 +0000
commitf2e093403e97b8f17343a0a429237f922f32a57c (patch)
tree7cd84826327fa6c93c860dc6e3a3f6bd7f98b7de /plugins
parent9a3a941ae455e4481392fb3e5d6b87750d0d9609 (diff)
Implement probe/remove for the example plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/echo.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/plugins/echo.c b/plugins/echo.c
index 8e06ea75..81999a64 100644
--- a/plugins/echo.c
+++ b/plugins/echo.c
@@ -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)