diff --git a/js/controllers/ds5-edge-controller.js b/js/controllers/ds5-edge-controller.js index 3a20c8e..53c7729 100644 --- a/js/controllers/ds5-edge-controller.js +++ b/js/controllers/ds5-edge-controller.js @@ -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) { diff --git a/lang/ar_ar.json b/lang/ar_ar.json index e50b960..10924ed 100644 --- a/lang/ar_ar.json +++ b/lang/ar_ar.json @@ -191,6 +191,7 @@ "Cancel": "", "Cannot copy text to the clipboard:": "", "Cannot lock": "", + "Cannot read module barcodes": "", "Cannot store data into": "", "Cannot unlock": "", "Center": "", diff --git a/lang/bg_bg.json b/lang/bg_bg.json index 0f6c29a..f248521 100644 --- a/lang/bg_bg.json +++ b/lang/bg_bg.json @@ -168,6 +168,7 @@ "Cancel": "", "Cannot copy text to the clipboard:": "", "Cannot lock": "", + "Cannot read module barcodes": "", "Cannot store data into": "", "Cannot unlock": "", "Center": "", diff --git a/lang/cz_cz.json b/lang/cz_cz.json index 4ac838b..ce41579 100644 --- a/lang/cz_cz.json +++ b/lang/cz_cz.json @@ -153,6 +153,7 @@ "Cancel": "", "Cannot copy text to the clipboard:": "", "Cannot lock": "", + "Cannot read module barcodes": "", "Cannot store data into": "", "Cannot unlock": "", "Center": "", diff --git a/lang/da_dk.json b/lang/da_dk.json index e128adb..7b74178 100644 --- a/lang/da_dk.json +++ b/lang/da_dk.json @@ -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.": "", "": "" diff --git a/lang/de_de.json b/lang/de_de.json index 011498b..399dc1d 100644 --- a/lang/de_de.json +++ b/lang/de_de.json @@ -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": "", diff --git a/lang/es_es.json b/lang/es_es.json index 67fa405..5a4288c 100644 --- a/lang/es_es.json +++ b/lang/es_es.json @@ -153,6 +153,7 @@ "Cancel": "", "Cannot copy text to the clipboard:": "", "Cannot lock": "", + "Cannot read module barcodes": "", "Cannot store data into": "", "Cannot unlock": "", "Center": "", diff --git a/lang/fa_fa.json b/lang/fa_fa.json index f99cb5f..fae50f5 100644 --- a/lang/fa_fa.json +++ b/lang/fa_fa.json @@ -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": "", diff --git a/lang/fr_fr.json b/lang/fr_fr.json index d976dfd..531fc93 100644 --- a/lang/fr_fr.json +++ b/lang/fr_fr.json @@ -153,6 +153,7 @@ "Cancel": "", "Cannot copy text to the clipboard:": "", "Cannot lock": "", + "Cannot read module barcodes": "", "Cannot store data into": "", "Cannot unlock": "", "Center": "", diff --git a/lang/hu_hu.json b/lang/hu_hu.json index ed98a73..a42a90c 100644 --- a/lang/hu_hu.json +++ b/lang/hu_hu.json @@ -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.": "", "": "" } \ No newline at end of file diff --git a/lang/it_it.json b/lang/it_it.json index 3087546..e81def0 100644 --- a/lang/it_it.json +++ b/lang/it_it.json @@ -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": "", "": "" -} +} \ No newline at end of file diff --git a/lang/jp_jp.json b/lang/jp_jp.json index d68aa18..0a43f5e 100644 --- a/lang/jp_jp.json +++ b/lang/jp_jp.json @@ -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": "", diff --git a/lang/ko_kr.json b/lang/ko_kr.json index fee4357..5ff9768 100644 --- a/lang/ko_kr.json +++ b/lang/ko_kr.json @@ -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": "", diff --git a/lang/nl_nl.json b/lang/nl_nl.json index 4efd994..b24d02b 100644 --- a/lang/nl_nl.json +++ b/lang/nl_nl.json @@ -153,6 +153,7 @@ "Cancel": "", "Cannot copy text to the clipboard:": "", "Cannot lock": "", + "Cannot read module barcodes": "", "Cannot store data into": "", "Cannot unlock": "", "Center": "", diff --git a/lang/pl_pl.json b/lang/pl_pl.json index 770ac0a..02c23f6 100644 --- a/lang/pl_pl.json +++ b/lang/pl_pl.json @@ -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": "", "": "" } \ No newline at end of file diff --git a/lang/pt_br.json b/lang/pt_br.json index e76ec40..c6a67db 100644 --- a/lang/pt_br.json +++ b/lang/pt_br.json @@ -168,6 +168,7 @@ "Cancel": "", "Cannot copy text to the clipboard:": "", "Cannot lock": "", + "Cannot read module barcodes": "", "Cannot store data into": "", "Cannot unlock": "", "Center": "", diff --git a/lang/pt_pt.json b/lang/pt_pt.json index 508663d..eea461d 100644 --- a/lang/pt_pt.json +++ b/lang/pt_pt.json @@ -289,6 +289,7 @@ "30th Anniversary": "", "Astro Bot": "", "Cannot copy text to the clipboard:": "", + "Cannot read module barcodes": "", "Chroma Indigo": "", "Chroma Pearl": "", "Chroma Teal": "", diff --git a/lang/rs_rs.json b/lang/rs_rs.json index 77ea0ca..2d327fb 100644 --- a/lang/rs_rs.json +++ b/lang/rs_rs.json @@ -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": "", diff --git a/lang/ru_ru.json b/lang/ru_ru.json index d1a1f4f..304360e 100644 --- a/lang/ru_ru.json +++ b/lang/ru_ru.json @@ -213,6 +213,7 @@ "Buttons": "", "Calibration": "", "Cannot copy text to the clipboard:": "", + "Cannot read module barcodes": "", "Center": "", "Center (L1)": "", "Chroma Indigo": "", diff --git a/lang/tr_tr.json b/lang/tr_tr.json index 3498557..6ce773d 100644 --- a/lang/tr_tr.json +++ b/lang/tr_tr.json @@ -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": "", "": "" -} +} \ No newline at end of file diff --git a/lang/ua_ua.json b/lang/ua_ua.json index 3d9cbc2..b384cd1 100644 --- a/lang/ua_ua.json +++ b/lang/ua_ua.json @@ -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": "", "": "" -} +} \ No newline at end of file diff --git a/lang/vi_vn.json b/lang/vi_vn.json index 23d07cf..0213e3c 100644 --- a/lang/vi_vn.json +++ b/lang/vi_vn.json @@ -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.": "", "": "" diff --git a/lang/zh_cn.json b/lang/zh_cn.json index 70b7c6e..087cda7 100644 --- a/lang/zh_cn.json +++ b/lang/zh_cn.json @@ -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": "", "": "" -} +} \ No newline at end of file diff --git a/lang/zh_tw.json b/lang/zh_tw.json index b497fcf..098942b 100644 --- a/lang/zh_tw.json +++ b/lang/zh_tw.json @@ -233,6 +233,7 @@ "Be gentle to avoid damage.": "", "Buttons": "", "Cannot copy text to the clipboard:": "", + "Cannot read module barcodes": "", "Center": "", "Center (L1)": "", "Circularity": "",