add ability to recondition display
This commit is contained in:
40
index.html
40
index.html
@@ -318,7 +318,8 @@
|
||||
Configure Display (optional)
|
||||
</div>
|
||||
|
||||
<div class="p-3">
|
||||
<div class="p-3 space-y-2">
|
||||
|
||||
<div class="flex space-x-1">
|
||||
<div class="my-auto">Rotation</div>
|
||||
<button @click="setDisplayRotation(0)" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
|
||||
@@ -334,6 +335,17 @@
|
||||
3
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="flex space-x-1">
|
||||
<div class="my-auto">Reconditioning</div>
|
||||
<button @click="startDisplayReconditioning" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
|
||||
Start
|
||||
</button>
|
||||
<button @click="reboot" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
|
||||
Stop
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="border-t px-2 py-1 text-sm">
|
||||
@@ -1764,6 +1776,32 @@
|
||||
// done
|
||||
await rnode.close();
|
||||
|
||||
},
|
||||
async startDisplayReconditioning() {
|
||||
|
||||
// ask for rnode
|
||||
const rnode = await this.askForRNode();
|
||||
if(!rnode){
|
||||
return;
|
||||
}
|
||||
|
||||
// check if device has been provisioned
|
||||
const rom = await rnode.getRomAsObject();
|
||||
const details = rom.parse();
|
||||
if(!details || !details.is_provisioned){
|
||||
alert("Eeprom is not provisioned. You must do this first!");
|
||||
await rnode.close();
|
||||
return;
|
||||
}
|
||||
|
||||
// configure
|
||||
console.log("starting display reconditioning");
|
||||
await rnode.startDisplayReconditioning();
|
||||
console.log("starting display reconditioning: done");
|
||||
|
||||
// done
|
||||
await rnode.close();
|
||||
|
||||
},
|
||||
async readAsBinaryString(blob) {
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -80,6 +80,7 @@ class RNode {
|
||||
CMD_HASHES = 0x60;
|
||||
CMD_FW_UPD = 0x61;
|
||||
CMD_DISP_ROT = 0x67;
|
||||
CMD_DISP_RCND = 0x68;
|
||||
|
||||
CMD_BT_CTRL = 0x46;
|
||||
CMD_BT_PIN = 0x62;
|
||||
@@ -758,6 +759,13 @@ class RNode {
|
||||
]);
|
||||
}
|
||||
|
||||
async startDisplayReconditioning() {
|
||||
await this.sendKissCommand([
|
||||
this.CMD_DISP_RCND,
|
||||
0x01,
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ROM {
|
||||
|
||||
Reference in New Issue
Block a user