All of lore.kernel.org
 help / color / mirror / Atom feed
* [Bluez PATCH v3] adapter - Device needs to be in the temporary state after pairing failure
@ 2020-08-24 18:19 Yu Liu
  2020-08-24 18:28 ` [Bluez,v3] " bluez.test.bot
  2020-08-27 17:54 ` [Bluez PATCH v3] " Luiz Augusto von Dentz
  0 siblings, 2 replies; 3+ messages in thread
From: Yu Liu @ 2020-08-24 18:19 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: chromeos-bluetooth-upstreaming, Yu Liu, sonnysasaka

This caused the device hanging around as a discovered device forever
even if it is turned off or not in present.

Reviewed-by: sonnysasaka@chromium.org
---

Changes in v3:
- Fix comment format
- Don't set temporary for trusted device

Changes in v2:
- Fix title length and format issue

Changes in v1:
- Initial change

 src/device.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/device.c b/src/device.c
index bb8e07e8f..103b5df27 100644
--- a/src/device.c
+++ b/src/device.c
@@ -6008,6 +6008,14 @@ void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,
 
 	if (status) {
 		device_cancel_authentication(device, TRUE);
+
+		/* Put the device back to the temporary state so that it will be
+		 * treated as a newly discovered device.
+		 */
+		if (!device_is_paired(device, bdaddr_type) &&
+				!device_is_trusted(device))
+			btd_device_set_temporary(device, true);
+
 		device_bonding_failed(device, status);
 		return;
 	}
-- 
2.28.0.297.g1956fa8f8d-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [Bluez,v3] adapter - Device needs to be in the temporary state after pairing failure
  2020-08-24 18:19 [Bluez PATCH v3] adapter - Device needs to be in the temporary state after pairing failure Yu Liu
@ 2020-08-24 18:28 ` bluez.test.bot
  2020-08-27 17:54 ` [Bluez PATCH v3] " Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: bluez.test.bot @ 2020-08-24 18:28 UTC (permalink / raw)
  To: linux-bluetooth, yudiliu

[-- Attachment #1: Type: text/plain, Size: 436 bytes --]


This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
While we are preparing for reviewing the patches, we found the following
issue/warning.

Test Result:
checkgitlint Failed

Outputs:
1: T1 Title exceeds max length (73>72): "adapter - Device needs to be in the temporary state after pairing failure"



---
Regards,
Linux Bluetooth

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bluez PATCH v3] adapter - Device needs to be in the temporary state after pairing failure
  2020-08-24 18:19 [Bluez PATCH v3] adapter - Device needs to be in the temporary state after pairing failure Yu Liu
  2020-08-24 18:28 ` [Bluez,v3] " bluez.test.bot
@ 2020-08-27 17:54 ` Luiz Augusto von Dentz
  1 sibling, 0 replies; 3+ messages in thread
From: Luiz Augusto von Dentz @ 2020-08-27 17:54 UTC (permalink / raw)
  To: Yu Liu; +Cc: linux-bluetooth, ChromeOS Bluetooth Upstreaming, Sonny Sasaka

Hi Yu Liu,

On Mon, Aug 24, 2020 at 11:30 AM Yu Liu <yudiliu@google.com> wrote:
>
> This caused the device hanging around as a discovered device forever
> even if it is turned off or not in present.
>
> Reviewed-by: sonnysasaka@chromium.org
> ---
>
> Changes in v3:
> - Fix comment format
> - Don't set temporary for trusted device
>
> Changes in v2:
> - Fix title length and format issue
>
> Changes in v1:
> - Initial change
>
>  src/device.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/src/device.c b/src/device.c
> index bb8e07e8f..103b5df27 100644
> --- a/src/device.c
> +++ b/src/device.c
> @@ -6008,6 +6008,14 @@ void device_bonding_complete(struct btd_device *device, uint8_t bdaddr_type,
>
>         if (status) {
>                 device_cancel_authentication(device, TRUE);
> +
> +               /* Put the device back to the temporary state so that it will be
> +                * treated as a newly discovered device.
> +                */
> +               if (!device_is_paired(device, bdaddr_type) &&
> +                               !device_is_trusted(device))
> +                       btd_device_set_temporary(device, true);
> +
>                 device_bonding_failed(device, status);
>                 return;
>         }
> --
> 2.28.0.297.g1956fa8f8d-goog

Applied, thanks.

-- 
Luiz Augusto von Dentz

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-08-27 17:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-24 18:19 [Bluez PATCH v3] adapter - Device needs to be in the temporary state after pairing failure Yu Liu
2020-08-24 18:28 ` [Bluez,v3] " bluez.test.bot
2020-08-27 17:54 ` [Bluez PATCH v3] " Luiz Augusto von Dentz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.