public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Marek Czerski <ma.czerski@gmail.com>
To: hadess@hadess.net
Cc: linux-bluetooth@vger.kernel.org, ma.czerski@gmail.com
Subject: [PATCH BlueZ v2] sixaxis: Fix pairing Esperanza EGG109k controller
Date: Wed, 22 Apr 2026 23:20:45 +0200	[thread overview]
Message-ID: <20260422212045.1325603-1-ma.czerski@gmail.com> (raw)
In-Reply-To: <59197f235800db69549ec163391ac1ac1f1ffe65.camel@hadess.net>

This change is required for Esperanza EGG109k ps controller clone.
EGG109k looks like PS3 controller but presents itself to the system
as PS4 controller. It does not respond to 0x81 command.
Command 0x12 contains both the device bluetooth address as well as
configured host bluetooth address, so it can be used to query
both. Kernel driver hid-playstation also uses 0x12 command for that.

Manufacturer link:
https://esperanza.pl/esperanza-gamepad-bezprzewodowy-ps3-marine-czarny,176,1701.html
---
 plugins/sixaxis.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/plugins/sixaxis.c b/plugins/sixaxis.c
index 27bc09815..a04a76d39 100644
--- a/plugins/sixaxis.c
+++ b/plugins/sixaxis.c
@@ -39,6 +39,9 @@
 #include "profiles/input/server.h"
 #include "profiles/input/sixaxis.h"
 
+#define DS4_FEATURE_REPORT_PAIRING_INFO		0x12
+#define DS4_FEATURE_REPORT_PAIRING_INFO_SIZE	16
+
 struct authentication_closure {
 	guint auth_id;
 	char *sysfs_path;
@@ -111,12 +114,12 @@ static int sixaxis_get_device_bdaddr(int fd, bdaddr_t *bdaddr)
 
 static int ds4_get_device_bdaddr(int fd, bdaddr_t *bdaddr)
 {
-	uint8_t buf[7];
+	uint8_t buf[DS4_FEATURE_REPORT_PAIRING_INFO_SIZE];
 	int ret;
 
 	memset(buf, 0, sizeof(buf));
 
-	buf[0] = 0x81;
+	buf[0] = DS4_FEATURE_REPORT_PAIRING_INFO;
 
 	ret = ioctl(fd, HIDIOCGFEATURE(sizeof(buf)), buf);
 	if (ret < 0) {
@@ -163,12 +166,12 @@ static int sixaxis_get_central_bdaddr(int fd, bdaddr_t *bdaddr)
 
 static int ds4_get_central_bdaddr(int fd, bdaddr_t *bdaddr)
 {
-	uint8_t buf[16];
+	uint8_t buf[DS4_FEATURE_REPORT_PAIRING_INFO_SIZE];
 	int ret;
 
 	memset(buf, 0, sizeof(buf));
 
-	buf[0] = 0x12;
+	buf[0] = DS4_FEATURE_REPORT_PAIRING_INFO;
 
 	ret = ioctl(fd, HIDIOCGFEATURE(sizeof(buf)), buf);
 	if (ret < 0) {
-- 
2.43.0


  reply	other threads:[~2026-04-22 21:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-04 12:30 [PATCH BlueZ] sixaxis: DS4: use 0x12 cmd to get device bdaddr Marek Czerski
2026-04-04 13:25 ` [BlueZ] " bluez.test.bot
2026-04-16  9:57 ` [PATCH BlueZ] " Bastien Nocera
2026-04-22 21:20   ` Marek Czerski [this message]
2026-04-22 22:20     ` [BlueZ,v2] sixaxis: Fix pairing Esperanza EGG109k controller bluez.test.bot

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=20260422212045.1325603-1-ma.czerski@gmail.com \
    --to=ma.czerski@gmail.com \
    --cc=hadess@hadess.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox