DS5Edge: fix barcode reading

This commit is contained in:
dualshock-tools
2025-12-21 12:19:43 +01:00
parent 718c7f7ab0
commit 5aeaae377e
24 changed files with 46 additions and 12 deletions

View File

@@ -50,14 +50,25 @@ class DS5EdgeController extends DS5Controller {
}
async getBarcode() {
await this.sendFeatureReport(0x80, [21,34]);
await sleep(100);
const data = await this.receiveFeatureReport(0x81);
const td = new TextDecoder();
const r_bc = td.decode(data.buffer.slice(21, 21+17));
const l_bc = td.decode(data.buffer.slice(40, 40+17));
return [r_bc, l_bc];
try {
const td = new TextDecoder();
await this.sendFeatureReport(0x80, [21,34,0]);
await sleep(100);
const r_data = await this.receiveFeatureReport(0x81);
const r_bc = td.decode(r_data.buffer.slice(21, 21+17));
await this.sendFeatureReport(0x80, [21,34,1]);
await sleep(100);
const l_data = await this.receiveFeatureReport(0x81);
const l_bc = td.decode(l_data.buffer.slice(21, 21+17));
return [l_bc, r_bc];
} catch(error) {
la("ds5_edge_barcode_modules_failed", {"r": error});
throw new Error(l("Cannot read module barcodes"), { cause: error });
}
}
async unlockModule(i) {

View File

@@ -191,6 +191,7 @@
"Cancel": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -168,6 +168,7 @@
"Cancel": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -153,6 +153,7 @@
"Cancel": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -310,6 +310,7 @@
"tests completed": "tests er gennemført",
"to increase the non-circularity.": "for at øge ikke-cirkulariteten.",
"Cannot copy text to the clipboard:": "",
"Cannot read module barcodes": "",
"Please connect a DualShock 4, a DualSense, DualSense Edge or VR2 controller to your computer and press Connect.": "",
"The item has been copied to the clipboard.": "",
"": ""

View File

@@ -183,6 +183,7 @@
"Calibration is being stored in the stick modules.": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -153,6 +153,7 @@
"Cancel": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -144,6 +144,7 @@
"Be gentle to avoid damage.": "",
"Buttons": "",
"Cannot copy text to the clipboard:": "",
"Cannot read module barcodes": "",
"Center": "",
"Circularity": "",
"Controller does not support adaptive trigger control": "",

View File

@@ -153,6 +153,7 @@
"Cancel": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -313,6 +313,7 @@
"tests completed": "befejezett teszt",
"to increase the non-circularity.": "a nem-körkörösség növeléséhez.",
"Cannot copy text to the clipboard:": "",
"Cannot read module barcodes": "",
"The item has been copied to the clipboard.": "",
"": ""
}

View File

@@ -309,5 +309,6 @@
"Cannot copy text to the clipboard:": "Non posso copiare il testo negli appunti:",
"The device appears to be a clone. All calibration functionality is disabled.": "Il dispositivo sembra un clone. Le funzioni di calibrazione sono disattivate.",
"The item has been copied to the clipboard.": "Testo copiato negli appunti.",
"Cannot read module barcodes": "",
"": ""
}
}

View File

@@ -156,6 +156,7 @@
"Can you overwrite a permanent calibration?": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -239,6 +239,7 @@
"Be gentle to avoid damage.": "",
"Buttons": "",
"Cannot copy text to the clipboard:": "",
"Cannot read module barcodes": "",
"Center": "",
"Circularity": "",
"Controller does not support adaptive trigger control": "",

View File

@@ -153,6 +153,7 @@
"Cancel": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -309,5 +309,6 @@
"skipped": "pominięto",
"tests completed": "testy zakończone",
"to increase the non-circularity.": "by zwiększyć nie-okrężność",
"Cannot read module barcodes": "",
"": ""
}

View File

@@ -168,6 +168,7 @@
"Cancel": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -289,6 +289,7 @@
"30th Anniversary": "",
"Astro Bot": "",
"Cannot copy text to the clipboard:": "",
"Cannot read module barcodes": "",
"Chroma Indigo": "",
"Chroma Pearl": "",
"Chroma Teal": "",

View File

@@ -194,6 +194,7 @@
"Calibration is being stored in the stick modules.": "",
"Cannot copy text to the clipboard:": "",
"Cannot lock": "",
"Cannot read module barcodes": "",
"Cannot store data into": "",
"Cannot unlock": "",
"Center": "",

View File

@@ -213,6 +213,7 @@
"Buttons": "",
"Calibration": "",
"Cannot copy text to the clipboard:": "",
"Cannot read module barcodes": "",
"Center": "",
"Center (L1)": "",
"Chroma Indigo": "",

View File

@@ -309,5 +309,6 @@
"Please connect a DualShock 4, a DualSense, DualSense Edge or VR2 controller to your computer and press Connect.": "Lütfen bir DualShock 4, DualSense, DualSense Edge veya VR2 kontrolcüsünü bilgisayarınıza bağlayın ve Bağlan butonuna basın.",
"Cannot copy text to the clipboard:": "Metin panoya kopyalanamıyor:",
"The item has been copied to the clipboard.": "Öğe panoya kopyalandı.",
"Cannot read module barcodes": "",
"": ""
}
}

View File

@@ -309,5 +309,6 @@
"The device appears to be a clone. All calibration functionality is disabled.": "Схоже, цей пристрій є підробкою. Усі функції калібрування вимкнено.",
"Cannot copy text to the clipboard:": "Не вдалося скопіювати",
"The item has been copied to the clipboard.": "Скопійовано до буфера обміну",
"Cannot read module barcodes": "",
"": ""
}
}

View File

@@ -307,6 +307,7 @@
"tests completed": "bài kiểm tra đã hoàn thành",
"to increase the non-circularity.": "để tăng độ không tròn.",
"Cannot copy text to the clipboard:": "",
"Cannot read module barcodes": "",
"Please connect a DualShock 4, a DualSense, DualSense Edge or VR2 controller to your computer and press Connect.": "",
"The item has been copied to the clipboard.": "",
"": ""

View File

@@ -309,5 +309,6 @@
"Please connect a DualShock 4, a DualSense, DualSense Edge or VR2 controller to your computer and press Connect.": "请将DualShock 4、DualSense、DualSense Edge或VR2控制器连接到您的计算机然后按'连接'。",
"The device appears to be a clone. All calibration functionality is disabled.": "此手柄不是索尼正品手柄。所有校准功能均无法使用。",
"The item has been copied to the clipboard.": "该项目已复制到剪贴板。",
"Cannot read module barcodes": "",
"": ""
}
}

View File

@@ -233,6 +233,7 @@
"Be gentle to avoid damage.": "",
"Buttons": "",
"Cannot copy text to the clipboard:": "",
"Cannot read module barcodes": "",
"Center": "",
"Center (L1)": "",
"Circularity": "",