summaryrefslogtreecommitdiff
path: root/src/device.h
diff options
context:
space:
mode:
authorAlex Deymo <deymo@chromium.org>2013-05-08 17:37:58 -0700
committerJohan Hedberg <johan.hedberg@intel.com>2013-05-10 10:20:50 +0300
commit445a1036a11eb92df1c1ab76353ef2608087513d (patch)
tree8f129304049f6060e7f6c19efde65756ce5098a2 /src/device.h
parent543d659bdc4797f9300514893f815f2007f16527 (diff)
downloadbluez-445a1036a11eb92df1c1ab76353ef2608087513d.tar.gz
core: Retry bonding attempt until the iterator reaches the end
This patch splits the bonding process in an interative process consisting of one or more "bonding attempts". The user/agent starts a new "bonding" that may involve several rounds of "bonding attempts" with the device before it gets back to the user/agent. Some functions were split in two parts to reflect this change. When a bonding attempt fails with an authentication error and a pin code was provided, a new bonding attempt is initiated (after a short delay) to retry with the next function (or next call to the same function) in the pincode callback list. If no pin code was provided to the device, no retry is attempted and the authentication error is returned to the client. This effectively allows a plugin try different pincodes for the same device during the same bonding.
Diffstat (limited to 'src/device.h')
-rw-r--r--src/device.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/device.h b/src/device.h
index 50f422d6f..09e7f96dc 100644
--- a/src/device.h
+++ b/src/device.h
@@ -77,8 +77,10 @@ gboolean device_is_connected(struct btd_device *device);
bool device_is_retrying(struct btd_device *device);
void device_bonding_complete(struct btd_device *device, uint8_t status);
gboolean device_is_bonding(struct btd_device *device, const char *sender);
+void device_bonding_attempt_failed(struct btd_device *device, uint8_t status);
void device_bonding_failed(struct btd_device *device, uint8_t status);
struct btd_adapter_pin_cb_iter *device_bonding_iter(struct btd_device *device);
+int device_bonding_attempt_retry(struct btd_device *device);
int device_request_pincode(struct btd_device *device, gboolean secure);
int device_request_passkey(struct btd_device *device);
int device_confirm_passkey(struct btd_device *device, uint32_t passkey,