'use strict' document.getElementById('connect').addEventListener('click', async function () { p7.device = {}; var time = performance.now(); await p7.init() .catch((err) => { console.error(err); throw err; }).then((deviceInfo) => console.log(deviceInfo)); await p7.commands.ram.getFile(254, "@EDIT", "EDIT.CFG", "@EDIT").then((file) => console.log(file)); await p7.commands.flash.getAllFiles().then((f) => console.log(f)); console.log('Done. (in ' + Math.round(performance.now() - time) + 'ms)'); }); let input = document.getElementById('input'); input.addEventListener('change', async () => { await p7.commands.flash.sendFile(input.files[0], ''); console.log('Done.'); });