profiles/alert/manager.c
builtin_modules += time
-builtin_sources += profiles/time/main.c profiles/time/server.h \
- profiles/time/server.c profiles/time/manager.c \
- profiles/time/manager.h
+builtin_sources += profiles/time/server.c
builtin_modules += proximity
builtin_sources += profiles/proximity/main.c profiles/proximity/manager.h \
+++ /dev/null
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2011 Nokia Corporation
- * Copyright (C) 2011 Marcel Holtmann <marcel@holtmann.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdint.h>
-#include <glib.h>
-#include <errno.h>
-
-#include "plugin.h"
-#include "hcid.h"
-#include "log.h"
-#include "manager.h"
-
-static int time_init(void)
-{
- return time_manager_init();
-}
-
-static void time_exit(void)
-{
- time_manager_exit();
-}
-
-BLUETOOTH_PLUGIN_DEFINE(time, VERSION,
- BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
- time_init, time_exit)
+++ /dev/null
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2012 Nokia Corporation
- * Copyright (C) 2012 Marcel Holtmann <marcel@holtmann.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdbool.h>
-
-#include "manager.h"
-#include "adapter.h"
-#include "device.h"
-#include "profile.h"
-#include "server.h"
-
-struct btd_profile time_profile = {
- .name = "gatt-time-server",
- .adapter_probe = time_server_init,
- .adapter_remove = time_server_exit,
-};
-
-int time_manager_init(void)
-{
- btd_profile_register(&time_profile);
-
- return 0;
-}
-
-void time_manager_exit(void)
-{
- btd_profile_unregister(&time_profile);
-}
+++ /dev/null
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2012 Nokia Corporation
- * Copyright (C) 2012 Marcel Holtmann <marcel@holtmann.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-int time_manager_init(void);
-void time_manager_exit(void);
#include <adapter.h>
#include <device.h>
#include <profile.h>
+#include <plugin.h>
#include "attrib/gattrib.h"
#include "attrib/att.h"
#include "attrib-server.h"
#include "attrib/gatt-service.h"
#include "log.h"
-#include "server.h"
#define CURRENT_TIME_SVC_UUID 0x1805
#define REF_TIME_UPDATE_SVC_UUID 0x1806
#define TIME_UPDATE_STAT_CHR_UUID 0x2A17
#define CT_TIME_CHR_UUID 0x2A2B
+enum {
+ UPDATE_RESULT_SUCCESSFUL = 0,
+ UPDATE_RESULT_CANCELED = 1,
+ UPDATE_RESULT_NO_CONN = 2,
+ UPDATE_RESULT_ERROR = 3,
+ UPDATE_RESULT_TIMEOUT = 4,
+ UPDATE_RESULT_NOT_ATTEMPTED = 5,
+};
+
+enum {
+ UPDATE_STATE_IDLE = 0,
+ UPDATE_STATE_PENDING = 1,
+};
+
+enum {
+ GET_REFERENCE_UPDATE = 1,
+ CANCEL_REFERENCE_UPDATE = 2,
+};
+
static int encode_current_time(uint8_t value[10])
{
struct timespec tp;
GATT_OPT_INVALID);
}
-int time_server_init(struct btd_profile *p, struct btd_adapter *adapter)
+static int time_server_init(struct btd_profile *p, struct btd_adapter *adapter)
{
const char *path = adapter_get_path(adapter);
return 0;
}
-void time_server_exit(struct btd_profile *p, struct btd_adapter *adapter)
+static void time_server_exit(struct btd_profile *p,
+ struct btd_adapter *adapter)
{
const char *path = adapter_get_path(adapter);
DBG("path %s", path);
}
+
+struct btd_profile time_profile = {
+ .name = "gatt-time-server",
+ .adapter_probe = time_server_init,
+ .adapter_remove = time_server_exit,
+};
+
+static int time_init(void)
+{
+ btd_profile_register(&time_profile);
+ return 0;
+}
+
+static void time_exit(void)
+{
+ btd_profile_unregister(&time_profile);
+}
+
+BLUETOOTH_PLUGIN_DEFINE(time, VERSION,
+ BLUETOOTH_PLUGIN_PRIORITY_DEFAULT,
+ time_init, time_exit)
+++ /dev/null
-/*
- *
- * BlueZ - Bluetooth protocol stack for Linux
- *
- * Copyright (C) 2011 Nokia Corporation
- * Copyright (C) 2011 Marcel Holtmann <marcel@holtmann.org>
- *
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- *
- */
-
-enum {
- UPDATE_RESULT_SUCCESSFUL = 0,
- UPDATE_RESULT_CANCELED = 1,
- UPDATE_RESULT_NO_CONN = 2,
- UPDATE_RESULT_ERROR = 3,
- UPDATE_RESULT_TIMEOUT = 4,
- UPDATE_RESULT_NOT_ATTEMPTED = 5,
-};
-
-enum {
- UPDATE_STATE_IDLE = 0,
- UPDATE_STATE_PENDING = 1,
-};
-
-enum {
- GET_REFERENCE_UPDATE = 1,
- CANCEL_REFERENCE_UPDATE = 2,
-};
-
-int time_server_init(struct btd_profile *p, struct btd_adapter *adapter);
-void time_server_exit(struct btd_profile *p, struct btd_adapter *adapter);