summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-common.c
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2007-04-10 14:06:44 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2007-04-10 14:06:44 +0000
commitc853057d20c7539d5214d0a126055baacb60887f (patch)
treea94452b4aff3c2cc6ed686e4b7872b1057b61ae2 /hcid/dbus-common.c
parent2a209d402e7cc324d03fb7172ac892626068d00b (diff)
Implement global trust setting
Diffstat (limited to 'hcid/dbus-common.c')
-rw-r--r--hcid/dbus-common.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/hcid/dbus-common.c b/hcid/dbus-common.c
index 3f08e5cd..7bdb2830 100644
--- a/hcid/dbus-common.c
+++ b/hcid/dbus-common.c
@@ -212,6 +212,36 @@ failed:
return -1;
}
+int find_conn(int s, int dev_id, long arg)
+{
+ struct hci_conn_list_req *cl;
+ struct hci_conn_info *ci;
+ int i;
+
+ cl = g_malloc0(10 * sizeof(*ci) + sizeof(*cl));
+
+ cl->dev_id = dev_id;
+ cl->conn_num = 10;
+ ci = cl->conn_info;
+
+ if (ioctl(s, HCIGETCONNLIST, cl)) {
+ error("Can't get connection list");
+ goto failed;
+ }
+
+ for (i = 0; i < cl->conn_num; i++, ci++) {
+ if (bacmp((bdaddr_t *) arg, &ci->bdaddr))
+ continue;
+ g_free(cl);
+ return 1;
+ }
+
+failed:
+ g_free(cl);
+ return 0;
+}
+
+
int check_address(const char *addr)
{
char tmp[18];