Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

qcloud-iotexplorer-appdev-plugin-wificonf-smartconfig

Package Overview
Dependencies
Maintainers
4
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qcloud-iotexplorer-appdev-plugin-wificonf-smartconfig - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

2

lib/esptouch/esptouch/SmartConfig.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SmartConfig=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),esptouchTaskParameter_1=require("../base/esptouchTaskParameter"),EsptouchGenerator_1=require("../protocol/EsptouchGenerator"),UDPSocketClient=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.UDPSocketClient,UDPSocketServer=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.UDPSocketServer,parseInetAddr=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.parseInetAddr,byteUtil=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.byteUtil,SmartConfig=function(e){function t(t,r,s,i,o,a){var n=e.call(this)||this;return n.TAG="SmartConfig",n.ONE_DATA_LEN=3,n.mIsSuc=!1,n.mIsInterrupt=!1,n.mIsExecuted=!1,n.mEncryptor=a,n.mApSsid=t.getData(),n.mApPassword=s.getData(),n.mApBssid=r.getData(),n.mIsCancelled=!1,n.mParameter=esptouchTaskParameter_1.esptouchTaskParameter,n.mSocketClient=new UDPSocketClient(n.mParameter.getPortListening()),n.mSocketServer=new UDPSocketServer(n.mSocketClient.mSocket,n.mParameter.getWaitUdpTotalMillisecond(),n.mParameter.getEsptouchResultTotalLen()),n.mSocketClient.on("udpSocketError",(function(e){var t=e.errMsg;n.emit("onError",{code:"UDP_ERROR",errMsg:t}),n.interrupt()})),n.mEsptouchResultList=[],n.mBssidTaskSucCountMap={},n.mLocalIp=i,n.logger=o,n.logger.info("Welcome Esptouch smartconfig in weapp"),n}return tslib_1.__extends(t,e),t.prototype.__checkTaskValid=function(){return this.mIsExecuted?(this.logger.error({msg:"the Esptouch task could be executed only once"}),!1):(this.mIsExecuted=!0,!0)},t.prototype.start=function(e){return void 0===e&&(e=1),tslib_1.__awaiter(this,void 0,void 0,(function(){var t,r;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:if(!this.__checkTaskValid())return[2];this.mParameter.setExpectTaskResultCount(e),this.logger.info("start smartconfig in promise settimeout"),t=new EsptouchGenerator_1.EsptouchGenerator(this.mApSsid,this.mApBssid,this.mApPassword,this.mLocalIp,this.mEncryptor),this.mSocketServer.startServer(),this.__listenAsyn(this.mParameter.getEsptouchResultTotalLen()),!1,r=0,s.label=1;case 1:return r<this.mParameter.getTotalRepeatTime()?[4,this.__execute(t)]:[3,4];case 2:if(s.sent())return[2,this.__getEsptouchResultList()];s.label=3;case 3:return r++,[3,1];case 4:return this.mIsInterrupt?[3,6]:[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay(this.mParameter.getWaitUdpReceivingMillisecond())];case 5:s.sent(),this.mIsSuc||this.emit("onError",{code:"PROTOCOL_TIMEOUT"}),this.interrupt(),s.label=6;case 6:return[2,this.__getEsptouchResultList()]}}))}))},t.prototype.startInNoPromise=function(e){var t=this;if(void 0===e&&(e=1),this.__checkTaskValid()){this.mParameter.setExpectTaskResultCount(e),this.logger.info("start smartconfig in no promise settimeout");var r=new EsptouchGenerator_1.EsptouchGenerator(this.mApSsid,this.mApBssid,this.mApPassword,this.mLocalIp,this.mEncryptor);this.mSocketServer.startServer(),this.__listenAsyn(this.mParameter.getEsptouchResultTotalLen()),this.__executeInNoPromise(r),setTimeout((function(){t.mIsSuc||t.emit("onError",{code:"PROTOCOL_TIMEOUT"}),t.emit("result",t.__getEsptouchResultList()),t.interrupt()}),this.mParameter.getWaitUdpTotalMillisecond())}},t.prototype.__executeInNoPromise=function(e){var t=this,r=Date.now(),s=r-this.mParameter.getTimeoutTotalCodeMillisecond(),i=0,o=e.getGCBytes2(),a=e.getDCBytes2(),n=function(){if(!t.mIsInterrupt&&Date.now()-r<t.mParameter.getTimeoutGuideCodeMillisecond())return t.mSocketClient.sendDataSideBySide(o,0,o.length,t.mParameter.getTargetHostname(),t.mParameter.getTargetPort(),t.mParameter.getIntervalGuideCodeMillisecond(),n);u()},u=function(){t.mIsInterrupt?t.emit("result",t.__getEsptouchResultList()):(r-s>=t.mParameter.getTimeoutDataCodeMillisecond()?(t.logger.info("send gc code "),n(),s=r):(t.mSocketClient.sendDataSideBySide(a,i,t.ONE_DATA_LEN,t.mParameter.getTargetHostname(),t.mParameter.getTargetPort(),t.mParameter.getIntervalDataCodeMillisecond(),u),i=(i+t.ONE_DATA_LEN)%a.length),r=Date.now())};u(),setTimeout((function(){t.interrupt()}),this.mParameter.getWaitUdpSendingMillisecond())},t.prototype.__execute=function(e){return tslib_1.__awaiter(this,void 0,void 0,(function(){var t,r,s,i,o,a;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:t=Date.now(),s=(r=t)-this.mParameter.getTimeoutTotalCodeMillisecond(),i=e.getGCBytes2(),o=e.getDCBytes2(),a=0,n.label=1;case 1:if(this.mIsInterrupt)return[3,8];if(!(r-s>=this.mParameter.getTimeoutDataCodeMillisecond()))return[3,5];this.logger.info("send gc code "),n.label=2;case 2:return!this.mIsInterrupt&&Date.now()-r<this.mParameter.getTimeoutGuideCodeMillisecond()?[4,this.mSocketClient.sendData(i,0,i.length,this.mParameter.getTargetHostname(),this.mParameter.getTargetPort(),this.mParameter.getIntervalGuideCodeMillisecond())]:[3,4];case 3:return n.sent(),Date.now()-t>this.mParameter.getWaitUdpSendingMillisecond()?[3,4]:[3,2];case 4:return s=r,[3,7];case 5:return[4,this.mSocketClient.sendData(o,a,this.ONE_DATA_LEN,this.mParameter.getTargetHostname(),this.mParameter.getTargetPort(),this.mParameter.getIntervalDataCodeMillisecond())];case 6:n.sent(),a=(a+this.ONE_DATA_LEN)%o.length,n.label=7;case 7:return(r=Date.now())-t>this.mParameter.getWaitUdpSendingMillisecond()?[3,8]:[3,1];case 8:return[2,this.mIsSuc]}}))}))},t.prototype.__listenAsyn=function(){var e=this;this.logger.info("__listenAsyn() start");var t=this.mApSsid,r=this.mApPassword,s=Date.now(),i=byteUtil.convertUint8toByte(t.length+r.length+9);this.logger.info("expectOneByte: "+i);this.mSocketServer.on("recieveCorrectMsg",(function(t){e.mIsInterrupt||(e.logger.info("RECIEVE_MSG",t),function(t){var r=t.message,o=t.remoteInfo,a=-1,n=new Int8Array(r);if(e.logger.info("Int8Array",{data:n}),a=null!=n?n[0]:-1,e.logger.info("receiveOneByte: "+a),a===i){e.logger.info("receive correct broadcast");var u=Date.now()-s,c=Number(e.mParameter.getWaitUdpTotalMillisecond()-u);if(c<0)e.logger.error({msg:"esptouch receive timeout"});else if(e.logger.info("mSocketServer's new timeout is "+c+" milliseconds"),e.logger.info("receive correct broadcast"),null!=n){var l=byteUtil.parseBssid(n,e.mParameter.getEsptouchResultOneLen(),e.mParameter.getEsptouchResultMacLen()),m=parseInetAddr(n,e.mParameter.getEsptouchResultOneLen()+e.mParameter.getEsptouchResultMacLen(),e.mParameter.getEsptouchResultIpLen());e.__putEsptouchResult(!0,l,m,o)}}else e.logger.info("receive rubbish message, just ignore")}(t),e.mIsSuc=e.mEsptouchResultList.length>=e.mParameter.getExpectTaskResultCount(),e.mIsSuc&&(e.logger.info("__listenAsyn() finish"),e.interrupt()))}))},t.prototype.__putEsptouchResult=function(e,t,r,s){var i=this.mBssidTaskSucCountMap[t];if(null==i&&(i=0),++i,this.logger.info("PUT_ESPTOUCH_RESULT:__putEsptouchResult(): count = "+i),this.mBssidTaskSucCountMap[t]=i,i>=this.mParameter.getThresholdSucBroadcastCount()){for(var o=!1,a=0;a<this.mEsptouchResultList.length;a++)if(this.mEsptouchResultList[a].bssid===t){o=!0;break}if(!o){this.logger.info("PUT_ESPTOUCH_RESULT:put one more result bssid = "+t+",\n address = "+r+",\n the remoteInfo from weapp"+JSON.stringify(s)+"\n ");var n={isSuc:e,bssid:t,inetAddress:r,remoteInfo:s};this.mEsptouchResultList.push(n)}}else this.logger.info("PUT_ESPTOUCH_RESULT:__putEsptouchResult(): count = "+i+", isn't enough")},t.prototype.__getEsptouchResultList=function(){return this.logger.info("GET_RESULT",{data:this.mEsptouchResultList}),this.mEsptouchResultList},t.prototype.interrupt=function(){return tslib_1.__awaiter(this,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){return this.mIsInterrupt||(this.mIsCancelled=!0,this.mIsInterrupt=!0,this.mSocketClient.interrupt(),delete this.mSocketClient),[2]}))}))},t.prototype.isCancelled=function(){return this.mIsCancelled},t.prototype.setPackageBroadcast=function(e){this.mParameter.setBroadcast(e)},t}(qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.EventEmitter);exports.SmartConfig=SmartConfig;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SmartConfig=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),esptouchTaskParameter_1=require("../base/esptouchTaskParameter"),EsptouchGenerator_1=require("../protocol/EsptouchGenerator"),UDPSocketClient=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.UDPSocketClient,UDPSocketServer=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.UDPSocketServer,parseInetAddr=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.utils.parseInetAddr,byteUtil=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.byteUtil,SmartConfig=function(e){function t(t,r,s,i,o,a){var n=e.call(this)||this;return n.TAG="SmartConfig",n.ONE_DATA_LEN=3,n.mIsSuc=!1,n.mIsInterrupt=!1,n.mIsExecuted=!1,n.mEncryptor=a,n.mApSsid=t.getData(),n.mApPassword=s.getData(),n.mApBssid=r.getData(),n.mIsCancelled=!1,n.mParameter=esptouchTaskParameter_1.esptouchTaskParameter,n.mSocketClient=new UDPSocketClient(n.mParameter.getPortListening()),n.mSocketServer=new UDPSocketServer(n.mSocketClient.mSocket,n.mParameter.getWaitUdpTotalMillisecond(),n.mParameter.getEsptouchResultTotalLen()),n.mSocketClient.on("udpSocketError",(function(e){var t=e.errMsg;n.emit("onError",{code:"UDP_ERROR",errMsg:t}),n.interrupt()})),n.mEsptouchResultList=[],n.mBssidTaskSucCountMap={},n.mLocalIp=i,n.logger=o,n.logger.info("Welcome Esptouch smartconfig in weapp"),n}return tslib_1.__extends(t,e),t.prototype.__checkTaskValid=function(){return this.mIsExecuted?(this.logger.error({msg:"the Esptouch task could be executed only once"}),!1):(this.mIsExecuted=!0,!0)},t.prototype.start=function(e){return void 0===e&&(e=1),tslib_1.__awaiter(this,void 0,void 0,(function(){var t,r;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:if(!this.__checkTaskValid())return[2];this.mParameter.setExpectTaskResultCount(e),this.logger.info("start smartconfig in promise settimeout"),t=new EsptouchGenerator_1.EsptouchGenerator(this.mApSsid,this.mApBssid,this.mApPassword,this.mLocalIp,this.mEncryptor),this.mSocketServer.startServer(),this.__listenAsyn(this.mParameter.getEsptouchResultTotalLen()),!1,r=0,s.label=1;case 1:return r<this.mParameter.getTotalRepeatTime()?[4,this.__execute(t)]:[3,4];case 2:if(s.sent())return[2,this.__getEsptouchResultList()];s.label=3;case 3:return r++,[3,1];case 4:return this.mIsInterrupt?[3,6]:[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay(this.mParameter.getWaitUdpReceivingMillisecond())];case 5:s.sent(),this.mIsSuc||this.emit("onError",{code:"PROTOCOL_TIMEOUT"}),this.interrupt(),s.label=6;case 6:return[2,this.__getEsptouchResultList()]}}))}))},t.prototype.startInNoPromise=function(e){var t=this;if(void 0===e&&(e=1),this.__checkTaskValid()){this.mParameter.setExpectTaskResultCount(e),this.logger.info("start smartconfig in no promise settimeout");var r=new EsptouchGenerator_1.EsptouchGenerator(this.mApSsid,this.mApBssid,this.mApPassword,this.mLocalIp,this.mEncryptor);this.mSocketServer.startServer(),this.__listenAsyn(this.mParameter.getEsptouchResultTotalLen()),this.__executeInNoPromise(r),setTimeout((function(){t.mIsSuc||t.emit("onError",{code:"PROTOCOL_TIMEOUT"}),t.emit("result",t.__getEsptouchResultList()),t.interrupt()}),this.mParameter.getWaitUdpTotalMillisecond())}},t.prototype.__executeInNoPromise=function(e){var t=this,r=Date.now(),s=r-this.mParameter.getTimeoutTotalCodeMillisecond(),i=0,o=e.getGCBytes2(),a=e.getDCBytes2(),n=function(){if(!t.mIsInterrupt&&Date.now()-r<t.mParameter.getTimeoutGuideCodeMillisecond())return t.mSocketClient.sendDataSideBySide(o,0,o.length,t.mParameter.getTargetHostname(),t.mParameter.getTargetPort(),t.mParameter.getIntervalGuideCodeMillisecond(),n);u()},u=function(){t.mIsInterrupt?t.emit("result",t.__getEsptouchResultList()):(r-s>=t.mParameter.getTimeoutDataCodeMillisecond()?(t.logger.info("send gc code "),n(),s=r):(t.mSocketClient.sendDataSideBySide(a,i,t.ONE_DATA_LEN,t.mParameter.getTargetHostname(),t.mParameter.getTargetPort(),t.mParameter.getIntervalDataCodeMillisecond(),u),i=(i+t.ONE_DATA_LEN)%a.length),r=Date.now())};u(),setTimeout((function(){t.interrupt()}),this.mParameter.getWaitUdpSendingMillisecond())},t.prototype.__execute=function(e){return tslib_1.__awaiter(this,void 0,void 0,(function(){var t,r,s,i,o,a;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:t=Date.now(),s=(r=t)-this.mParameter.getTimeoutTotalCodeMillisecond(),i=e.getGCBytes2(),o=e.getDCBytes2(),a=0,n.label=1;case 1:if(this.mIsInterrupt)return[3,8];if(!(r-s>=this.mParameter.getTimeoutDataCodeMillisecond()))return[3,5];this.logger.info("send gc code "),n.label=2;case 2:return!this.mIsInterrupt&&Date.now()-r<this.mParameter.getTimeoutGuideCodeMillisecond()?[4,this.mSocketClient.sendData(i,0,i.length,this.mParameter.getTargetHostname(),this.mParameter.getTargetPort(),this.mParameter.getIntervalGuideCodeMillisecond())]:[3,4];case 3:return n.sent(),Date.now()-t>this.mParameter.getWaitUdpSendingMillisecond()?[3,4]:[3,2];case 4:return s=r,[3,7];case 5:return[4,this.mSocketClient.sendData(o,a,this.ONE_DATA_LEN,this.mParameter.getTargetHostname(),this.mParameter.getTargetPort(),this.mParameter.getIntervalDataCodeMillisecond())];case 6:n.sent(),a=(a+this.ONE_DATA_LEN)%o.length,n.label=7;case 7:return(r=Date.now())-t>this.mParameter.getWaitUdpSendingMillisecond()?[3,8]:[3,1];case 8:return[2,this.mIsSuc]}}))}))},t.prototype.__listenAsyn=function(){var e=this;this.logger.info("__listenAsyn() start");var t=this.mApSsid,r=this.mApPassword,s=Date.now(),i=byteUtil.convertUint8toByte(t.length+r.length+9);this.logger.info("expectOneByte: "+i);this.mSocketServer.on("recieveCorrectMsg",(function(t){e.mIsInterrupt||(e.logger.info("RECIEVE_MSG",t),function(t){var r=t.message,o=t.remoteInfo,a=-1,n=new Int8Array(r);if(e.logger.info("Int8Array",{data:n}),a=null!==n?tslib_1.__read(n,1)[0]:-1,e.logger.info("receiveOneByte: "+a),a===i){e.logger.info("receive correct broadcast");var u=Date.now()-s,l=Number(e.mParameter.getWaitUdpTotalMillisecond()-u);if(l<0)e.logger.error({msg:"esptouch receive timeout"});else if(e.logger.info("mSocketServer's new timeout is "+l+" milliseconds"),e.logger.info("receive correct broadcast"),null!==n){var c=byteUtil.parseBssid(n,e.mParameter.getEsptouchResultOneLen(),e.mParameter.getEsptouchResultMacLen()),m=parseInetAddr(n,e.mParameter.getEsptouchResultOneLen()+e.mParameter.getEsptouchResultMacLen(),e.mParameter.getEsptouchResultIpLen());e.__putEsptouchResult(!0,c,m,o)}}else e.logger.info("receive rubbish message, just ignore")}(t),e.mIsSuc=e.mEsptouchResultList.length>=e.mParameter.getExpectTaskResultCount(),e.mIsSuc&&(e.logger.info("__listenAsyn() finish"),e.interrupt()))}))},t.prototype.__putEsptouchResult=function(e,t,r,s){var i=this.mBssidTaskSucCountMap[t];if(null===i&&(i=0),++i,this.logger.info("PUT_ESPTOUCH_RESULT:__putEsptouchResult(): count = "+i),this.mBssidTaskSucCountMap[t]=i,i>=this.mParameter.getThresholdSucBroadcastCount()){for(var o=!1,a=0;a<this.mEsptouchResultList.length;a++)if(this.mEsptouchResultList[a].bssid===t){o=!0;break}if(!o){this.logger.info("PUT_ESPTOUCH_RESULT:put one more result bssid = "+t+",\n address = "+r+",\n the remoteInfo from weapp"+JSON.stringify(s)+"\n ");var n={isSuc:e,bssid:t,inetAddress:r,remoteInfo:s};this.mEsptouchResultList.push(n)}}else this.logger.info("PUT_ESPTOUCH_RESULT:__putEsptouchResult(): count = "+i+", isn't enough")},t.prototype.__getEsptouchResultList=function(){return this.logger.info("GET_RESULT",{data:this.mEsptouchResultList}),this.mEsptouchResultList},t.prototype.interrupt=function(){return tslib_1.__awaiter(this,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){return this.mIsInterrupt||(this.mIsCancelled=!0,this.mIsInterrupt=!0,this.mSocketClient.interrupt(),delete this.mSocketClient),[2]}))}))},t.prototype.isCancelled=function(){return this.mIsCancelled},t.prototype.setPackageBroadcast=function(e){this.mParameter.setBroadcast(e)},t}(qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.EventEmitter);exports.SmartConfig=SmartConfig;
//# sourceMappingURL=SmartConfig.js.map

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=require("tslib"),esptouch_1=require("./esptouch"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,WifiConfStepDesp=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepDesp,SmartConfigWifiConf=function(o){function e(){return null!==o&&o.apply(this,arguments)||this}return tslib_1.__extends(e,o),e.prototype.doProtocol=function(o){return tslib_1.__awaiter(this,void 0,void 0,(function(){var e,i;return tslib_1.__generator(this,(function(t){switch(t.label){case 0:return e=this,[4,new esptouch_1.EsptouchTask({apSsid:o.SSID,apBssid:o.BSSID,apPassword:o.password,logger:{info:function(o,i){void 0===i&&(i={}),e.onProgress({code:WifiConfStepCode.PROTOCOL_DETAIL,detail:{message:WifiConfStepCode.PROTOCOL_DETAIL+"("+WifiConfStepDesp[WifiConfStepCode.PROTOCOL_DETAIL]+": "+o+")",data:i}})},error:function(o){void 0===o&&(o={}),e.onError({code:"PROTOCOL_FAIL",detail:{error:o}})}}}).start()];case 1:return i=t.sent(),[2,{address:i&&i.length&&i[i.length-1]&&i[i.length-1].remoteInfo.address}]}}))}))},e}(qcloud_iotexplorer_appdev_plugin_wificonf_core_1.WifiConfProtocolBase),Plugin=function(){function o(){}return o.install=function(o){o.plugins.wifiConfSmartConfig={start:function(e){return new SmartConfigWifiConf(o,tslib_1.__assign({wifiConfType:"SmartConfig"},e)).start()}}},o}();exports.default=Plugin;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=require("tslib"),esptouch_1=require("./esptouch"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,WifiConfStepDesp=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepDesp,SmartConfigWifiConf=function(o){function e(){return null!==o&&o.apply(this,arguments)||this}return tslib_1.__extends(e,o),e.prototype.doProtocol=function(o){return tslib_1.__awaiter(this,void 0,void 0,(function(){var e,i=this;return tslib_1.__generator(this,(function(t){switch(t.label){case 0:return[4,new esptouch_1.EsptouchTask({apSsid:o.SSID,apBssid:o.BSSID,apPassword:o.password,logger:{info:function(o,e){void 0===e&&(e={}),i.onProgress({code:WifiConfStepCode.PROTOCOL_DETAIL,detail:{message:WifiConfStepCode.PROTOCOL_DETAIL+"("+WifiConfStepDesp[WifiConfStepCode.PROTOCOL_DETAIL]+": "+o+")",data:e}})},error:function(o){void 0===o&&(o={}),i.onError({code:"PROTOCOL_FAIL",detail:{error:o}})}}}).start()];case 1:return e=t.sent(),[2,{address:e&&e.length&&e[e.length-1]&&e[e.length-1].remoteInfo.address}]}}))}))},e}(qcloud_iotexplorer_appdev_plugin_wificonf_core_1.WifiConfProtocolBase),Plugin=function(){function o(){}return o.install=function(o){o.plugins.wifiConfSmartConfig={start:function(e){return new SmartConfigWifiConf(o,tslib_1.__assign({wifiConfType:"SmartConfig"},e)).start()}}},o}();exports.default=Plugin;
//# sourceMappingURL=index.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-smartconfig",
"version": "1.1.3",
"version": "1.1.4",
"description": "",

@@ -17,7 +17,7 @@ "main": "lib/index.js",

"dependencies": {
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.3",
"qcloud-iotexplorer-appdev-sdk": "^1.1.2",
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.4",
"qcloud-iotexplorer-appdev-sdk": "^1.1.4",
"tslib": "^2.0.1"
},
"gitHead": "f3a6689da776702b7454b16d6685e4efed7f982d"
"gitHead": "dda08a8e50ac6c242b2d3f720059e669c234d854"
}

@@ -19,7 +19,7 @@ # qcloud-iotexplorer-appdev-plugin-wificonf-smartconfig

> step1.向sdk里面注册smartconfig插件,sdk的初始化方式,请点击[qcloud-iotexplorer-appdev-sdk](https://www.npmjs.com/package/qcloud-iotexplorer-appdev-sdk),这里不赘述了
> step1.向sdk里面注册smartconfig插件,sdk的初始化方式,请参考[qcloud-iotexplorer-appdev-sdk](https://www.npmjs.com/package/qcloud-iotexplorer-appdev-sdk)
```
import SmartConfigPlug from 'qcloud-iotexplorer-appdev-plugin-wificonf-smartconfig';
SmartConfigPlug.install(sdk);
sdk.usePlugin(SmartConfigPlug);

@@ -96,2 +96,2 @@ ```

}
```
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc