add ability to reboot device

This commit is contained in:
liamcottle 2025-02-16 16:57:08 +13:00
parent 77803c5fca
commit 8125faaccf
3 changed files with 46 additions and 0 deletions

View file

@ -98,6 +98,9 @@
<button @click="exportContact(null)" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
ExportContact
</button>
<button @click="reboot" class="border border-gray-500 px-2 bg-gray-100 hover:bg-gray-200 rounded">
Reboot
</button>
</div>
</div>
@ -382,6 +385,14 @@
0xd2,
]);
},
async reboot() {
try {
await this.connection.reboot();
alert("Device is rebooting!");
} catch(e) {
alert("Failed to reboot!");
}
},
bytesToHex(uint8Array) {
return Array.from(uint8Array).map(byte => byte.toString(16).padStart(2, '0')).join('');
},