summaryrefslogtreecommitdiffstats
path: root/sdpd/service.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-07-29 20:14:27 +0200
committerMarcel Holtmann <marcel@holtmann.org>2008-07-29 20:14:27 +0200
commitd939483328489fb835bb425d36f7c7c73d52c388 (patch)
tree6606976116208fe89ddd76f2a5a22c18d32c27cf /sdpd/service.c
parente3afaa0b7ff373d89fd3fa257110a34df7495df7 (diff)
Remove useless cstate.c file
Diffstat (limited to 'sdpd/service.c')
-rw-r--r--sdpd/service.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/sdpd/service.c b/sdpd/service.c
index 002efc85..09459f43 100644
--- a/sdpd/service.c
+++ b/sdpd/service.c
@@ -31,6 +31,7 @@
#include <stdio.h>
#include <errno.h>
#include <stdlib.h>
+#include <sys/time.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
@@ -61,6 +62,23 @@ static sdp_version_t sdpVnumArray[1] = {
static const int sdpServerVnumEntries = 1;
/*
+ * A simple function which returns the time of day in
+ * seconds. Used for updating the service db state
+ * attribute of the service record of the SDP server
+ */
+uint32_t sdp_get_time()
+{
+ /*
+ * To handle failure in gettimeofday, so an old
+ * value is returned and service does not fail
+ */
+ static struct timeval tm;
+
+ gettimeofday(&tm, NULL);
+ return (uint32_t) tm.tv_sec;
+}
+
+/*
* The service database state is an attribute of the service record
* of the SDP server itself. This attribute is guaranteed to
* change if any of the contents of the service repository