From 3b320a0355706a98f824f4d0abf2d14f820bbd81 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 15 Aug 2007 22:32:33 +0000 Subject: Rename files for adapter interface --- hcid/adapter.h | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 hcid/adapter.h (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h new file mode 100644 index 00000000..b48b7fac --- /dev/null +++ b/hcid/adapter.h @@ -0,0 +1,124 @@ +/* + * + * BlueZ - Bluetooth protocol stack for Linux + * + * Copyright (C) 2004-2007 Marcel Holtmann + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include + +#define ADAPTER_INTERFACE "org.bluez.Adapter" + +#define INVALID_DEV_ID 0xFFFF + +#define BONDING_TIMEOUT 45000 /* 45 sec */ + +#define DC_PENDING_TIMEOUT 2000 /* 2 secs */ + +/* Discover types */ +#define DISCOVER_TYPE_NONE 0x00 +#define STD_INQUIRY 0x01 +#define PERIODIC_INQUIRY 0x02 + +/* Actions executed after inquiry complete */ +#define RESOLVE_NAME 0x10 + +typedef enum { + NAME_ANY, + NAME_NOT_REQUIRED, /* used by get remote name without name resolving */ + NAME_REQUIRED, /* remote name needs be resolved */ + NAME_REQUESTED, /* HCI remote name request was sent */ + NAME_SENT /* D-Bus signal RemoteNameUpdated sent */ +} name_status_t; + +struct remote_dev_info { + bdaddr_t bdaddr; + int8_t rssi; + name_status_t name_status; +}; + +struct bonding_request_info { + bdaddr_t bdaddr; + DBusConnection *conn; + DBusMessage *rq; + GIOChannel *io; + guint io_id; + int hci_status; + int cancel; + int auth_active; +}; + +struct pending_pin_info { + bdaddr_t bdaddr; + int replied; /* If we've already replied to the request */ +}; + +struct active_conn_info { + bdaddr_t bdaddr; + uint16_t handle; +}; + +struct pending_dc_info { + DBusConnection *conn; + DBusMessage *msg; + uint16_t conn_handle; + guint timeout_id; +}; + +struct adapter { + uint16_t dev_id; + int up; + char address[18]; /* adapter Bluetooth Address */ + guint timeout_id; /* discoverable timeout id */ + uint32_t discov_timeout; /* discoverable time(msec) */ + uint8_t scan_enable; /* scan mode: SCAN_DISABLED, SCAN_PAGE, SCAN_INQUIRY */ + uint8_t mode; /* off, connectable, discoverable, limited */ + uint8_t class[3]; /* device class */ + int discov_active; /* standard discovery active: includes name resolution step */ + int pdiscov_active; /* periodic discovery active */ + int pinq_idle; /* tracks the idle time for periodic inquiry */ + int discov_type; /* type requested */ + int pdiscov_resolve_names; /* Resolve names when doing periodic discovery */ + GSList *found_devices; + GSList *oor_devices; /* out of range device list */ + char *pdiscov_requestor; /* periodic discovery requestor unique name */ + char *discov_requestor; /* discovery requestor unique name */ + DBusMessage *discovery_cancel; /* discovery cancel message request */ + GSList *passkey_agents; + GSList *auth_agents; /* Authorization agents */ + bdaddr_t agents_disabled; /* temporarely disable agents for bda */ + GSList *active_conn; + struct bonding_request_info *bonding; + GSList *pin_reqs; + struct pending_dc_info *pending_dc; +}; + +dbus_bool_t adapter_init(DBusConnection *conn, const char *path); + +const char *major_class_str(uint32_t class); + +const char *minor_class_str(uint32_t class); + +const char *mode2str(uint8_t mode); + +GSList *service_classes_str(uint32_t class); + +int pending_remote_name_cancel(struct adapter *adapter); + +void dc_pending_timeout_cleanup(struct adapter *adapter); -- cgit From f2cd77ddd994055f14147134d1ae94fe6fae6dcd Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Thu, 16 Aug 2007 18:12:29 +0000 Subject: More header cleanups --- hcid/adapter.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index b48b7fac..6ffc6bcc 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -21,8 +21,6 @@ * */ -#include - #define ADAPTER_INTERFACE "org.bluez.Adapter" #define INVALID_DEV_ID 0xFFFF -- cgit From 07021baf7a9e81f75776c99d65b774204b11422e Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 2 Oct 2007 12:03:39 +0000 Subject: Implement support for SetMode("on") --- hcid/adapter.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 6ffc6bcc..dc70119b 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -115,6 +115,8 @@ const char *minor_class_str(uint32_t class); const char *mode2str(uint8_t mode); +uint8_t str2mode(const char *addr, const char *mode); + GSList *service_classes_str(uint32_t class); int pending_remote_name_cancel(struct adapter *adapter); -- cgit From f1659f19cfb3ef0c0c09b5f5b7e2b06d90d079ab Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 23 Oct 2007 17:49:52 +0000 Subject: Update copyright information --- hcid/adapter.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index dc70119b..9cafdfda 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -2,6 +2,7 @@ * * BlueZ - Bluetooth protocol stack for Linux * + * Copyright (C) 2006-2007 Nokia Corporation * Copyright (C) 2004-2007 Marcel Holtmann * * -- cgit From e823c15e43a6f924779e466d434c51157002d9ee Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Sat, 2 Feb 2008 03:37:05 +0000 Subject: Update copyright information --- hcid/adapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 9cafdfda..0331f29a 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -3,7 +3,7 @@ * BlueZ - Bluetooth protocol stack for Linux * * Copyright (C) 2006-2007 Nokia Corporation - * Copyright (C) 2004-2007 Marcel Holtmann + * Copyright (C) 2004-2008 Marcel Holtmann * * * This program is free software; you can redistribute it and/or modify -- cgit From 6eab5e203d793fbeea8a488a315a62ab2e69417e Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 6 Mar 2008 21:58:13 +0000 Subject: added bt_discover_services function --- hcid/adapter.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 0331f29a..b6f30291 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -80,6 +80,11 @@ struct pending_dc_info { guint timeout_id; }; +struct create_device_req { + DBusConnection *conn; + DBusMessage *msg; +}; + struct adapter { uint16_t dev_id; int up; @@ -106,6 +111,7 @@ struct adapter { struct bonding_request_info *bonding; GSList *pin_reqs; struct pending_dc_info *pending_dc; + struct create_device_req *create; }; dbus_bool_t adapter_init(DBusConnection *conn, const char *path); -- cgit From da0e7105811dc046d13d0365404efc1189ee4a8c Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 7 Mar 2008 17:53:50 +0000 Subject: Registering device's object path --- hcid/adapter.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index b6f30291..c9ceea0f 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -81,8 +81,9 @@ struct pending_dc_info { }; struct create_device_req { - DBusConnection *conn; - DBusMessage *msg; + char address[18]; /* Destination address */ + DBusConnection *conn; /* Connection reference */ + DBusMessage *msg; /* Message reference */ }; struct adapter { @@ -112,6 +113,7 @@ struct adapter { GSList *pin_reqs; struct pending_dc_info *pending_dc; struct create_device_req *create; + GSList *devices; /* Devices paths */ }; dbus_bool_t adapter_init(DBusConnection *conn, const char *path); -- cgit From 6bfa88d706cc57a0c975c980dabec5d8ed67dcc0 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 12 Mar 2008 21:37:20 +0000 Subject: Keep a list of device's structure pointers instead of paths --- hcid/adapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index c9ceea0f..9353fcdd 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -113,7 +113,7 @@ struct adapter { GSList *pin_reqs; struct pending_dc_info *pending_dc; struct create_device_req *create; - GSList *devices; /* Devices paths */ + GSList *devices; /* Devices structure pointers */ }; dbus_bool_t adapter_init(DBusConnection *conn, const char *path); -- cgit From a89312e54979c0ee6cc82f50e423bcdafbe9df43 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Thu, 13 Mar 2008 22:27:22 +0000 Subject: Added new function to remove the listener based on integer identification --- hcid/adapter.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 9353fcdd..1943fbf2 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -84,6 +84,7 @@ struct create_device_req { char address[18]; /* Destination address */ DBusConnection *conn; /* Connection reference */ DBusMessage *msg; /* Message reference */ + guint id; /* Listener id */ }; struct adapter { -- cgit From 69ade1c0df3325e7f3227743d83050c20de2b193 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 14 Mar 2008 14:37:56 +0000 Subject: Add initial code of adapter CreatePairedDevice. --- hcid/adapter.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 1943fbf2..9aaff01c 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -85,6 +85,7 @@ struct create_device_req { DBusConnection *conn; /* Connection reference */ DBusMessage *msg; /* Message reference */ guint id; /* Listener id */ + char *agent; /* Agent object path */ }; struct adapter { -- cgit From 48a57eed7fbb29716c9961fb6ac21ec4ba4d9717 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 14 Mar 2008 15:05:07 +0000 Subject: Fix use of g_strdup and g_free that already handle NULL pointers and some coding style fixes. --- hcid/adapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 9aaff01c..1ea266d5 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -85,7 +85,7 @@ struct create_device_req { DBusConnection *conn; /* Connection reference */ DBusMessage *msg; /* Message reference */ guint id; /* Listener id */ - char *agent; /* Agent object path */ + char *agent_path; /* Agent object path */ }; struct adapter { -- cgit From 6a61b7495a0557ce79499a6815cdfbe672bf6cfb Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 14 Mar 2008 19:16:30 +0000 Subject: Add initial code for new agent interface --- hcid/adapter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 1ea266d5..a09dd37e 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -108,7 +108,8 @@ struct adapter { char *discov_requestor; /* discovery requestor unique name */ DBusMessage *discovery_cancel; /* discovery cancel message request */ GSList *passkey_agents; - GSList *auth_agents; /* Authorization agents */ + GSList *auth_agents; /* Authorization agents */ + struct agent *agent; /* For the new API */ bdaddr_t agents_disabled; /* temporarely disable agents for bda */ GSList *active_conn; struct bonding_request_info *bonding; -- cgit From b4fcae17e8a9f6242b752bfb9808248cadbde43b Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 14 Mar 2008 21:47:32 +0000 Subject: Introduce adapter method RequestMode. --- hcid/adapter.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index a09dd37e..6d2a38f1 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -88,6 +88,13 @@ struct create_device_req { char *agent_path; /* Agent object path */ }; +struct mode_req { + struct adapter *adapter; + DBusConnection *conn; /* Connection reference */ + DBusMessage *msg; /* Message reference */ + char *mode; /* Requested mode */ +}; + struct adapter { uint16_t dev_id; int up; -- cgit From 94a757fea37ba19b3dec1a3318f49d667394f6eb Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 14 Mar 2008 21:57:06 +0000 Subject: Move private structs from adapter.c to adapter.h --- hcid/adapter.h | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 6d2a38f1..d64930bc 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -80,21 +80,6 @@ struct pending_dc_info { guint timeout_id; }; -struct create_device_req { - char address[18]; /* Destination address */ - DBusConnection *conn; /* Connection reference */ - DBusMessage *msg; /* Message reference */ - guint id; /* Listener id */ - char *agent_path; /* Agent object path */ -}; - -struct mode_req { - struct adapter *adapter; - DBusConnection *conn; /* Connection reference */ - DBusMessage *msg; /* Message reference */ - char *mode; /* Requested mode */ -}; - struct adapter { uint16_t dev_id; int up; -- cgit From 6a3f7979de00988fd66e586097efc5de577f0436 Mon Sep 17 00:00:00 2001 From: Vinicius Gomes Date: Thu, 20 Mar 2008 14:19:46 +0000 Subject: adapter: adding adapter_get_device function --- hcid/adapter.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index d64930bc..0ab02c77 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -113,6 +113,8 @@ struct adapter { dbus_bool_t adapter_init(DBusConnection *conn, const char *path); +struct device *adapter_get_device(struct adapter *adapter, const char *src); + const char *major_class_str(uint32_t class); const char *minor_class_str(uint32_t class); -- cgit From 9e344aba0489ceddb0fc9a12e1f012fd0f6250f9 Mon Sep 17 00:00:00 2001 From: Vinicius Gomes Date: Thu, 20 Mar 2008 14:39:35 +0000 Subject: adapter: fixing the parameter list of the adapter_get_device function --- hcid/adapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 0ab02c77..82e4f68c 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -113,7 +113,7 @@ struct adapter { dbus_bool_t adapter_init(DBusConnection *conn, const char *path); -struct device *adapter_get_device(struct adapter *adapter, const char *src); +struct device *adapter_get_device(struct adapter *adapter, const char *dest); const char *major_class_str(uint32_t class); -- cgit From 0d753f3a8fd1de89f9f43a6bdb69068fd420d905 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 2 Apr 2008 19:15:52 +0000 Subject: Add RequestMode sessions support. --- hcid/adapter.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 82e4f68c..f520f718 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -88,6 +88,7 @@ struct adapter { uint32_t discov_timeout; /* discoverable time(msec) */ uint8_t scan_enable; /* scan mode: SCAN_DISABLED, SCAN_PAGE, SCAN_INQUIRY */ uint8_t mode; /* off, connectable, discoverable, limited */ + uint8_t last_mode; /* last mode changed */ uint8_t class[3]; /* device class */ int discov_active; /* standard discovery active: includes name resolution step */ int pdiscov_active; /* periodic discovery active */ @@ -109,6 +110,7 @@ struct adapter { struct pending_dc_info *pending_dc; struct create_device_req *create; GSList *devices; /* Devices structure pointers */ + GSList *sessions; /* Request Mode sessions */ }; dbus_bool_t adapter_init(DBusConnection *conn, const char *path); -- cgit From e4d81182fb08f0cdfad672d0e95b0aaf48eefa7c Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 2 Apr 2008 20:09:15 +0000 Subject: Change last_mode to global_mode. --- hcid/adapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index f520f718..9da56d3e 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -88,7 +88,7 @@ struct adapter { uint32_t discov_timeout; /* discoverable time(msec) */ uint8_t scan_enable; /* scan mode: SCAN_DISABLED, SCAN_PAGE, SCAN_INQUIRY */ uint8_t mode; /* off, connectable, discoverable, limited */ - uint8_t last_mode; /* last mode changed */ + uint8_t global_mode; /* last valid global mode */ uint8_t class[3]; /* device class */ int discov_active; /* standard discovery active: includes name resolution step */ int pdiscov_active; /* periodic discovery active */ -- cgit From 83735b4aa67748253b2e3df02847ffb86c131085 Mon Sep 17 00:00:00 2001 From: Vinicius Gomes Date: Thu, 3 Apr 2008 17:37:38 +0000 Subject: hcid: creating the device object when the pair is initiated by the remote device. --- hcid/adapter.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 9da56d3e..280c1d1c 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -115,7 +115,10 @@ struct adapter { dbus_bool_t adapter_init(DBusConnection *conn, const char *path); -struct device *adapter_get_device(struct adapter *adapter, const char *dest); +struct device *adapter_get_device(DBusConnection *conn, + struct adapter *adapter, const gchar *address); + +struct device *adapter_find_device(struct adapter *adapter, const char *dest); const char *major_class_str(uint32_t class); -- cgit From e83935d0bc0e4d043b4f4cd372d69b95b6f10ffc Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Fri, 4 Apr 2008 00:48:13 +0000 Subject: cleanup: unused list --- hcid/adapter.h | 1 - 1 file changed, 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 280c1d1c..b02c6ccb 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -101,7 +101,6 @@ struct adapter { char *discov_requestor; /* discovery requestor unique name */ DBusMessage *discovery_cancel; /* discovery cancel message request */ GSList *passkey_agents; - GSList *auth_agents; /* Authorization agents */ struct agent *agent; /* For the new API */ bdaddr_t agents_disabled; /* temporarely disable agents for bda */ GSList *active_conn; -- cgit From 3d9966f38f1d6ca12c9e9e2eace5181ba04844b4 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 8 Apr 2008 22:35:49 +0000 Subject: Fix CreatePairedDevice and CreateDevice behavior. --- hcid/adapter.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index b02c6ccb..3449aec4 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -53,9 +53,9 @@ struct remote_dev_info { }; struct bonding_request_info { - bdaddr_t bdaddr; DBusConnection *conn; - DBusMessage *rq; + DBusMessage *msg; + bdaddr_t bdaddr; GIOChannel *io; guint io_id; int hci_status; @@ -107,7 +107,6 @@ struct adapter { struct bonding_request_info *bonding; GSList *pin_reqs; struct pending_dc_info *pending_dc; - struct create_device_req *create; GSList *devices; /* Devices structure pointers */ GSList *sessions; /* Request Mode sessions */ }; -- cgit From a1c12f0ffeeb1bd2ab9cb287ce4e16125492c521 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 9 Apr 2008 21:20:19 +0000 Subject: Fix temporary device removal not emitting DeviceRemoved. --- hcid/adapter.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 3449aec4..9a40ed4b 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -118,6 +118,9 @@ struct device *adapter_get_device(DBusConnection *conn, struct device *adapter_find_device(struct adapter *adapter, const char *dest); +void adapter_remove_device(DBusConnection *conn, struct adapter *adapter, + struct device *device); + const char *major_class_str(uint32_t class); const char *minor_class_str(uint32_t class); -- cgit From fb27732e05fb7b69c3b784ed8a6aaed2d9d939ae Mon Sep 17 00:00:00 2001 From: Cidorvan Leite Date: Thu, 10 Apr 2008 22:36:58 +0000 Subject: Added local agent in CreatePairedDevice --- hcid/adapter.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 9a40ed4b..767cbde7 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -118,6 +118,9 @@ struct device *adapter_get_device(DBusConnection *conn, struct device *adapter_find_device(struct adapter *adapter, const char *dest); +struct device *adapter_create_device(DBusConnection *conn, + struct adapter *adapter, const char *address); + void adapter_remove_device(DBusConnection *conn, struct adapter *adapter, struct device *device); -- cgit From 23f49566e8bb0eb0b5b0e2a9b1841c28a92080fa Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 11 Apr 2008 17:32:52 +0000 Subject: Emit signals properly when removing a device. --- hcid/adapter.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 767cbde7..d715d58f 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -118,11 +118,10 @@ struct device *adapter_get_device(DBusConnection *conn, struct device *adapter_find_device(struct adapter *adapter, const char *dest); -struct device *adapter_create_device(DBusConnection *conn, - struct adapter *adapter, const char *address); - void adapter_remove_device(DBusConnection *conn, struct adapter *adapter, struct device *device); +struct device *adapter_create_device(DBusConnection *conn, + struct adapter *adapter, const char *address); const char *major_class_str(uint32_t class); -- cgit From fb306e968c0fc7a621df09c2c544db895d0b3419 Mon Sep 17 00:00:00 2001 From: Vinicius Gomes Date: Mon, 14 Apr 2008 21:10:27 +0000 Subject: hcid: removing device object when some error occurs during bonding process --- hcid/adapter.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index d715d58f..421684f8 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -136,3 +136,5 @@ GSList *service_classes_str(uint32_t class); int pending_remote_name_cancel(struct adapter *adapter); void dc_pending_timeout_cleanup(struct adapter *adapter); + +void remove_pending_device(struct adapter *adapter); -- cgit From 649448818704cd93136d55d33676ad80cb463224 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 27 May 2008 21:31:12 +0000 Subject: Use guint identifier for all name_listener operations --- hcid/adapter.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 421684f8..e9631ee0 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -58,6 +58,7 @@ struct bonding_request_info { bdaddr_t bdaddr; GIOChannel *io; guint io_id; + guint listener_id; int hci_status; int cancel; int auth_active; @@ -98,7 +99,9 @@ struct adapter { GSList *found_devices; GSList *oor_devices; /* out of range device list */ char *pdiscov_requestor; /* periodic discovery requestor unique name */ + guint pdiscov_listener; char *discov_requestor; /* discovery requestor unique name */ + guint discov_listener; DBusMessage *discovery_cancel; /* discovery cancel message request */ GSList *passkey_agents; struct agent *agent; /* For the new API */ -- cgit From d6324969931f4b0202851443ad6ccb98a325f476 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 3 Jun 2008 10:50:00 +0000 Subject: Converted Adapter interface to use new GDBusMethodTable --- hcid/adapter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index e9631ee0..2333c3ca 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -114,7 +114,8 @@ struct adapter { GSList *sessions; /* Request Mode sessions */ }; -dbus_bool_t adapter_init(DBusConnection *conn, const char *path); +dbus_bool_t adapter_init(DBusConnection *conn, + const char *path, struct adapter *adapter); struct device *adapter_get_device(DBusConnection *conn, struct adapter *adapter, const gchar *address); -- cgit From f52b310f85b0a3f8dbbed8307aca48100e9e5ccb Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 3 Jun 2008 12:33:55 +0000 Subject: Remove the agents_disable capability --- hcid/adapter.h | 1 - 1 file changed, 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 2333c3ca..17eed7bd 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -105,7 +105,6 @@ struct adapter { DBusMessage *discovery_cancel; /* discovery cancel message request */ GSList *passkey_agents; struct agent *agent; /* For the new API */ - bdaddr_t agents_disabled; /* temporarely disable agents for bda */ GSList *active_conn; struct bonding_request_info *bonding; GSList *pin_reqs; -- cgit From edbb9a6396085fb857f4c35e5a5c931aca633b35 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 3 Jun 2008 16:26:42 +0000 Subject: Rework new agent logic --- hcid/adapter.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 17eed7bd..1666e659 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -55,6 +55,7 @@ struct remote_dev_info { struct bonding_request_info { DBusConnection *conn; DBusMessage *msg; + struct adapter *adapter; bdaddr_t bdaddr; GIOChannel *io; guint io_id; -- cgit From 1b400b2559c799f260a832ae7a0e63d94fd21428 Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Wed, 4 Jun 2008 09:05:02 +0000 Subject: Changed old Adapter methods to use gdbus --- hcid/adapter.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 1666e659..7808609a 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -85,6 +85,7 @@ struct pending_dc_info { struct adapter { uint16_t dev_id; int up; + char *path; /* adapter object path */ char address[18]; /* adapter Bluetooth Address */ guint timeout_id; /* discoverable timeout id */ uint32_t discov_timeout; /* discoverable time(msec) */ -- cgit From 833b95efc8bda83851624b203991db196282335c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 6 Jun 2008 11:28:57 +0000 Subject: Further cleanup of authentication logic --- hcid/adapter.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 7808609a..ec2c3f81 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -46,6 +46,12 @@ typedef enum { NAME_SENT /* D-Bus signal RemoteNameUpdated sent */ } name_status_t; +typedef enum { + AUTH_TYPE_PINCODE, + AUTH_TYPE_PASSKEY, + AUTH_TYPE_CONFIRM, +} auth_type_t; + struct remote_dev_info { bdaddr_t bdaddr; int8_t rssi; @@ -65,7 +71,8 @@ struct bonding_request_info { int auth_active; }; -struct pending_pin_info { +struct pending_auth_info { + auth_type_t type; bdaddr_t bdaddr; int replied; /* If we've already replied to the request */ }; -- cgit From 8eae4fc054a6f522d9cbc24dbe824838056f0dcf Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 9 Jun 2008 04:37:29 +0000 Subject: Add support for Simple Pairing User Notification event --- hcid/adapter.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index ec2c3f81..844a66f4 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -50,6 +50,7 @@ typedef enum { AUTH_TYPE_PINCODE, AUTH_TYPE_PASSKEY, AUTH_TYPE_CONFIRM, + AUTH_TYPE_NOTIFY, } auth_type_t; struct remote_dev_info { -- cgit From 1f7fe4eccf979527380b4ae9a1c6d7aa0bb8674e Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 9 Jun 2008 21:13:58 +0000 Subject: Remove use of g_dbus_unregister_all_interfaces. --- hcid/adapter.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 844a66f4..ef579832 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -126,6 +126,8 @@ struct adapter { dbus_bool_t adapter_init(DBusConnection *conn, const char *path, struct adapter *adapter); +dbus_bool_t adapter_cleanup(DBusConnection *conn, const char *path); + struct device *adapter_get_device(DBusConnection *conn, struct adapter *adapter, const gchar *address); -- cgit From 9c2af7e86895a3a2e457deb72a539f98d725b297 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Jun 2008 08:07:16 +0000 Subject: Rename pin_reqs o auth_reqs since it's tracking SSP too --- hcid/adapter.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index ef579832..d361192f 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -117,7 +117,7 @@ struct adapter { struct agent *agent; /* For the new API */ GSList *active_conn; struct bonding_request_info *bonding; - GSList *pin_reqs; + GSList *auth_reqs; struct pending_dc_info *pending_dc; GSList *devices; /* Devices structure pointers */ GSList *sessions; /* Request Mode sessions */ -- cgit From 4da1bf2ef1cf0880b0b2a3b4998de1d2fa5f99f5 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Jun 2008 08:18:53 +0000 Subject: Document current purpose of auth_reqs --- hcid/adapter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index d361192f..5e023f3c 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -117,7 +117,8 @@ struct adapter { struct agent *agent; /* For the new API */ GSList *active_conn; struct bonding_request_info *bonding; - GSList *auth_reqs; + GSList *auth_reqs; /* Received and replied HCI + authentication requests */ struct pending_dc_info *pending_dc; GSList *devices; /* Devices structure pointers */ GSList *sessions; /* Request Mode sessions */ -- cgit From 27c5b9dad6308c359bfde52faebf3c0decc3c60e Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Jun 2008 10:17:13 +0000 Subject: Move authentication request functions into adapter.c --- hcid/adapter.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 5e023f3c..2e14bfc0 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -154,3 +154,10 @@ int pending_remote_name_cancel(struct adapter *adapter); void dc_pending_timeout_cleanup(struct adapter *adapter); void remove_pending_device(struct adapter *adapter); + +struct pending_auth_info *adapter_find_auth_request(struct adapter *adapter, + bdaddr_t *dba); +void adapter_remove_auth_request(struct adapter *adapter, bdaddr_t *dba); +struct pending_auth_info *adapter_new_auth_request(struct adapter *adapter, + bdaddr_t *dba, + auth_type_t type); -- cgit From 7eca97cf8464cf1863a08e514c9ac7a8e0400f1c Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Jun 2008 11:11:01 +0000 Subject: Don't use raw HCI for tracking authentication request status --- hcid/adapter.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index 2e14bfc0..cf5bb5f9 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -75,7 +75,7 @@ struct bonding_request_info { struct pending_auth_info { auth_type_t type; bdaddr_t bdaddr; - int replied; /* If we've already replied to the request */ + gboolean replied; /* If we've already replied to the request */ }; struct active_conn_info { @@ -155,6 +155,7 @@ void dc_pending_timeout_cleanup(struct adapter *adapter); void remove_pending_device(struct adapter *adapter); +void adapter_auth_request_replied(struct adapter *adapter, bdaddr_t *dba); struct pending_auth_info *adapter_find_auth_request(struct adapter *adapter, bdaddr_t *dba); void adapter_remove_auth_request(struct adapter *adapter, bdaddr_t *dba); -- cgit From 32c66136e4c4447a483dd42dcb1803a16c2ca3f8 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Thu, 12 Jun 2008 11:50:27 +0000 Subject: Track agent request status in conjunction with authentication requests --- hcid/adapter.h | 1 + 1 file changed, 1 insertion(+) (limited to 'hcid/adapter.h') diff --git a/hcid/adapter.h b/hcid/adapter.h index cf5bb5f9..f6ed7a22 100644 --- a/hcid/adapter.h +++ b/hcid/adapter.h @@ -76,6 +76,7 @@ struct pending_auth_info { auth_type_t type; bdaddr_t bdaddr; gboolean replied; /* If we've already replied to the request */ + struct agent *agent; /* Agent associated with the request */ }; struct active_conn_info { -- cgit