From 208e26929c5b65a785ec6e9a5b32289075eb12c9 Mon Sep 17 00:00:00 2001 From: cheetah Date: Fri, 23 Jun 2023 22:08:51 +0000 Subject: [PATCH] added Serial Change and BirdyWP-r3 support --- index.html | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 8e9502e..3d83f8d 100644 --- a/index.html +++ b/index.html @@ -19,7 +19,7 @@ Birdy Flash Tools 2.0 - by cheetah.cat (patreon) + by cheetah.cat (telegram) @@ -40,7 +40,22 @@ Serial: {{ global.selectedDevice.deviceSerial }} Write E2P Dump E2P - Change Serial + + + + + + + + + + + Close Dialog + + + @@ -286,6 +301,16 @@ class TPLBirdy { devInfo.idk = parts[4] devInfo.deviceSerial = parts[5] break; + case "BirdyWP-r3": + devInfo.type = 'BirdyWP-r3' + devInfo.firstIDK = parts[0] + devInfo.model = parts[0] + devInfo.firmwareVersion = parts[1] + devInfo.hardwareVersion = parts[2] + devInfo.e2pVersion = parts[3] + devInfo.idk = parts[4] + devInfo.deviceSerial = parts[5] + break; case "BirdyE": devInfo.type = 'BirdyE' devInfo.firstIDK = 0x00 @@ -307,6 +332,11 @@ class TPLBirdy { await this.sendCMD([ 0x13, ].concat(newSerial.split('').map(x => x.charCodeAt()))) console.log(this.responseToString(await this.wait4Response())) break + case 'BirdyWP-r3': //note to myself, needs a 0 in front of the serial 1234 -> 01234 + //if (newSerial.length != 13) throw 'insufficient serial length' + await this.sendCMD([ 0x13, ].concat(`0${ newSerial }`.split('').map(x => x.charCodeAt()))) + console.log(this.responseToString(await this.wait4Response())) + break } } } @@ -337,6 +367,11 @@ new Vue({ NwkSKey: '00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00', DevAddr: '00 00 00 00', }, + changeSerial: { + dialog: false, + oldSerial: '', + newSerial: '' + }, } }, created() { @@ -363,6 +398,8 @@ new Vue({ } else { this.global.step = 1 this.global.selectedDevice = deviceInfo + + this.changeSerial.oldSerial = deviceInfo.deviceSerial } }) .catch(error => { @@ -390,6 +427,23 @@ new Vue({ await this.bPager.sendCMD(loraProvCMD) let resp = this.bPager.wait4Response() console.log(resp) + }, + async applyChangeSerial() { + await this.bPager.writeSerial(this.changeSerial.newSerial) + let resp = this.bPager.wait4Response() + console.log(resp) + + let deviceInfo = await this.bPager.getDeviceInfo() + console.log('deviceInfo', deviceInfo) + if (deviceInfo.type === false) { + this.global.step = -1 + alert('unknown pager detected') + } else { + this.global.step = 1 + this.global.selectedDevice = deviceInfo + + this.changeSerial.oldSerial = deviceInfo.deviceSerial + } } } @@ -397,4 +451,4 @@ new Vue({ - \ No newline at end of file +