diff --git a/ble_api/js/blxdash.js b/ble_api/js/blxdash.js index 0b14b88..041fb3e 100644 --- a/ble_api/js/blxdash.js +++ b/ble_api/js/blxdash.js @@ -1,4 +1,4 @@ -import*as JD from"./jodash.js";import*as QRS from"./qrscanner.js";import*as I18 from"./intmain_i18n.js";import"./blx.js";import"./blStore.js";import"./FileSaver.js";let VERSION="V0.16 / 11.10.2024",COPYRIGHT="(C)JoEmbedded.de",connectionLevel=0,lastAdvertisingName,blxDevice,uplStatus={totalsize:0,mode:"",sumsize:0,filesize:0,filename:"",fproc:0,ndata:!1},deviceListDB=[],defLang=I18.i18_availLang[0],setupOptions={dtheme:!1,font:100,lang:defLang,server:"../sync/blxremote.php",accesstoken:"123456"},isUrlGit,sidebuttonMaincontent=(document.getElementById("bd-version").textContent=VERSION+(0sectionMain.scrollIntoView(!0)),sidebuttonTerminal.addEventListener("click",()=>sectionTerminal.scrollIntoView(!1)),document.getElementById("bd-online")),bdOffline=document.getElementById("bd-offline"),lastOnlineState,blxInfoLine=(sidebuttonBluetooth.addEventListener("click",blxConnect),sidebuttonSetup.addEventListener("click",doSetupDialog),sidebuttonServersync.addEventListener("click",runServerSync),sidebuttonQRscan.addEventListener("click",bdRunQRscanner),document.getElementById("blxInfoLine")),blxGraph=document.getElementById("blxGraph");const blxCmdRes=document.getElementById("blxCmdRes");let blxConnectButtonText=document.getElementById("blxConnectButtonText"),blxMemory=document.getElementById("blxMemory"),blxSync=document.getElementById("blxSync"),blxSignal=document.getElementById("blxSignal"),blxMeasureData=document.getElementById("blxMeasureData"),blxDeviceName=document.getElementById("blxDeviceName"),blxMAC=document.getElementById("blxMAC"),blxType=document.getElementById("blxType"),blxFW=document.getElementById("blxFW"),blxPIN=document.getElementById("blxPIN"),blxPinEnter=document.getElementById("blxPinEnter"),blxSyncButton=document.getElementById("blxSyncButton"),blxMeasureButton=document.getElementById("blxMeasureButton"),blxEcholotCheck=document.getElementById("blxEcholot"),blxUploadButton=document.getElementById("blxUploadButton"),blxInfoButton=document.getElementById("blxInfoButton"),blxClearButton=document.getElementById("blxClearButton"),blxParametersButton=document.getElementById("blxParametersButton"),blxSysParButton=document.getElementById("blxSysParButton"),blxSyncButtonSpan=document.getElementById("blxSyncButtonSpan"),blxUploadButtonSpan=document.getElementById("blxUploadButtonSpan"),blxInfoButtonSpan=document.getElementById("blxInfoButtonSpan"),blxClearButtonSpan=document.getElementById("blxClearButtonSpan"),blxParametersSpan=document.getElementById("blxParametersSpan"),blxSetPinButton=document.getElementById("blxSetPinButton"),blxScanPinButton=document.getElementById("blxScanPinButton"),navDevicelist=(blxSetPinButton.addEventListener("click",blxSetPin),blxScanPinButton.addEventListener("click",blxScanPin),blxInfoButton.addEventListener("click",blxMemoryInfo),blxSyncButton.addEventListener("click",blxSyncTime),blxUploadButton.addEventListener("click",blxUpload),blxMeasureButton.addEventListener("click",blxMeasure),blxEcholotCheck.addEventListener("click",blxEcholotClick),blxClearButton.addEventListener("click",blxClearDevice),blxParametersButton.addEventListener("click",blxEditIparam),blxSysParButton.addEventListener("click",blxEditSysparam),document.getElementById("nav-devicelist")),bdurl=new URL(location);function ll(e){return I18.ll(e)}async function blxConnect(){let e=!1,t=(blxCmdRes&&(blxCmdRes.textContent="-"),disabler(!0),!1);try{2<=connectionLevel?(JD.spinnerShow("Bluetooth",""+ll("Disconnect"),10,!0),await _blxCmdSend(".d")):(void 0!==lastAdvertisingName&&(t=await JD.doDialogOK(""+ll("Reconnect?"),`${ll("Reconnect to Device?")}
${ll("Name")}: '${lastAdvertisingName}'
`+ll("OK to Reconnect (or close)"))),e=!0,t?await _blxCmdSend(".r"):await _blxCmdSend(".c"),await showLoggerDetails())}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BCo]")}JD.spinnerClose(),disabler(!1),e&&JD.sidebarMax(.3)}function disabler(e){var t=blx.getPinOK();e?sidebuttonBluetooth.classList.add("jo-disabled"):sidebuttonBluetooth.classList.remove("jo-disabled");let n="none";!0!==t&&!1===e&&3<=connectionLevel&&(n="block"),blxPinEnter&&(blxPinEnter.style.display=n),0!=connectionLevel&&!0===t||(e=!0),blxSyncButton&&(blxSyncButton.disabled=e),blxMeasureButton&&(blxMeasureButton.disabled=e),blxEcholotCheck&&(blxEcholotCheck.disabled=e),blxUploadButton&&(blxUploadButton.disabled=e),blxInfoButton&&(blxInfoButton.disabled=e),blxClearButton&&(blxClearButton.disabled=e),blxParametersButton&&(blxParametersButton.disabled=e),blxSysParButton&&(blxSysParButton.disabled=e),n=void 0!==blxDevice&&1e3<=blxDevice.deviceType?"block":"none",blxSyncButtonSpan&&(blxSyncButtonSpan.style.display=n),blxUploadButtonSpan&&(blxUploadButtonSpan.style.display=n),blxInfoButtonSpan&&(blxInfoButtonSpan.style.display=n),blxClearButtonSpan&&(blxClearButtonSpan.style.display=n),blxParametersSpan&&(blxParametersSpan.style.display=n)}async function showLoggerDetails(){if(3<=connectionLevel){blxDevice=blx.getDevice(),blxMAC&&(blxMAC.textContent=blxDevice.deviceMAC),blxType&&(blxType.textContent=blxDevice.deviceType),blxFW&&(blxFW.textContent=blxDevice.firmwareVersion),4==connectionLevel&&1e3<=blxDevice.deviceType&&(await calculateMemory(!0),await showLink());var t=blxDevice.deltaToApp;let e=t+" "+ll("sec");864e5${ll("Time lost!")}`:86400",e),_blxCmdBusyFlag=!1,_blxCmdRBCnt=0}catch(e){console.log("ERROR:",e),_blxCmdBusyFlag=!1,_blxCmdRBCnt=0,_blxCmdResult=e,connectionLevel<=2&&bleCallback("CON",0)}}async function calculateMemory(n){let l="???";try{n&&await _blxCmdSend(".m");var a=blx.getMemory();let e,t=(e=0 ${ll("Show Graph")}
(`+t.v.akt_len+" Byte, "+t.v.ctime.toLocaleString()+")")}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BsL]")}blxGraph.innerHTML=e}async function blxMemoryInfo(){disabler(!0),JD.spinnerShow(ll("Memory Info"),null,60,!0);try{await _blxCmdSend("v"),await calculateMemory(!0)}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BMI]")}JD.spinnerClose(),disabler(!1)}async function blxClearDevice(){if(disabler(!0),await JD.doDialogOK(ll("Clear Device?"),ll("OK to clear Device Memory?"),null,!0)){JD.spinnerShow(ll("Clear Device"),null,250);try{void 0!==blxDevice.diskCheckOK&&!0===blxDevice.diskCheckOK?(blxInfoLine&&(blxInfoLine.textContent=ll("Start new Measure, Clear all Data")),await _blxCmdSend("n")):(blxInfoLine&&(blxInfoLine.textContent=ll("Start new Measure, Clear all Data (Clean FlashDisk, may need up to 240 sec)")),await _blxCmdSend("n1",24e4)),document.getElementById("blxMemory").textContent="-",await blStore.remove(blxDevice.deviceMAC+"_xtract.edt"),await showLink()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BCD]")}JD.spinnerClose()}disabler(!1)}async function blxSetPin(){blxCmdRes&&(blxCmdRes.textContent="-");var e=blxPIN.value;disabler(!0),JD.spinnerShow(ll("Set PIN"),null,300);try{if(e.length<1)throw"ERROR: PIN EMPTY";await _blxCmdSend(".i "+e),blxPIN.value="",await showLoggerDetails()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BSP]")}JD.spinnerClose(),disabler(!1)}async function blxScanPin(){await bdRunQRscanner(blxDevice.deviceMAC)}async function blxSyncTime(){disabler(!0),JD.spinnerShow(ll("Sync Device Time"),null,30,!0);try{await _blxCmdSend(".t set"),blxSync.textContent=0}catch(e){JD.joPingError(),blxCmdRes=blxCmdRes&&e+" [BST]"}JD.spinnerClose(),disabler(!1)}async function blxUpload(){disabler(!0),JD.spinnerShow(ll("Upload Data"),null,600,!1);try{await _blxCmdSend(".u"),await calculateMemory(!1),await _blxCmdSend(".x"),await showLink()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BUp]")}await updateDeviceList(),JD.spinnerClose(),disabler(!1)}async function blxEcholotClick(){await _blxCmdSend(blxEcholotCheck.checked?".a 1":".a 0")}let measureData="???";async function blxMeasure(){disabler(!0),JD.spinnerShow(ll("Measure"),null,30,!0),blxMeasureData.innerHTML=ll("Wait...");try{await _blxCmdSend("e 1")}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BMe]")}JD.spinnerClose(),disabler(!1)}let p100_beschr=["*@100_System","*DEVICE_TYP","*MAX_CHANNELS","*HK_FLAGS","*NewCookie [Parameter 10-digit Timestamp.32]","Device_Name[BLE:$11/total:$41]","Period_sec[10..86400]","Period_Offset_sec[0..(Period_sec-1)]","Period_Alarm_sec[0..Period_sec]","Period_Internet_sec[0..604799]","Period_Internet_Alarm_sec[0..Period_Internet_sec]","UTC_Offset_sec[-43200..43200]","Flags (B0:Rec B1:Ring) (0: RecOff) B2:Compress","HK_flags (B0:Bat B1:Temp B2.Hum B3.Perc B4.Baro)","HK_reload[0..255]","Net_Mode (0:Off 1:OnOff 2:On_5min 3:Online)","ErrorPolicy (O:None 1:RetriesForAlarms, 2:RetriesForAll)","MinTemp_oC[-40..10]","Config0_U31 (B0:OffPer.Inet:On/Off B1,2:BLE:On/Mo/Li/MoLi B3:EnDS B4:CE:Off/On B5:Live:Off/On)","Configuration_Command[$79]","Internet_Starttime[Timestamp.32]"],pkan_beschr=["*@ChanNo","Action[0..65535] (B0:Meas B1:Cache B2:Alarms)","Physkan_no[0..65535]","Kan_caps_str[$8]","Src_index[0..255]","Unit[$8]","Mem_format[0..255]","DB_id[0..2e31]","Offset[float]","Factor[float]","Alarm_hi[float]","Alarm_lo[float]","Messbits[0..65535]","Xbytes[$32]"],p200_beschr=["*@200_Sys_Param","APN[$41]","Server/VPN[$41]","Script/Id[$41]","API Key[$41]","ConFlags[0..255] (B0:Verbose B1:RoamAllow B4:LOG_FILE (B5:LOG_UART) B7:Debug)","SIM Pin[0..65535] (opt)","APN User[$41]","APN Password[$41]","Max_creg[10..255]","Port[1..65535]","Server_timeout_0[1000..65535]","Server_timeout_run[1000..65535]","Modem Check Reload[60..3600]","Bat. Capacity (mAh)[0..100000]","Bat. Volts 0%[float]","Bat. Volts 100%[float]","Max Ringsize (Bytes)[1000..2e31]","mAmsec/Measure[0..1e9]","Mobile Protocol[0..255] B0:0/1:HTTP/HTTPS B1:PUSH B2,3:TCP/UDPSetup"],original_par;async function editParamDialogDo(e){var t="
";let n;return e?n=JD.prepareCustomDialog(ll("Edit Parameter")+" 'sys_param'",t,ll("Send...")):(n=JD.prepareCustomDialog(ll("Edit Parameter")+" 'iparam'",t,ll("Send..."),``)).querySelector("#editBtnAddChannel").addEventListener("click",()=>{try{blxEditedParamGet(0),blx.IparamAddChannel(blxDevice.iparam,!0),blxParametersCopy(!1,0);var e=document.getElementById("blxParameterEdit");e.innerHTML=blxParametersGetHtml(0),e.scrollTop=e.scrollHeight,JD.joPing()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BaC]")}}),document.getElementById("blxParameterEdit").innerHTML=blxParametersGetHtml(e),await JD.doCustomDialog(0)}function blxParCancel(e){e?blxDevice.sys_param=original_par:blxDevice.iparam=original_par,blxCmdRes&&(blxCmdRes.textContent=ll("Edit Parameters cancelled"))}function blxEditedParamGet(n){var e=(n?blxDevice.sys_param:blxDevice.iparam).length;for(let t=0;t


${e}
`,null),t=e}else try{blxEditedParamGet(0),blx.CompactIparam(blxDevice.iparam),blxParametersCopy(!1,0);var o=blx.IparamValidate(blxDevice.iparam);if(o)throw"ERROR: Iparam-Check(3):\n"+o;var r=(new TextEncoder).encode(blxDevice.iparam.join("\n")+"\n"),s=blx.getCrc32(r);await blStore.get(blxDevice.deviceMAC+"_iparam.lxp");let e=blStore.result();if(void 0!==e&&s===e.v.crc32&&r.length===e.v.akt_len&&!1===blxDevice.iparam_dirtyflag)return blxCmdRes&&(blxCmdRes.textContent=ll("(No Changes)")),JD.spinnerClose(),t;void 0===e&&(e={v:{}}),blxEditedParamGet(0),blxDevice.iparam[4]=(Date.now()/1e3).toFixed(0),blxDevice.iparam_dirtyflag=!0;var d=new TextEncoder;if(e.v.bytebuf=d.encode(blxDevice.iparam.join("\n")+"\n"),e.v.crc32=blx.getCrc32(e.v.bytebuf),e.v.total_len=e.v.bytebuf.length,e.v.akt_len=e.v.total_len,e.v.ctime=new Date(1e3*blxDevice.iparam[4]),e.v.esync_flag=!0,e.v.tssync=void 0,await blStore.set(blxDevice.deviceMAC+"_iparam.lxp",e.v),await _blxCmdSend(".fput "+blxDevice.deviceMAC+"_iparam.lxp"),_blxCmdResult)throw _blxCmdResult;if(await _blxCmdSend("X"),_blxCmdResult)throw _blxCmdResult;blxDevice.iparam_dirtyflag=!1,await blStore.set(blxDevice.deviceMAC+"_#BAK_iparam.lxp",e.v)}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+"[BPa]"),await doDialogOK(ll("ERROR"),ll("Parameter Check")+` 'iparam'


${e}
`,null),t=e}return await updateDeviceList(),JD.spinnerClose(),t}function blxParametersCopy(e,t){var n=t?blxDevice.sys_param:blxDevice.iparam;if(!0===e)if(original_par=[],void 0===n)doDialogOK(ll("ERROR")+": Iparam-Check(1)","No Parameters found!",null);else{for(let e=0;e"):i++;var s,d=void 0!==a[i]?a[i]:"(unknown)";let e,t=(d.indexOf("Timestamp.32")&&1e9[${n}+(+${i})] +import*as JD from"./jodash.js";import*as QRS from"./qrscanner.js";import*as I18 from"./intmain_i18n.js";import"./blx.js";import"./blStore.js";import"./FileSaver.js";let VERSION="V0.17 / 27.10.2024",COPYRIGHT="(C)JoEmbedded.de",connectionLevel=0,lastAdvertisingName,blxDevice,uplStatus={totalsize:0,mode:"",sumsize:0,filesize:0,filename:"",fproc:0,ndata:!1},deviceListDB=[],defLang=I18.i18_availLang[0],setupOptions={dtheme:!1,font:100,lang:defLang,server:"../sync/blxremote.php",accesstoken:"123456"},isUrlGit,sidebuttonMaincontent=(document.getElementById("bd-version").textContent=VERSION+(0sectionMain.scrollIntoView(!0)),sidebuttonTerminal.addEventListener("click",()=>sectionTerminal.scrollIntoView(!1)),document.getElementById("bd-online")),bdOffline=document.getElementById("bd-offline"),lastOnlineState,blxInfoLine=(sidebuttonBluetooth.addEventListener("click",blxConnect),sidebuttonSetup.addEventListener("click",doSetupDialog),sidebuttonServersync.addEventListener("click",runServerSync),sidebuttonQRscan.addEventListener("click",bdRunQRscanner),document.getElementById("blxInfoLine")),blxGraph=document.getElementById("blxGraph");const blxCmdRes=document.getElementById("blxCmdRes");let blxConnectButtonText=document.getElementById("blxConnectButtonText"),blxMemory=document.getElementById("blxMemory"),blxSync=document.getElementById("blxSync"),blxSignal=document.getElementById("blxSignal"),blxMeasureData=document.getElementById("blxMeasureData"),blxDeviceName=document.getElementById("blxDeviceName"),blxMAC=document.getElementById("blxMAC"),blxType=document.getElementById("blxType"),blxFW=document.getElementById("blxFW"),blxPIN=document.getElementById("blxPIN"),blxPinEnter=document.getElementById("blxPinEnter"),blxSyncButton=document.getElementById("blxSyncButton"),blxMeasureButton=document.getElementById("blxMeasureButton"),blxEcholotCheck=document.getElementById("blxEcholot"),blxUploadButton=document.getElementById("blxUploadButton"),blxInfoButton=document.getElementById("blxInfoButton"),blxClearButton=document.getElementById("blxClearButton"),blxParametersButton=document.getElementById("blxParametersButton"),blxSysParButton=document.getElementById("blxSysParButton"),blxSyncButtonSpan=document.getElementById("blxSyncButtonSpan"),blxUploadButtonSpan=document.getElementById("blxUploadButtonSpan"),blxInfoButtonSpan=document.getElementById("blxInfoButtonSpan"),blxClearButtonSpan=document.getElementById("blxClearButtonSpan"),blxParametersSpan=document.getElementById("blxParametersSpan"),blxSetPinButton=document.getElementById("blxSetPinButton"),blxScanPinButton=document.getElementById("blxScanPinButton"),navDevicelist=(blxSetPinButton.addEventListener("click",blxSetPin),blxScanPinButton.addEventListener("click",blxScanPin),blxInfoButton.addEventListener("click",blxMemoryInfo),blxSyncButton.addEventListener("click",blxSyncTime),blxUploadButton.addEventListener("click",blxUpload),blxMeasureButton.addEventListener("click",blxMeasure),blxEcholotCheck.addEventListener("click",blxEcholotClick),blxClearButton.addEventListener("click",blxClearDevice),blxParametersButton.addEventListener("click",blxEditIparam),blxSysParButton.addEventListener("click",blxEditSysparam),document.getElementById("nav-devicelist")),bdurl=new URL(location);function ll(e){return I18.ll(e)}async function blxConnect(){let e=!1,t=(blxCmdRes&&(blxCmdRes.textContent="-"),disabler(!0),!1);try{2<=connectionLevel?(JD.spinnerShow("Bluetooth",""+ll("Disconnect"),10,!0),await _blxCmdSend(".d")):(void 0!==lastAdvertisingName&&(t=await JD.doDialogOK(""+ll("Reconnect?"),`${ll("Reconnect to Device?")}
${ll("Name")}: '${lastAdvertisingName}'
`+ll("OK to Reconnect (or close)"))),e=!0,t?await _blxCmdSend(".r"):await _blxCmdSend(".c"),await showLoggerDetails())}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BCo]")}JD.spinnerClose(),disabler(!1),e&&JD.sidebarMax(.3)}function disabler(e){var t=blx.getPinOK();e?sidebuttonBluetooth.classList.add("jo-disabled"):sidebuttonBluetooth.classList.remove("jo-disabled");let n="none";!0!==t&&!1===e&&3<=connectionLevel&&(n="block"),blxPinEnter&&(blxPinEnter.style.display=n),0!=connectionLevel&&!0===t||(e=!0),blxSyncButton&&(blxSyncButton.disabled=e),blxMeasureButton&&(blxMeasureButton.disabled=e),blxEcholotCheck&&(blxEcholotCheck.disabled=e),blxUploadButton&&(blxUploadButton.disabled=e),blxInfoButton&&(blxInfoButton.disabled=e),blxClearButton&&(blxClearButton.disabled=e),blxParametersButton&&(blxParametersButton.disabled=e),blxSysParButton&&(blxSysParButton.disabled=e),n=void 0!==blxDevice&&1e3<=blxDevice.deviceType?"block":"none",blxSyncButtonSpan&&(blxSyncButtonSpan.style.display=n),blxUploadButtonSpan&&(blxUploadButtonSpan.style.display=n),blxInfoButtonSpan&&(blxInfoButtonSpan.style.display=n),blxClearButtonSpan&&(blxClearButtonSpan.style.display=n),blxParametersSpan&&(blxParametersSpan.style.display=n)}async function showLoggerDetails(){if(3<=connectionLevel){blxDevice=blx.getDevice(),blxMAC&&(blxMAC.textContent=blxDevice.deviceMAC),blxType&&(blxType.textContent=blxDevice.deviceType),blxFW&&(blxFW.textContent=blxDevice.firmwareVersion),4==connectionLevel&&1e3<=blxDevice.deviceType&&(await calculateMemory(!0),await showLink());var t=blxDevice.deltaToApp;let e=t+" "+ll("sec");864e5${ll("Time lost!")}`:86400",e),_blxCmdBusyFlag=!1,_blxCmdRBCnt=0}catch(e){console.log("ERROR:",e),_blxCmdBusyFlag=!1,_blxCmdRBCnt=0,_blxCmdResult=e,connectionLevel<=2&&bleCallback("CON",0)}}async function calculateMemory(n){let l="???";try{n&&await _blxCmdSend(".m");var a=blx.getMemory();let e,t=(e=0 ${ll("Show Graph")}
(`+t.v.akt_len+" Byte, "+t.v.ctime.toLocaleString()+")")}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BsL]")}blxGraph.innerHTML=e}async function blxMemoryInfo(){disabler(!0),JD.spinnerShow(ll("Memory Info"),null,60,!0);try{await _blxCmdSend("v"),await calculateMemory(!0)}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BMI]")}JD.spinnerClose(),disabler(!1)}async function blxClearDevice(){if(disabler(!0),await JD.doDialogOK(ll("Clear Device?"),ll("OK to clear Device Memory?"),null,!0)){JD.spinnerShow(ll("Clear Device"),null,250);try{void 0!==blxDevice.diskCheckOK&&!0===blxDevice.diskCheckOK?(blxInfoLine&&(blxInfoLine.textContent=ll("Start new Measure, Clear all Data")),await _blxCmdSend("n")):(blxInfoLine&&(blxInfoLine.textContent=ll("Start new Measure, Clear all Data (Clean FlashDisk, may need up to 240 sec)")),await _blxCmdSend("n1",24e4)),document.getElementById("blxMemory").textContent="-",await blStore.remove(blxDevice.deviceMAC+"_xtract.edt"),await showLink()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BCD]")}JD.spinnerClose()}disabler(!1)}async function blxSetPin(){blxCmdRes&&(blxCmdRes.textContent="-");var e=blxPIN.value;disabler(!0),JD.spinnerShow(ll("Set PIN"),null,300);try{if(e.length<1)throw"ERROR: PIN EMPTY";await _blxCmdSend(".i "+e),blxPIN.value="",await showLoggerDetails()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BSP]")}JD.spinnerClose(),disabler(!1)}async function blxScanPin(){await bdRunQRscanner(blxDevice.deviceMAC)}async function blxSyncTime(){disabler(!0),JD.spinnerShow(ll("Sync Device Time"),null,30,!0);try{await _blxCmdSend(".t set"),blxSync.textContent=0}catch(e){JD.joPingError(),blxCmdRes=blxCmdRes&&e+" [BST]"}JD.spinnerClose(),disabler(!1)}async function blxUpload(){disabler(!0),JD.spinnerShow(ll("Upload Data"),null,600,!1);try{await _blxCmdSend(".u"),await calculateMemory(!1),await _blxCmdSend(".x"),await showLink()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BUp]")}await updateDeviceList(),JD.spinnerClose(),disabler(!1)}async function blxEcholotClick(){await _blxCmdSend(blxEcholotCheck.checked?".a 1":".a 0")}let measureData="???";async function blxMeasure(){disabler(!0),JD.spinnerShow(ll("Measure"),null,30,!0),blxMeasureData.innerHTML=ll("Wait...");try{await _blxCmdSend("e 1")}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BMe]")}JD.spinnerClose(),disabler(!1)}let p100_beschr=["*@100_System","*DEVICE_TYP","*MAX_CHANNELS","*HK_FLAGS","*NewCookie [Parameter 10-digit Timestamp.32]","Device_Name[BLE:$11/total:$41]","Period_sec[10..86400]","Period_Offset_sec[0..(Period_sec-1)]","Period_Alarm_sec[0..Period_sec]","Period_Internet_sec[0..604799]","Period_Internet_Alarm_sec[0..Period_Internet_sec]","UTC_Offset_sec[-43200..43200]","Flags (B0:Rec B1:Ring) (0: RecOff) B2:Compress","HK_flags (B0:Bat B1:Temp B2.Hum B3.Perc B4.Baro)","HK_reload[0..255]","Net_Mode (0:Off 1:OnOff 2:On_5min 3:Online)","ErrorPolicy (O:None 1:RetriesForAlarms, 2:RetriesForAll)","MinTemp_oC[-40..10]","Config0_U31 (B0:OffPer.Inet:On/Off B1,2:BLE:On/Mo/Li/MoLi B3:EnDS B4:CE:Off/On B5:Live:Off/On)","Configuration_Command[$79]","Internet_Starttime[Timestamp.32]"],pkan_beschr=["*@ChanNo","Action[0..65535] (B0:Meas B1:Cache B2:Alarms)","Physkan_no[0..65535]","Kan_caps_str[$8]","Src_index[0..255]","Unit[$8]","Mem_format[0..255]","DB_id[0..2e31]","Offset[float]","Factor[float]","Alarm_hi[float]","Alarm_lo[float]","Messbits[0..65535]","Xbytes[$32]"],p200_beschr=["*@200_Sys_Param","APN[$41]","Server/VPN[$41]","Script/Id[$41]","API Key[$41]","ConFlags[0..255] (B0:Verbose B1:RoamAllow B4:LOG_FILE (B5:LOG_UART) B7:Debug)","SIM Pin[0..65535] (opt)","APN User[$41]","APN Password[$41]","Max_creg[10..255]","Port[1..65535]","Server_timeout_0[1000..65535]","Server_timeout_run[1000..65535]","Modem Check Reload[60..3600]","Bat. Capacity (mAh)[0..100000]","Bat. Volts 0%[float]","Bat. Volts 100%[float]","Max Ringsize (Bytes)[1000..2e31]","mAmsec/Measure[0..1e9]","Mobile Protocol[0..255] B0:0/1:HTTP/HTTPS B1:PUSH B2,3:TCP/UDPSetup"],original_par;async function editParamDialogDo(e){var t="
";let n;return e?n=JD.prepareCustomDialog(ll("Edit Parameter")+" 'sys_param'",t,ll("Send...")):(n=JD.prepareCustomDialog(ll("Edit Parameter")+" 'iparam'",t,ll("Send..."),``)).querySelector("#editBtnAddChannel").addEventListener("click",()=>{try{blxEditedParamGet(0),blx.IparamAddChannel(blxDevice.iparam,!0),blxParametersCopy(!1,0);var e=document.getElementById("blxParameterEdit");e.innerHTML=blxParametersGetHtml(0),e.scrollTop=e.scrollHeight,JD.joPing()}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+" [BaC]")}}),document.getElementById("blxParameterEdit").innerHTML=blxParametersGetHtml(e),await JD.doCustomDialog(0)}function blxParCancel(e){e?blxDevice.sys_param=original_par:blxDevice.iparam=original_par,blxCmdRes&&(blxCmdRes.textContent=ll("Edit Parameters cancelled"))}function blxEditedParamGet(n){var e=(n?blxDevice.sys_param:blxDevice.iparam).length;for(let t=0;t


${e}
`,null),t=e}else try{blxEditedParamGet(0),blx.CompactIparam(blxDevice.iparam),blxParametersCopy(!1,0);var o=blx.IparamValidate(blxDevice.iparam);if(o)throw"ERROR: Iparam-Check(3):\n"+o;var r=(new TextEncoder).encode(blxDevice.iparam.join("\n")+"\n"),s=blx.getCrc32(r);await blStore.get(blxDevice.deviceMAC+"_iparam.lxp");let e=blStore.result();if(void 0!==e&&s===e.v.crc32&&r.length===e.v.akt_len&&!1===blxDevice.iparam_dirtyflag)return blxCmdRes&&(blxCmdRes.textContent=ll("(No Changes)")),JD.spinnerClose(),t;void 0===e&&(e={v:{}}),blxEditedParamGet(0),blxDevice.iparam[4]=(Date.now()/1e3).toFixed(0),blxDevice.iparam_dirtyflag=!0;var d=new TextEncoder;if(e.v.bytebuf=d.encode(blxDevice.iparam.join("\n")+"\n"),e.v.crc32=blx.getCrc32(e.v.bytebuf),e.v.total_len=e.v.bytebuf.length,e.v.akt_len=e.v.total_len,e.v.ctime=new Date(1e3*blxDevice.iparam[4]),e.v.esync_flag=!0,e.v.tssync=void 0,await blStore.set(blxDevice.deviceMAC+"_iparam.lxp",e.v),await _blxCmdSend(".fput "+blxDevice.deviceMAC+"_iparam.lxp"),_blxCmdResult)throw _blxCmdResult;if(await _blxCmdSend("X"),_blxCmdResult)throw _blxCmdResult;blxDevice.iparam_dirtyflag=!1,await blStore.set(blxDevice.deviceMAC+"_#BAK_iparam.lxp",e.v)}catch(e){JD.joPingError(),blxCmdRes&&(blxCmdRes.textContent=e+"[BPa]"),await doDialogOK(ll("ERROR"),ll("Parameter Check")+` 'iparam'


${e}
`,null),t=e}return await updateDeviceList(),JD.spinnerClose(),t}function blxParametersCopy(e,t){var n=t?blxDevice.sys_param:blxDevice.iparam;if(!0===e)if(original_par=[],void 0===n)doDialogOK(ll("ERROR")+": Iparam-Check(1)","No Parameters found!",null);else{for(let e=0;e"):i++;var s,d=void 0!==a[i]?a[i]:"(unknown)";let e,t=(d.indexOf("Timestamp.32")&&1e9[${n}+(+${i})] '${a[i]}'
`,o+=t}return o}async function blxEditIparam(){for(blxParametersCopy(!0,0);;){if("OK"!==await editParamDialogDo(0)){blxParCancel(0);break}if(!await blxParSend(0))break}}async function blxEditSysparam(){for(blxParametersCopy(!0,1);;){if("OK"!==await editParamDialogDo(1)){blxParCancel(1);break}if(!await blxParSend(1))break}}function bleCallback(l,a,i){switch(l){case"CON":switch(connectionLevel=a,console.log("CON-Level: "+a),a){case 0:case 1:blxConnectButtonText&&(blxConnectButtonText.textContent=ll("Connect")),blxInfoLine&&(blxInfoLine.textContent=ll("Disconnect")),blxMemory&&(blxMemory.textContent="-"),blxSync&&(blxSync.textContent="-"),blxSignal&&(blxSignal.hidden=!0),blxMeasureData&&(blxMeasureData.innerHTML="-"),sidebuttonBluetooth.querySelector("i").classList.remove("jo-icon-ani-beat"),disabler(!1);break;case 2:lastAdvertisingName=blx.getDevice().advertisingName,blxDeviceName&&(blxDeviceName.textContent=lastAdvertisingName),blxMAC&&(blxMAC.textContent="-"),blxType&&(blxType.textContent="-"),blxFW&&(blxFW.textContent="-"),sidebuttonBluetooth.querySelector("i").classList.add("jo-icon-ani-beat"),blxSignal&&(blxSignal.textContent="... dBm"),blxSignal&&(blxSignal.style.backgroundColor="gray");var o=`${ll("Connecting")} '${lastAdvertisingName}'...`;blxConnectButtonText&&(blxConnectButtonText.textContent=o),blxInfoLine&&(blxInfoLine.textContent=o),blxGraph&&(blxGraph.innerHTML=""),JD.spinnerGetBusy()||JD.spinnerShow("Bluetooth",o,30,!0);break;case 3:JD.spinnerGetBusy()&&JD.spinnerSetInfo(ll("Reading IDs...")),blxInfoLine&&(blxInfoLine.textContent=ll("Reading IDs...")),blxConnectButtonText&&(blxConnectButtonText.textContent=`'${lastAdvertisingName}'`);break;case 4:blxSignal&&(blxSignal.hidden=!1),disabler(!1)}break;case"UPLOAD":uplStatus={totalsize:a,mode:i,sumsize:0,filesize:0,filename:"",fproc:0,ndata:!0};break;case"GET":uplStatus.filesize=a,uplStatus.filename=i,uplStatus.ndata=!0,blxInfoLine&&(blxInfoLine.textContent=ll("File")+`:'${i}' ${a} Byte`);break;case"PROG":uplStatus.fproc=a,uplStatus.ndata=!0;let e,t;t=uplStatus.totalsize?(r=uplStatus.sumsize/uplStatus.totalsize*100,d=uplStatus.filesize/uplStatus.totalsize*uplStatus.fproc,`${e=(r+d).toFixed(0)}% of ${(uplStatus.totalsize/1024).toFixed(0)} kB`):(e=a)+"%",JD.spinnerGetBusy()&&(JD.spinnerSetProgress(e),JD.spinnerSetInfo(t)),blxInfoLine&&(blxInfoLine.textContent=e+"%");break;case"GET_OK":uplStatus.sumsize+=a,uplStatus.ndata=!0,blxInfoLine&&(blxInfoLine.textContent=`OK (${a} ${i} )`);break;case"RSSI":var r=.273*a+28;let n="limegreen";0<=r&&(r<4?n="gray":r<8&&(n="orange")),blxSignal&&(blxSignal.textContent=a+" dBm"),blxSignal&&(blxSignal.style.backgroundColor=n),l=void 0;break;case"VSENS":blxInfoLine&&(blxInfoLine.textContent="VSENS "+i+": "+a),l=void 0;break;case"INFO":blxInfoLine&&(blxInfoLine.textContent=i);break;case"MSG":blxInfoLine&&(blxInfoLine.textContent="MSG "+a+":"+i);break;case"WARN":blxCmdRes&&(blxCmdRes.textContent="WARNING "+a+":"+i);break;case"ERR":blxCmdRes&&(blxCmdRes.textContent="ERROR "+a+":"+i);break;case"BZY":var s=parseInt(i);if(blxInfoLine)switch(a){case 1:blxInfoLine.textContent=2...");break;case"MEAS_V":if("*"==i[0]&&(i=`(${ll("ALARM")}) `+i.substring(1)),90==a&&void 0!==blxDevice.sys_param&&void 0!==blxDevice.sys_param[16]){var r=parseFloat(blxDevice.sys_param[15]),d=parseFloat(blxDevice.sys_param[16]);if(r("+a+") "+i,blxMeasureData&&(blxMeasureData.innerHTML=measureData)}void 0!==l&&console.log("BLX: ",l,a,i)}async function getSetupOptions(){await blStore.get("#blxDash_#SETUP");var e=blStore.result();void 0!==e&&((setupOptions=e.v).dtheme&&JD.dashToggleTheme(),setupOptions.font&&JD.dashSetFont(setupOptions.font/100),setupOptions.lang)&&I18.i18localize(setupOptions.lang)}async function doSetupDialog(){var e=await blStore.quotaget(),e=`
@@ -48,4 +48,4 @@ ${ll("Measure")}...`;break;case"MEAS_T":0'${l.advname}'`,l.synccnt?e+=`▴${l.synccnt}/${a.length}
`:e+=`${a.length}
`):e=`
'${l.advname}' -
`,n+=e}navDevicelist.innerHTML=n;for(let e=0;edeviceDialogDo(e));var e=sidebuttonServersync.querySelector("i").classList,t=sidebuttonServersync.querySelector(".jo-badge-span");r?(e.add("jo-icon-ani-shake"),t.classList.remove("jo-hidden"),t.innerHTML=`▴${r}/`+o):(e.remove("jo-icon-ani-shake"),t.classList.add("jo-hidden"))}async function removeDevice(t){if(16!=t.length)return!1;let n=[];if(await blStore.iterate(function(e){e.k.substr(0,16)===t&&"_"===e.k.charAt(16)&&n.push(e.k)}),!n.length)return!1;for(let e=0;ee.mac==n);if(void 0===a||0==a.pin){let e=!1,t;if(blx.chordsound(750,.2,.2),l[1].startsWith("OT:")?16==(a=l[1].substring(3)).length&&(t=ownertoken2pin(a),e=await addDevice(n,a,void 0)):l[1].startsWith("PIN:")&&6==(t=l[1].substring(4)).length&&(e=await addDevice(n,void 0,t)),!0===e&&n==searchmac)return blxPIN.value=t,await JD.dashSleepMs(500),blxSetPin(),0}else blx.frq_ping(750,.1,.3);return 1}}if(n.startsWith("TXT-")&&":"==n[6]){let e=n.substring(4,6),t=n.substring(7);return blx.terminalPrint(`Text(${e}): '${t}'`),blx.frq_ping(1500,.1,.3),setTimeout(()=>JD.sagmal(t,e.toLowerCase()),300),2}return blx.frq_ping(30,.1,.3),-1}async function bdRunQRscanner(e=""){searchmac=e,QRS.setQrLogPrint(blx.terminalPrint),QRS.setScanCallback(scanFoundAddDevice),QRS.clearScannedResults();e=await QRS.openSelectedCamera();"string"==typeof e?JD.doDialogOK(ll("ERROR"),ll("Reason")+`: '${e}'`,null):await QRS.scannerBusy()}function checkViewportEnablers(){JD.isFullInViewportHeight(sectionMain)?!1!==sectionMainEnabled&&(sectionMainEnabled=!1,sidebuttonMaincontent.classList.add("jo-disabled")):!0!==sectionMainEnabled&&(sectionMainEnabled=!0,sidebuttonMaincontent.classList.remove("jo-disabled")),JD.isFullInViewportHeight(sectionTerminal)?!1!==sectionTerminalEnabled&&(sectionTerminalEnabled=!1,sidebuttonTerminal.classList.add("jo-disabled")):!0!==sectionTerminalEnabled&&(sectionTerminalEnabled=!0,sidebuttonTerminal.classList.remove("jo-disabled"));var e=navigator.onLine;lastOnlineState!==e&&(bdOnline.hidden=!e,bdOffline.hidden=e,(lastOnlineState=e)?sidebuttonServersync.classList.remove("jo-disabled"):sidebuttonServersync.classList.add("jo-disabled"))}function blxtimer1sec(){checkViewportEnablers()}if(window.jdDebug){document.addEventListener("wheel",e=>{var t=getComputedStyle(document.documentElement).getPropertyValue("--fontrel"),e=0{t++,blxDevice={deviceType:1234},disabler(!(connectionLevel=3)),I18.notFound()})}console.log("blxdash.js init, Version:",VERSION);export{VERSION,COPYRIGHT}; \ No newline at end of file +
`,n+=e}navDevicelist.innerHTML=n;for(let e=0;edeviceDialogDo(e));var e=sidebuttonServersync.querySelector("i").classList,t=sidebuttonServersync.querySelector(".jo-badge-span");r?(e.add("jo-icon-ani-shake"),t.classList.remove("jo-hidden"),t.innerHTML=`▴${r}/`+o):(e.remove("jo-icon-ani-shake"),t.classList.add("jo-hidden"))}async function removeDevice(t){if(16!=t.length)return!1;let n=[];if(await blStore.iterate(function(e){e.k.substr(0,16)===t&&"_"===e.k.charAt(16)&&n.push(e.k)}),!n.length)return!1;for(let e=0;ee.mac==n);if(void 0===a||0==a.pin){let e=!1,t;if(blx.chordsound(750,.2,.2),l[1].startsWith("OT:")?16==(a=l[1].substring(3)).length&&(t=ownertoken2pin(a),e=await addDevice(n,a,void 0)):l[1].startsWith("PIN:")&&6==(t=l[1].substring(4)).length&&(e=await addDevice(n,void 0,t)),!0===e&&n==searchmac)return blxPIN.value=t,await JD.dashSleepMs(500),blxSetPin(),0}else blx.frq_ping(750,.1,.3);return 1}}if(n.startsWith("TXT-")&&":"==n[6]){let e=n.substring(4,6),t=n.substring(7);return blx.terminalPrint(`Text(${e}): '${t}'`),blx.frq_ping(1500,.1,.3),setTimeout(()=>JD.sagmal(t,e.toLowerCase()),300),2}return blx.frq_ping(30,.1,.3),-1}async function bdRunQRscanner(e=""){searchmac=e,QRS.setQrLogPrint(blx.terminalPrint),QRS.setScanCallback(scanFoundAddDevice),QRS.clearScannedResults();e=await QRS.openSelectedCamera();"string"==typeof e?JD.doDialogOK(ll("ERROR"),ll("Reason")+`: '${e}'`,null):await QRS.scannerBusy()}function checkViewportEnablers(){JD.isFullInViewportHeight(sectionMain)?!1!==sectionMainEnabled&&(sectionMainEnabled=!1,sidebuttonMaincontent.classList.add("jo-disabled")):!0!==sectionMainEnabled&&(sectionMainEnabled=!0,sidebuttonMaincontent.classList.remove("jo-disabled")),JD.isFullInViewportHeight(sectionTerminal)?!1!==sectionTerminalEnabled&&(sectionTerminalEnabled=!1,sidebuttonTerminal.classList.add("jo-disabled")):!0!==sectionTerminalEnabled&&(sectionTerminalEnabled=!0,sidebuttonTerminal.classList.remove("jo-disabled"));var e=navigator.onLine;lastOnlineState!==e&&(bdOnline.hidden=!e,bdOffline.hidden=e,(lastOnlineState=e)?sidebuttonServersync.classList.remove("jo-disabled"):sidebuttonServersync.classList.add("jo-disabled"))}function blxtimer1sec(){checkViewportEnablers()}if(window.jdDebug){document.addEventListener("wheel",e=>{var t=getComputedStyle(document.documentElement).getPropertyValue("--fontrel"),e=0{t++,JD.joSagmal("Lies dieses Lied Leise Elise","de")})}console.log("blxdash.js init, Version:",VERSION);export{VERSION,COPYRIGHT}; \ No newline at end of file diff --git a/ble_api/js/jodash.js b/ble_api/js/jodash.js index e98b787..847ba24 100644 --- a/ble_api/js/jodash.js +++ b/ble_api/js/jodash.js @@ -1,4 +1,4 @@ -let VERSION="V0.10 / 10.10.2024",COPYRIGHT="(C)JoEmbedded.de";async function dashSleepMs(o=1){return new Promise(e=>setTimeout(e,o))}let sidebarState=0;async function sidebarClick(e=!0){var o=document.querySelector(".jo-sidebar").classList;switch(sidebarState=e?(sidebarState+1)%3:sidebarState){case 0:o.remove("jo-sidebar-hidden"),await dashSleepMs(1),o.remove("jo-sidebar-small");break;default:case 1:o.add("jo-sidebar-small"),o.remove("jo-sidebar-hidden");break;case 2:o.add("jo-sidebar-small"),o.add("jo-sidebar-hidden")}document.querySelector(".jo-main-hambind").style.rotate=["180deg","180deg","0deg","90deg","90deg","0deg"][sidebarState]}function dashSetFont(e){return e<.5?e=.5:2{var o="#"+(16777215^parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).substring(1),16)).toString(16).padStart(6,"0");document.documentElement.style.setProperty(e,o)})}let acx;function joPing(e=1e3,o=.1,n=.1){var t=(acx=acx||new AudioContext).createOscillator(),e=(t.frequency.value=e,acx.createGain());e.gain.value=n,e.gain.exponentialRampToValueAtTime(n/5,acx.currentTime+o),t.connect(e),e.connect(acx.destination),t.type="square",t.start(),t.stop(acx.currentTime+o)}function joPingError(){joPing(30,.3,.15)}let voices=[];async function joSagmal(e,n="en",t=!1){if(void 0!==window.speechSynthesis){t&&window.speechSynthesis.cancel();let o=n.toLowerCase().substring(0,2);for(let e=0;e<100&&(voices=window.speechSynthesis.getVoices(),await dashSleepMs(10),!voices.find(e=>0<=e.lang.indexOf(o)));e++);voices.length&&(t=new SpeechSynthesisUtterance(e),void 0!==(n=voices.find(e=>0<=e.lang.indexOf(o)))&&(t.default=!1,t.voice=n,t.lang=o),window.speechSynthesis.speak(t))}}let okDialog,okDialogHtml=` +let VERSION="V0.10 / 10.10.2024",COPYRIGHT="(C)JoEmbedded.de";async function dashSleepMs(o=1){return new Promise(e=>setTimeout(e,o))}let sidebarState=0;async function sidebarClick(e=!0){var o=document.querySelector(".jo-sidebar").classList;switch(sidebarState=e?(sidebarState+1)%3:sidebarState){case 0:o.remove("jo-sidebar-hidden"),await dashSleepMs(1),o.remove("jo-sidebar-small");break;default:case 1:o.add("jo-sidebar-small"),o.remove("jo-sidebar-hidden");break;case 2:o.add("jo-sidebar-small"),o.add("jo-sidebar-hidden")}document.querySelector(".jo-main-hambind").style.rotate=["180deg","180deg","0deg","90deg","90deg","0deg"][sidebarState]}function dashSetFont(e){return e<.5?e=.5:2{var o="#"+(16777215^parseInt(getComputedStyle(document.documentElement).getPropertyValue(e).substring(1),16)).toString(16).padStart(6,"0");document.documentElement.style.setProperty(e,o)})}let acx;function joPing(e=1e3,o=.1,n=.1){var t=(acx=acx||new AudioContext).createOscillator(),e=(t.frequency.value=e,acx.createGain());e.gain.value=n,e.gain.exponentialRampToValueAtTime(n/5,acx.currentTime+o),t.connect(e),e.connect(acx.destination),t.type="square",t.start(),t.stop(acx.currentTime+o)}function joPingError(){joPing(30,.3,.15)}let voices=[];async function joSagmal(e,n="en",t=!1){if(void 0===window.speechSynthesis)joPingError(),await doDialogOK("ERROR Speech","API not found");else{t&&window.speechSynthesis.cancel();let o=n.toLowerCase().substring(0,2);for(let e=0;e<100&&(voices=window.speechSynthesis.getVoices(),await dashSleepMs(10),!voices.find(e=>0<=e.lang.indexOf(o)));e++);voices.length?(joPing(),t=new SpeechSynthesisUtterance(e),void 0!==(n=voices.find(e=>0<=e.lang.indexOf(o)))&&(t.default=!1,t.voice=n,t.lang=o),e=window.speechSynthesis.speak(t),console.log(e)):(joPingError(),await doDialogOK("ERROR Speech","No voices found"))}}let okDialog,okDialogHtml=`
(Header)
(Content)
diff --git a/ble_api/sw.js b/ble_api/sw.js index 418ec66..330985e 100644 --- a/ble_api/sw.js +++ b/ble_api/sw.js @@ -1,2 +1,2 @@ -if(!self.define){let e,s={};const i=(i,c)=>(i=new URL(i+".js",c).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(c,r)=>{const n=e||("document"in self?document.currentScript.src:"")||location.href;if(s[n])return;let o={};const a=e=>i(e,n),d={module:{uri:n},exports:o,require:a};s[n]=Promise.all(c.map((e=>d[e]||a(e)))).then((e=>(r(...e),o)))}}define(["./workbox-2e7151d3"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"css/jodash.css",revision:"7ba87d02cd05a16dee8e76919a2093b6"},{url:"css/qrscanner.css",revision:"d9afdd33d6a9398cd7289af26f8f7090"},{url:"index.html",revision:"640aeaf754c7625712dee402006f2cb5"},{url:"js/blStore.js",revision:"40ded8652b6dc76b7b88c4610263699d"},{url:"js/blx.js",revision:"4b824126a5440f73e44aa6374bfc5c36"},{url:"js/blxdash.js",revision:"786da91b3b1097eff4cb42ce6d85d5d6"},{url:"js/FileSaver.js",revision:"25561894dca7cb2506d64df529987e62"},{url:"js/intmain_i18n.js",revision:"811f7053b6813787d1cc6ec8cbe1b036"},{url:"js/jodash.js",revision:"c5937e5455db5f7f1ea1612bed454b22"},{url:"js/qrscanner.js",revision:"a143743e6ece343d9c8b3f84cba81c2e"},{url:"manifest.webmanifest",revision:"570178ed3b2209baf62d2a4d02ad42a3"},{url:"static/favicon.ico",revision:"5b48c6125a55da335f09ed8fd555f277"},{url:"static/favicon.svg",revision:"f2cee656f163f4735a2b1a086846f621"},{url:"static/icons/bootstrap-icons.min.css",revision:"5605c44f8b24ea5de37a959955b71eb6"},{url:"static/icons/fonts/bootstrap-icons.woff",revision:"ba49e844892321d8540ea3b7c088cf97"},{url:"static/icons/fonts/bootstrap-icons.woff2",revision:"cc1e5eda776be5f0ff614285c31d4892"},{url:"static/preview1024x768.png",revision:"4606894e6fa5300618b660f2b63ee6d2"},{url:"static/preview512.png",revision:"bce3d7151098b5feddfcac9ba62d3f6a"}],{ignoreURLParametersMatching:[/^utm_/,/^fbclid$/]})})); +if(!self.define){let e,s={};const i=(i,r)=>(i=new URL(i+".js",r).href,s[i]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=i,e.onload=s,document.head.appendChild(e)}else e=i,importScripts(i),s()})).then((()=>{let e=s[i];if(!e)throw new Error(`Module ${i} didn’t register its module`);return e})));self.define=(r,c)=>{const n=e||("document"in self?document.currentScript.src:"")||location.href;if(s[n])return;let o={};const a=e=>i(e,n),d={module:{uri:n},exports:o,require:a};s[n]=Promise.all(r.map((e=>d[e]||a(e)))).then((e=>(c(...e),o)))}}define(["./workbox-2e7151d3"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"css/jodash.css",revision:"7ba87d02cd05a16dee8e76919a2093b6"},{url:"css/qrscanner.css",revision:"d9afdd33d6a9398cd7289af26f8f7090"},{url:"index.html",revision:"640aeaf754c7625712dee402006f2cb5"},{url:"js/blStore.js",revision:"40ded8652b6dc76b7b88c4610263699d"},{url:"js/blx.js",revision:"4b824126a5440f73e44aa6374bfc5c36"},{url:"js/blxdash.js",revision:"2a39579b08aa90d1092bfab8fa70995d"},{url:"js/FileSaver.js",revision:"25561894dca7cb2506d64df529987e62"},{url:"js/intmain_i18n.js",revision:"811f7053b6813787d1cc6ec8cbe1b036"},{url:"js/jodash.js",revision:"e9d3b2eb70cd00e87a625d9ee3f6d363"},{url:"js/qrscanner.js",revision:"a143743e6ece343d9c8b3f84cba81c2e"},{url:"manifest.webmanifest",revision:"570178ed3b2209baf62d2a4d02ad42a3"},{url:"static/favicon.ico",revision:"5b48c6125a55da335f09ed8fd555f277"},{url:"static/favicon.svg",revision:"f2cee656f163f4735a2b1a086846f621"},{url:"static/icons/bootstrap-icons.min.css",revision:"5605c44f8b24ea5de37a959955b71eb6"},{url:"static/icons/fonts/bootstrap-icons.woff",revision:"ba49e844892321d8540ea3b7c088cf97"},{url:"static/icons/fonts/bootstrap-icons.woff2",revision:"cc1e5eda776be5f0ff614285c31d4892"},{url:"static/preview1024x768.png",revision:"4606894e6fa5300618b660f2b63ee6d2"},{url:"static/preview512.png",revision:"bce3d7151098b5feddfcac9ba62d3f6a"}],{ignoreURLParametersMatching:[/^utm_/,/^fbclid$/]})})); //# sourceMappingURL=sw.js.map diff --git a/ble_api/sw.js.map b/ble_api/sw.js.map index b0dff52..8aa3080 100644 --- a/ble_api/sw.js.map +++ b/ble_api/sw.js.map @@ -1 +1 @@ -{"version":3,"file":"sw.js","sources":["../../../Users/jwick/AppData/Local/Temp/6df15eb62f0215bd13bdeb3b5eaba78f/sw.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from 'C:/Users/jwick/AppData/Roaming/npm/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"css/jodash.css\",\n \"revision\": \"7ba87d02cd05a16dee8e76919a2093b6\"\n },\n {\n \"url\": \"css/qrscanner.css\",\n \"revision\": \"d9afdd33d6a9398cd7289af26f8f7090\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"640aeaf754c7625712dee402006f2cb5\"\n },\n {\n \"url\": \"js/blStore.js\",\n \"revision\": \"40ded8652b6dc76b7b88c4610263699d\"\n },\n {\n \"url\": \"js/blx.js\",\n \"revision\": \"4b824126a5440f73e44aa6374bfc5c36\"\n },\n {\n \"url\": \"js/blxdash.js\",\n \"revision\": \"786da91b3b1097eff4cb42ce6d85d5d6\"\n },\n {\n \"url\": \"js/FileSaver.js\",\n \"revision\": \"25561894dca7cb2506d64df529987e62\"\n },\n {\n \"url\": \"js/intmain_i18n.js\",\n \"revision\": \"811f7053b6813787d1cc6ec8cbe1b036\"\n },\n {\n \"url\": \"js/jodash.js\",\n \"revision\": \"c5937e5455db5f7f1ea1612bed454b22\"\n },\n {\n \"url\": \"js/qrscanner.js\",\n \"revision\": \"a143743e6ece343d9c8b3f84cba81c2e\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"570178ed3b2209baf62d2a4d02ad42a3\"\n },\n {\n \"url\": \"static/favicon.ico\",\n \"revision\": \"5b48c6125a55da335f09ed8fd555f277\"\n },\n {\n \"url\": \"static/favicon.svg\",\n \"revision\": \"f2cee656f163f4735a2b1a086846f621\"\n },\n {\n \"url\": \"static/icons/bootstrap-icons.min.css\",\n \"revision\": \"5605c44f8b24ea5de37a959955b71eb6\"\n },\n {\n \"url\": \"static/icons/fonts/bootstrap-icons.woff\",\n \"revision\": \"ba49e844892321d8540ea3b7c088cf97\"\n },\n {\n \"url\": \"static/icons/fonts/bootstrap-icons.woff2\",\n \"revision\": \"cc1e5eda776be5f0ff614285c31d4892\"\n },\n {\n \"url\": \"static/preview1024x768.png\",\n \"revision\": \"4606894e6fa5300618b660f2b63ee6d2\"\n },\n {\n \"url\": \"static/preview512.png\",\n \"revision\": \"bce3d7151098b5feddfcac9ba62d3f6a\"\n }\n], {\n \"ignoreURLParametersMatching\": [/^utm_/, /^fbclid$/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,aACP,IAWFC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,eACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC,QAAS"} \ No newline at end of file +{"version":3,"file":"sw.js","sources":["../../../Users/jwick/AppData/Local/Temp/a1e36d6b1c02d4cc682cbbd020872813/sw.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from 'C:/Users/jwick/AppData/Roaming/npm/node_modules/workbox-cli/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"css/jodash.css\",\n \"revision\": \"7ba87d02cd05a16dee8e76919a2093b6\"\n },\n {\n \"url\": \"css/qrscanner.css\",\n \"revision\": \"d9afdd33d6a9398cd7289af26f8f7090\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"640aeaf754c7625712dee402006f2cb5\"\n },\n {\n \"url\": \"js/blStore.js\",\n \"revision\": \"40ded8652b6dc76b7b88c4610263699d\"\n },\n {\n \"url\": \"js/blx.js\",\n \"revision\": \"4b824126a5440f73e44aa6374bfc5c36\"\n },\n {\n \"url\": \"js/blxdash.js\",\n \"revision\": \"2a39579b08aa90d1092bfab8fa70995d\"\n },\n {\n \"url\": \"js/FileSaver.js\",\n \"revision\": \"25561894dca7cb2506d64df529987e62\"\n },\n {\n \"url\": \"js/intmain_i18n.js\",\n \"revision\": \"811f7053b6813787d1cc6ec8cbe1b036\"\n },\n {\n \"url\": \"js/jodash.js\",\n \"revision\": \"e9d3b2eb70cd00e87a625d9ee3f6d363\"\n },\n {\n \"url\": \"js/qrscanner.js\",\n \"revision\": \"a143743e6ece343d9c8b3f84cba81c2e\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"570178ed3b2209baf62d2a4d02ad42a3\"\n },\n {\n \"url\": \"static/favicon.ico\",\n \"revision\": \"5b48c6125a55da335f09ed8fd555f277\"\n },\n {\n \"url\": \"static/favicon.svg\",\n \"revision\": \"f2cee656f163f4735a2b1a086846f621\"\n },\n {\n \"url\": \"static/icons/bootstrap-icons.min.css\",\n \"revision\": \"5605c44f8b24ea5de37a959955b71eb6\"\n },\n {\n \"url\": \"static/icons/fonts/bootstrap-icons.woff\",\n \"revision\": \"ba49e844892321d8540ea3b7c088cf97\"\n },\n {\n \"url\": \"static/icons/fonts/bootstrap-icons.woff2\",\n \"revision\": \"cc1e5eda776be5f0ff614285c31d4892\"\n },\n {\n \"url\": \"static/preview1024x768.png\",\n \"revision\": \"4606894e6fa5300618b660f2b63ee6d2\"\n },\n {\n \"url\": \"static/preview512.png\",\n \"revision\": \"bce3d7151098b5feddfcac9ba62d3f6a\"\n }\n], {\n \"ignoreURLParametersMatching\": [/^utm_/, /^fbclid$/]\n});\n\n\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","ignoreURLParametersMatching"],"mappings":"0nBAmBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,aACP,IAWFC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,YACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,eACPC,SAAY,oCAEd,CACED,IAAO,kBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,qCAEb,CACDC,4BAA+B,CAAC,QAAS"} \ No newline at end of file