summaryrefslogtreecommitdiff
path: root/tools/ibeacon.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2014-03-20 09:36:29 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2014-03-20 09:36:29 +0200
commit8203def2864764c14da1a98d0fe0714b931485e8 (patch)
tree81c1b9391faa52b46dcb91c6bff46774321e6da0 /tools/ibeacon.c
parent7d6bc43bca25515f46a7dc6829ec1c65bdf7b507 (diff)
downloadbluez-8203def2864764c14da1a98d0fe0714b931485e8.tar.gz
tools/ibeacon: Convert to using shared/timeout.h
Diffstat (limited to 'tools/ibeacon.c')
-rw-r--r--tools/ibeacon.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/ibeacon.c b/tools/ibeacon.c
index 093fba1f3..28967de31 100644
--- a/tools/ibeacon.c
+++ b/tools/ibeacon.c
@@ -38,24 +38,26 @@
#include "monitor/mainloop.h"
#include "monitor/bt.h"
+#include "src/shared/timeout.h"
#include "src/shared/util.h"
#include "src/shared/hci.h"
static int urandom_fd;
static struct bt_hci *hci_dev;
-static void shutdown_timeout(int id, void *user_data)
+static bool shutdown_timeout(void *user_data)
{
- mainloop_remove_timeout(id);
-
mainloop_quit();
+
+ return false;
}
static void shutdown_complete(const void *data, uint8_t size, void *user_data)
{
unsigned int id = PTR_TO_UINT(user_data);
- shutdown_timeout(id, NULL);
+ timeout_remove(id);
+ mainloop_quit();
}
static void shutdown_device(void)
@@ -65,7 +67,7 @@ static void shutdown_device(void)
bt_hci_flush(hci_dev);
- id = mainloop_add_timeout(5000, shutdown_timeout, NULL, NULL);
+ id = timeout_add(5000, shutdown_timeout, NULL, NULL);
bt_hci_send(hci_dev, BT_HCI_CMD_LE_SET_ADV_ENABLE,
&enable, 1, NULL, NULL, NULL);