Skip to content

Commit

Permalink
Fix BDAddr for DS4/DS5
Browse files Browse the repository at this point in the history
  • Loading branch information
dualshock-tools committed Apr 17, 2024
1 parent 75177f7 commit e67bb83
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions core.js
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,19 @@ async function ds5_nvstatus() {
}

async function ds4_getbdaddr() {
return "not implemented";
try {
data = await device.receiveFeatureReport(0x12)
out = ""
for(i=0;i<6;i++) {
if(i >= 1) out += ":";
out += dec2hex8(data.getUint8(i, false));
}
$("#d-bdaddr").text(out);
return out;
} catch(e) {
$("#d-bdaddr").html("<font color='red'>" + l("error") + "</font>");
return "error";
}
}

async function ds5_getbdaddr() {
Expand All @@ -317,7 +329,7 @@ async function ds5_getbdaddr() {
out = ""
for(i=0;i<6;i++) {
if(i >= 1) out += ":";
out += dec2hex8(data.getUint8(4 + i, false));
out += dec2hex8(data.getUint8(4 + 5 - i, false));
}
$("#d-bdaddr").text(out);
return out;
Expand Down Expand Up @@ -1080,6 +1092,7 @@ function lang_reset_page() {
}
$("#authorMsg").html("");
$("#curLang").html("English");
document.title = lang_orig_text[".title"];
}

function l(text) {
Expand Down Expand Up @@ -1120,6 +1133,7 @@ function lang_translate(target_file, target_lang) {
$(item).html(tnew[0]);
} else {
console.log("Cannot find mapping for " + old);
$(item).html(old);
}
}
var old_title = lang_orig_text[".title"];
Expand Down

0 comments on commit e67bb83

Please sign in to comment.