All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lionel Jeanson <lionel.jeanson@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: sixaxis patch proposal
Date: Mon, 7 Dec 2020 18:04:10 +0100	[thread overview]
Message-ID: <CAMxp894ThdL9qxNz49561WrDj3XhWxpFMf+9afMD9WqMbSPBbw@mail.gmail.com> (raw)

Hi;

I'd like to propose the following patch to fix the following issue :

 - if an already paired PS3 DualShock is plugged to USB, while it is
turned off (PS button wasn't pushed or no more battery for instance),
then it's connection will be reset and it will have to be paired again

 - to fix this, I removed the device connection check

 - tested on Ubuntu 20.x (bluez-5.53 and bluez-5.55) and works fine in
all cases.

Thank you;
Lionel



diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index d693a86c0..ccede193e 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -337,7 +337,6 @@ static bool setup_device(int fd, const char *sysfs_path,
        device = btd_adapter_find_device(adapter, &device_bdaddr,
                                                        BDADDR_BREDR);
        if (device != NULL &&
-               btd_device_is_connected(device) &&
                g_slist_find_custom(btd_device_get_uuids(device), HID_UUID,
                                                (GCompareFunc)strcasecmp)) {
                char device_addr[18];

             reply	other threads:[~2020-12-07 17:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-07 17:04 Lionel Jeanson [this message]
2020-12-08  9:01 ` sixaxis patch proposal Bastien Nocera
2020-12-08  9:45   ` Lionel Jeanson
2020-12-08  9:53     ` Bastien Nocera
2020-12-08 10:46       ` Lionel Jeanson
2020-12-08 10:58         ` Bastien Nocera
2020-12-08 11:25           ` Lionel Jeanson
     [not found]           ` <CADrX+XvHL76f8mT29MO8xUGwKzhjeZTXqiSUAQnR5_JrCZ65_Q@mail.gmail.com>
2020-12-08 11:29             ` Bastien Nocera
     [not found]               ` <CADrX+Xtq=cCudHvKZG1=WdwM-vinPegXWTd-JdvpiLk4GykfbQ@mail.gmail.com>
2020-12-08 12:19                 ` Lionel Jeanson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMxp894ThdL9qxNz49561WrDj3XhWxpFMf+9afMD9WqMbSPBbw@mail.gmail.com \
    --to=lionel.jeanson@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.