summaryrefslogtreecommitdiff
path: root/android/main.c
diff options
context:
space:
mode:
authorGrzegorz Kolodziejczyk <grzegorz.kolodziejczyk@tieto.com>2014-03-03 15:51:06 +0100
committerSzymon Janc <szymon.janc@tieto.com>2014-03-03 16:11:07 +0100
commit319245da2b81456dd207334456c7a68f704590e2 (patch)
tree7645c962a6d33f0ec0326b2b575681f4020552b2 /android/main.c
parentc93c7c95ed053917bf1f2cca42325d718a43b151 (diff)
downloadbluez-319245da2b81456dd207334456c7a68f704590e2.tar.gz
android/gatt: Add initial files
This adds initial daemon code for GATT profile.
Diffstat (limited to 'android/main.c')
-rw-r--r--android/main.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/android/main.c b/android/main.c
index f7fe9c86e..db7951d82 100644
--- a/android/main.c
+++ b/android/main.c
@@ -58,6 +58,7 @@
#include "pan.h"
#include "avrcp.h"
#include "handsfree.h"
+#include "gatt.h"
#define STARTUP_GRACE_SECONDS 5
#define SHUTDOWN_GRACE_SECONDS 10
@@ -126,6 +127,13 @@ static void service_register(const void *buf, uint16_t len)
}
break;
+ case HAL_SERVICE_ID_GATT:
+ if (!bt_gatt_register(hal_ipc, &adapter_bdaddr)) {
+ status = HAL_STATUS_FAILED;
+ goto failed;
+ }
+
+ break;
default:
DBG("service %u not supported", m->service_id);
status = HAL_STATUS_FAILED;
@@ -175,6 +183,9 @@ static void service_unregister(const void *buf, uint16_t len)
case HAL_SERVICE_ID_HANDSFREE:
bt_handsfree_unregister();
break;
+ case HAL_SERVICE_ID_GATT:
+ bt_gatt_unregister();
+ break;
default:
/* This would indicate bug in HAL, as unregister should not be
* called in init failed */
@@ -374,6 +385,9 @@ static void cleanup_services(void)
case HAL_SERVICE_ID_HANDSFREE:
bt_handsfree_unregister();
break;
+ case HAL_SERVICE_ID_GATT:
+ bt_gatt_unregister();
+ break;
}
services[i] = false;