mirror of
https://github.com/meshcore-dev/meshcore.js.git
synced 2026-04-20 22:13:49 +00:00
add ability to reboot device
This commit is contained in:
parent
77803c5fca
commit
8125faaccf
3 changed files with 46 additions and 0 deletions
11
index.html
11
index.html
|
|
@ -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('');
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue