summaryrefslogtreecommitdiffstats
path: root/hcid/security.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2006-02-08 10:59:19 +0000
committerMarcel Holtmann <marcel@holtmann.org>2006-02-08 10:59:19 +0000
commitaea137795fc999ded15d260915e959285c122286 (patch)
treeaaea101206c056ba2448395c72f507bbe3af33d1 /hcid/security.c
parent85cc0c57e4fd0e44c3b270aba4f87eb28151b1a2 (diff)
Add support for last used information
Diffstat (limited to 'hcid/security.c')
-rw-r--r--hcid/security.c35
1 files changed, 24 insertions, 11 deletions
diff --git a/hcid/security.c b/hcid/security.c
index 633583c8..89cc4cd1 100644
--- a/hcid/security.c
+++ b/hcid/security.c
@@ -97,6 +97,28 @@ static inline int get_bdaddr(int dev, bdaddr_t *sba, uint16_t handle, bdaddr_t *
return -ENOENT;
}
+static inline void update_lastseen(bdaddr_t *sba, bdaddr_t *dba)
+{
+ time_t t;
+ struct tm *tm;
+
+ t = time(NULL);
+ tm = gmtime(&t);
+
+ write_lastseen_info(sba, dba, tm);
+}
+
+static inline void update_lastused(bdaddr_t *sba, bdaddr_t *dba)
+{
+ time_t t;
+ struct tm *tm;
+
+ t = time(NULL);
+ tm = gmtime(&t);
+
+ write_lastused_info(sba, dba, tm);
+}
+
/* Link Key handling */
static void link_key_request(int dev, bdaddr_t *sba, bdaddr_t *dba)
@@ -423,17 +445,6 @@ static inline void inquiry_complete(int dev, bdaddr_t *sba, void *ptr)
hcid_dbus_inquiry_complete(sba);
}
-static inline void update_lastseen(bdaddr_t *sba, bdaddr_t *dba)
-{
- time_t t;
- struct tm *tm;
-
- t = time(NULL);
- tm = gmtime(&t);
-
- write_lastseen_info(sba, dba, tm);
-}
-
static inline void inquiry_result(int dev, bdaddr_t *sba, int plen, void *ptr)
{
uint8_t num = *(uint8_t *) ptr++;
@@ -544,6 +555,8 @@ static inline void conn_complete(int dev, bdaddr_t *sba, void *ptr)
if (evt->status)
return;
+ update_lastused(sba, &evt->bdaddr);
+
name_resolve(dev, &evt->bdaddr);
hcid_dbus_conn_complete(sba, &evt->bdaddr);