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

qcloud-iotexplorer-appdev-plugin-wificonf-core

Package Overview
Dependencies
Maintainers
2
Versions
206
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 1.0.18-beta-1 to 1.0.18-beta-2

2

lib/utils/connectWifi.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.connectWifi=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),constants_1=require("../constants");exports.connectWifi=function(e,t){var o=t.onProgress;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var t,r;return tslib_1.__generator(this,(function(s){switch(s.label){case 0:t=Date.now(),s.label=1;case 1:return s.trys.push([1,5,,7]),o({code:constants_1.WifiConfStepCode.CONNECT_WIFI_START}),[4,wxApis_1.default.startWifi()];case 2:return s.sent(),[4,wxApis_1.default.connectWifi({SSID:e.SSID,password:e.password})];case 3:return s.sent(),[4,wxApis_1.default.getConnectedWifi()];case 4:if(s.sent().wifi.SSID!==e.SSID)throw{code:"BUSINESS_WIFI_CONNECT_FAIL"};return o({code:constants_1.WifiConfStepCode.CONNECT_WIFI_SUCCESS,detail:{timeCost:Date.now()-t}}),[3,7];case 5:return r=s.sent(),console.error(r),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.confirm('手机连接目标Wi-Fi"'+e.SSID+'"失败,请手动切换后继续配网操作',"",{confirmText:"继续",confirmColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.primary,cancelText:"取消",cancelColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.danger,enforce:!0})];case 6:return s.sent()?(o({code:constants_1.WifiConfStepCode.CONNECT_WIFI_MANUAL,detail:{timeCost:Date.now()-t}}),[3,7]):[2,Promise.reject(tslib_1.__assign(tslib_1.__assign({},r),{code:"CONNECT_WIFI_FAIL"}))];case 7:return[2]}}))}))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.connectWifi=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),constants_1=require("../constants"),util_1=require("./util");exports.connectWifi=function(e,t){var o=t.onProgress;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var t,r,i,s;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:t=Date.now(),r=util_1.checkIsIOS(),i=!r&&util_1.compareVersion(util_1.getWxVersion(),"7.0.22")>=0,n.label=1;case 1:return n.trys.push([1,6,,8]),o({code:constants_1.WifiConfStepCode.CONNECT_WIFI_START}),[4,wxApis_1.default.startWifi()];case 2:return n.sent(),[4,wxApis_1.default.connectWifi({SSID:e.SSID,password:e.password})];case 3:return n.sent(),i?[3,5]:[4,wxApis_1.default.getConnectedWifi()];case 4:if(n.sent().wifi.SSID!==e.SSID)throw{code:"BUSINESS_WIFI_CONNECT_FAIL"};n.label=5;case 5:return o({code:constants_1.WifiConfStepCode.CONNECT_WIFI_SUCCESS,detail:{timeCost:Date.now()-t}}),[3,8];case 6:return s=n.sent(),console.error(s),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.confirm('手机连接目标Wi-Fi"'+e.SSID+'"失败,请手动切换后继续配网操作',"",{confirmText:"继续",confirmColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.primary,cancelText:"取消",cancelColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.danger,enforce:!0})];case 7:return n.sent()?(o({code:constants_1.WifiConfStepCode.CONNECT_WIFI_MANUAL,detail:{timeCost:Date.now()-t}}),[3,8]):[2,Promise.reject(tslib_1.__assign(tslib_1.__assign({},s),{code:"CONNECT_WIFI_FAIL"}))];case 8:return[2]}}))}))};
//# sourceMappingURL=connectWifi.js.map

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.collectModuleLog=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),constants_1=require("../constants"),UdpServer_1=require("./UdpServer"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),MODULE_REPORT_AP_SSID="ESP-LOG-QUERY",MODULE_REPORT_AP_PASSWORD="86013388",MODULE_REPORT_AP_UDP_ADDRESS="192.168.4.1",MODULE_REPORT_AP_UDP_PORT="9876",MODULE_REPORT_AP_TIMEOUT=6e4,MODULE_REPORT_RETRY_TIMES=12,collectModuleLogInternal=function(e){var t=e.reporter,r=e.sdk;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var e,o,_,s,i,n,d,p;return tslib_1.__generator(this,(function(E){switch(E.label){case 0:return E.trys.push([0,,9,11]),[4,wxApis_1.default.getSystemInfo()];case 1:return e=E.sent().platform,o="android"===e,_=Date.now(),t.info(constants_1.WifiConfStepCode.MODULE_REPORT_START),o||qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showLoading("收集日志中"),t.info(constants_1.WifiConfStepCode.MODULE_REPORT_CONNECT_WIFI_START,{urgent:!0}),[4,wxApis_1.default.startWifi()];case 2:return E.sent(),[4,wxApis_1.default.connectWifi({SSID:MODULE_REPORT_AP_SSID,password:MODULE_REPORT_AP_PASSWORD})];case 3:return E.sent(),[4,wxApis_1.default.getConnectedWifi()];case 4:if(E.sent().wifi.SSID!==MODULE_REPORT_AP_SSID)throw{code:"WIFI_RECONNECT_FAIL"};o&&qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showLoading("收集日志中"),t.info(constants_1.WifiConfStepCode.MODULE_REPORT_CONNECT_WIFI_SUCCESS,{timeCost:Date.now()-_,shouldStopTemp:!0}),E.label=5;case 5:return E.trys.push([5,7,,8]),s=new UdpServer_1.UdpServer({address:MODULE_REPORT_AP_UDP_ADDRESS,port:MODULE_REPORT_AP_UDP_PORT,reporter:t,retryTime:MODULE_REPORT_RETRY_TIMES,retryGap:MODULE_REPORT_AP_TIMEOUT/MODULE_REPORT_RETRY_TIMES,messageNoParse:!0,sdk:r}),i=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),n=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),s.onError((function(e){return i.reject({code:"MODULE_REPORT_COMMUNICATE_AP_ERROR",detail:{errMsg:e}})})),s.onProgressError((function(e){return n.reject({code:"MODULE_REPORT_COMMUNICATE_AP_ERROR",detail:e})})),t.info(constants_1.WifiConfStepCode.MODULE_REPORT_COMMUNICATE_AP_START),[4,s.send({cmdType:3})];case 6:return d=E.sent(),t.info(constants_1.WifiConfStepCode.MODULE_REPORT_COMMUNICATE_AP_SUCCESS,{moudleDetail:d,timeCost:Date.now()-_}),[3,8];case 7:return p=E.sent(),t.error("MODULE_REPORT_COMMUNICATE_AP_ERROR",{error:p}),[3,8];case 8:return[3,11];case 9:return qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.hideLoading(),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay(2e3)];case 10:return E.sent(),t.info(constants_1.WifiConfStepCode.MODULE_REPORT_COMMUNICATE_END,{shouldStopTemp:!1}),[7];case 11:return[2]}}))}))};exports.collectModuleLog=function(e){var t=e.reporter,r=e.doCollectModuleLog,o=void 0===r?collectModuleLogInternal:r,_=e.timeout,s=void 0===_?MODULE_REPORT_AP_TIMEOUT:_,i=e.sdk;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var e,r,_;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),setTimeout((function(){e.reject({code:"MODULE_REPORT_TIMEOUT"})}),s),[4,Promise.race([e.promise,o({reporter:t,sdk:i})])];case 1:return n.sent(),qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showModal({title:"上报设备端日志成功",content:"收集成功,已上报给工程师处理",confirmText:"我知道了",showCancel:!1}),[2,!0];case 2:return r=n.sent(),(_=r&&(r.errCode||r.code))&&(_ in constants_1.WifiConfErrorMsg||_ in constants_1.WifiConfErrorMsg)&&(r.uiMsg=constants_1.WifiConfErrorMsg[_]),t.error("MODULE_REPORT_FAIL",{error:r}),qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showModal({title:"上报设备端日志失败",content:r.uiMsg||constants_1.WifiConfErrorMsg.MODULE_REPORT_ERROR,confirmText:"我知道了",showCancel:!1}),[2,!1];case 3:return[2]}}))}))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.collectModuleLog=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),constants_1=require("../constants"),UdpServer_1=require("./UdpServer"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),util_1=require("./util"),MODULE_REPORT_AP_SSID="ESP-LOG-QUERY",MODULE_REPORT_AP_PASSWORD="86013388",MODULE_REPORT_AP_UDP_ADDRESS="192.168.4.1",MODULE_REPORT_AP_UDP_PORT="9876",MODULE_REPORT_AP_TIMEOUT=6e4,MODULE_REPORT_RETRY_TIMES=12,collectModuleLogInternal=function(e){var r=e.reporter,t=e.sdk;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var e,o,_,s,i,n,d;return tslib_1.__generator(this,(function(p){switch(p.label){case 0:return p.trys.push([0,,8,10]),e=Date.now(),r.info(constants_1.WifiConfStepCode.MODULE_REPORT_START),(o=util_1.checkIsAndroid())||qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showLoading("收集日志中"),r.info(constants_1.WifiConfStepCode.MODULE_REPORT_CONNECT_WIFI_START,{urgent:!0}),[4,wxApis_1.default.startWifi()];case 1:return p.sent(),[4,wxApis_1.default.connectWifi({SSID:MODULE_REPORT_AP_SSID,password:MODULE_REPORT_AP_PASSWORD})];case 2:return p.sent(),[4,wxApis_1.default.getConnectedWifi()];case 3:if(p.sent().wifi.SSID!==MODULE_REPORT_AP_SSID)throw{code:"WIFI_RECONNECT_FAIL"};o&&qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showLoading("收集日志中"),r.info(constants_1.WifiConfStepCode.MODULE_REPORT_CONNECT_WIFI_SUCCESS,{timeCost:Date.now()-e,shouldStopTemp:!0}),p.label=4;case 4:return p.trys.push([4,6,,7]),_=new UdpServer_1.UdpServer({address:MODULE_REPORT_AP_UDP_ADDRESS,port:MODULE_REPORT_AP_UDP_PORT,reporter:r,retryTime:MODULE_REPORT_RETRY_TIMES,retryGap:MODULE_REPORT_AP_TIMEOUT/MODULE_REPORT_RETRY_TIMES,messageNoParse:!0,sdk:t}),s=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),i=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),_.onError((function(e){return s.reject({code:"MODULE_REPORT_COMMUNICATE_AP_ERROR",detail:{errMsg:e}})})),_.onProgressError((function(e){return i.reject({code:"MODULE_REPORT_COMMUNICATE_AP_ERROR",detail:e})})),r.info(constants_1.WifiConfStepCode.MODULE_REPORT_COMMUNICATE_AP_START),[4,_.send({cmdType:3})];case 5:return n=p.sent(),r.info(constants_1.WifiConfStepCode.MODULE_REPORT_COMMUNICATE_AP_SUCCESS,{moudleDetail:n,timeCost:Date.now()-e}),[3,7];case 6:return d=p.sent(),r.error("MODULE_REPORT_COMMUNICATE_AP_ERROR",{error:d}),[3,7];case 7:return[3,10];case 8:return qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.hideLoading(),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay(2e3)];case 9:return p.sent(),r.info(constants_1.WifiConfStepCode.MODULE_REPORT_COMMUNICATE_END,{shouldStopTemp:!1}),[7];case 10:return[2]}}))}))};exports.collectModuleLog=function(e){var r=e.reporter,t=e.doCollectModuleLog,o=void 0===t?collectModuleLogInternal:t,_=e.timeout,s=void 0===_?MODULE_REPORT_AP_TIMEOUT:_,i=e.sdk;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var e,t,_;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),e=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.genPromise(),setTimeout((function(){e.reject({code:"MODULE_REPORT_TIMEOUT"})}),s),[4,Promise.race([e.promise,o({reporter:r,sdk:i})])];case 1:return n.sent(),qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showModal({title:"上报设备端日志成功",content:"收集成功,已上报给工程师处理",confirmText:"我知道了",showCancel:!1}),[2,!0];case 2:return t=n.sent(),(_=t&&(t.errCode||t.code))&&(_ in constants_1.WifiConfErrorMsg||_ in constants_1.WifiConfErrorMsg)&&(t.uiMsg=constants_1.WifiConfErrorMsg[_]),r.error("MODULE_REPORT_FAIL",{error:t}),qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showModal({title:"上报设备端日志失败",content:t.uiMsg||constants_1.WifiConfErrorMsg.MODULE_REPORT_ERROR,confirmText:"我知道了",showCancel:!1}),[2,!1];case 3:return[2]}}))}))};
//# sourceMappingURL=moduleLog.js.map

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reconnectWifi=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),constants_1=require("../constants"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay;exports.reconnectWifi=function(e,t){var o=t.onProgress,r=t.ignoreError,s=void 0!==r&&r;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var t,r,i;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:t=Date.now(),n.label=1;case 1:return n.trys.push([1,9,,11]),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_START}),[4,wxApis_1.default.startWifi()];case 2:n.sent(),n.label=3;case 3:return n.trys.push([3,6,,7]),[4,delay(5e3)];case 4:return n.sent(),qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showLoading("WiFi连接中"),[4,wxApis_1.default.connectWifi({SSID:e.SSID,password:e.password})];case 5:return n.sent(),[3,7];case 6:throw r=n.sent(),console.log("connectWifi error",r),r;case 7:return qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.hideLoading(),[4,wxApis_1.default.getConnectedWifi()];case 8:if(n.sent().wifi.SSID!==e.SSID)throw{code:"BUSINESS_WIFI_RECONNECT_FAIL"};return o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-t}}),[3,11];case 9:return i=n.sent(),console.error(i),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.confirm("手机连接目标Wi-Fi“"+e.SSID+"”失败,请手动切换到能够正常访问的网络环境(移动网络或者WI-FI)后继续配网操作","",{confirmText:"继续",confirmColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.primary,cancelText:"取消",cancelColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.danger,enforce:!0})];case 10:return n.sent()||s?(o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{ignoreError:s,timeCost:Date.now()-t}}),[3,11]):[2,Promise.reject(tslib_1.__assign(tslib_1.__assign({},i),{code:"BUSINESS_WIFI_RECONNECT_FAIL"}))];case 11:return[2]}}))}))};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.reconnectWifi=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),wxApis_1=tslib_1.__importDefault(require("./wxApis")),constants_1=require("../constants"),util_1=require("./util"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,onNetworkStatusChange=function(){return new Promise((function(e,t){var o=Date.now();console.log("onNetworkStatusChange",o);var s=setTimeout((function(){wxApis_1.default.offNetworkStatusChange(n),wxApis_1.default.getNetworkType().then((function(s){console.log("getNetworkType",s),"none"===s.networkType?t({code:"BUSINESS_WIFI_RECONNECT_STATE_CHANGE_TIMEOUT"}):e(tslib_1.__assign(tslib_1.__assign({},s),{timeCost:Date.now()-o}))}))}),13e3),n=function(t){var i=t.isConnected;t.networkType;if(console.log("onNetWorkStatusChange",t),i){clearTimeout(s),wxApis_1.default.offNetworkStatusChange(n);var r=5e3-(Date.now()-o);console.log("onNetWorkStatusChange is connected",r),r<=0?e(tslib_1.__assign(tslib_1.__assign({},t),{timeCost:Date.now()-o})):delay(r).then((function(){e(tslib_1.__assign(tslib_1.__assign({},t),{timeCost:Date.now()-o}))}))}};wxApis_1.default.onNetworkStatusChange(n)}))};exports.reconnectWifi=function(e,t){var o=t.onProgress,s=t.ignoreError,n=void 0!==s&&s;return tslib_1.__awaiter(void 0,void 0,void 0,(function(){var t,s,i,r,_,a;return tslib_1.__generator(this,(function(c){switch(c.label){case 0:t=Date.now(),s=util_1.checkIsIOS(),i=!s&&util_1.compareVersion(util_1.getWxVersion(),"7.0.22")>=0,c.label=1;case 1:return c.trys.push([1,10,,12]),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_START}),[4,wxApis_1.default.startWifi()];case 2:c.sent(),c.label=3;case 3:return c.trys.push([3,5,,9]),[4,onNetworkStatusChange()];case 4:return r=c.sent(),o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{connectStatus:r,type:"SOFTAP_RECONNECT_TARGET_WIFI_USE_DEFAULT"}}),[3,9];case 5:return _=c.sent(),console.error(_),s&&qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.showLoading("WiFi连接中"),[4,wxApis_1.default.connectWifi({SSID:e.SSID,password:e.password,maunal:i,fail:function(e){console.error("connectWifi fail",e)},success:function(){console.log("success")},complete:function(e){console.log("connectWifi fail complete",e)}})];case 6:return c.sent(),s&&qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.hideLoading(),i?[3,8]:[4,wxApis_1.default.getConnectedWifi()];case 7:if(c.sent().wifi.SSID!==e.SSID)throw{code:"BUSINESS_WIFI_RECONNECT_FAIL"};c.label=8;case 8:return o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{timeCost:Date.now()-t}}),[3,9];case 9:return[3,12];case 10:return a=c.sent(),console.error(a),[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.tips.confirm("手机连接目标Wi-Fi“"+e.SSID+"”失败,请手动切换到能够正常访问的网络环境(移动网络或者WI-FI)后继续配网操作","",{confirmText:"继续",confirmColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.primary,cancelText:"取消",cancelColor:qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.constants.themeColorMap.danger,enforce:!0})];case 11:return c.sent()||n?(o({code:constants_1.WifiConfStepCode.SOFTAP_RECONNECT_TARGET_WIFI_SUCCESS,detail:{ignoreError:n,timeCost:Date.now()-t}}),[3,12]):[2,Promise.reject(tslib_1.__assign(tslib_1.__assign({},a),{code:"BUSINESS_WIFI_RECONNECT_FAIL"}))];case 12:return[2]}}))}))};
//# sourceMappingURL=reconnectWifi.js.map

@@ -39,1 +39,4 @@ export function compareVersion(_v1: any, _v2: any): 0 | 1 | -1;

export function nullFunction(): void;
export function checkIsAndroid(): boolean;
export function checkIsIOS(): boolean;
export function getWxVersion(): string;

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

"use strict";function compareVersion(r,t){for(var e=r.split("."),n=t.split("."),o=Math.max(e.length,n.length);e.length<o;)e.push("0");for(;n.length<o;)n.push("0");for(var i=0;i<o;i++){var p=parseInt(e[i]),a=parseInt(n[i]);if(p>a)return 1;if(p<a)return-1}return 0}function parseInetAddr(r,t,e){for(var n="",o=0;o<e;o++)n+=String(255&r[t+o]),o!==e-1&&(n+=".");return n}function formatInetAddr(r){void 0===r&&(r="");for(var t=r.split("."),e=new Int8Array(t.length),n=0;n<t.length;n++){var o=parseInt(t[n]);e[n]=o>127?o-256:o}return e}function ip2int(r){var t=formatInetAddr(r);return 16777216*(255&t[0])+65536*(255&t[1])+256*(255&t[2])+(255&t[3])}function int2ip(r){return(r>>24&255)+"."+(r>>16&255)+"."+(r>>8&255)+"."+(255&r)}function intIp2byte(r){var t=[0,0,0,0];return t[0]=r>>24&255|0,t[1]=r>>16&255|0,t[2]=r>>8&255|0,t[3]=255&r|0,t}function arrayFill(r,t){for(var e=0;e<r.length;e++)r[e]=t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.nullFunction=exports.arrayFill=exports.intIp2byte=exports.int2ip=exports.ip2int=exports.formatInetAddr=exports.parseInetAddr=exports.compareVersion=void 0,exports.compareVersion=compareVersion,exports.parseInetAddr=parseInetAddr,exports.formatInetAddr=formatInetAddr,exports.ip2int=ip2int,exports.int2ip=int2ip,exports.intIp2byte=intIp2byte,exports.arrayFill=arrayFill,exports.nullFunction=function(){};
"use strict";function compareVersion(r,t){for(var e=r.split("."),n=t.split("."),o=Math.max(e.length,n.length);e.length<o;)e.push("0");for(;n.length<o;)n.push("0");for(var i=0;i<o;i++){var p=parseInt(e[i]),s=parseInt(n[i]);if(p>s)return 1;if(p<s)return-1}return 0}function parseInetAddr(r,t,e){for(var n="",o=0;o<e;o++)n+=String(255&r[t+o]),o!==e-1&&(n+=".");return n}function formatInetAddr(r){void 0===r&&(r="");for(var t=r.split("."),e=new Int8Array(t.length),n=0;n<t.length;n++){var o=parseInt(t[n]);e[n]=o>127?o-256:o}return e}function ip2int(r){var t=formatInetAddr(r);return 16777216*(255&t[0])+65536*(255&t[1])+256*(255&t[2])+(255&t[3])}function int2ip(r){return(r>>24&255)+"."+(r>>16&255)+"."+(r>>8&255)+"."+(255&r)}function intIp2byte(r){var t=[0,0,0,0];return t[0]=r>>24&255|0,t[1]=r>>16&255|0,t[2]=r>>8&255|0,t[3]=255&r|0,t}function arrayFill(r,t){for(var e=0;e<r.length;e++)r[e]=t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getWxVersion=exports.checkIsIOS=exports.checkIsAndroid=exports.nullFunction=exports.arrayFill=exports.intIp2byte=exports.int2ip=exports.ip2int=exports.formatInetAddr=exports.parseInetAddr=exports.compareVersion=void 0,exports.compareVersion=compareVersion,exports.parseInetAddr=parseInetAddr,exports.formatInetAddr=formatInetAddr,exports.ip2int=ip2int,exports.int2ip=int2ip,exports.intIp2byte=intIp2byte,exports.arrayFill=arrayFill,exports.nullFunction=function(){},exports.checkIsAndroid=function(){return wx.getSystemInfoSync().platform.indexOf("android")>-1},exports.checkIsIOS=function(){return wx.getSystemInfoSync().platform.indexOf("ios")>-1},exports.getWxVersion=function(){return wx.getSystemInfoSync().version};
//# sourceMappingURL=util.js.map

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),pifyApiArr=["startWifi","stopWifi","getConnectedWifi","connectWifi","getSystemInfo"],callbackApiArr=["onGetWifiList"],wxApis={};pifyApiArr.forEach((function(i){wxApis[i]=function(e){return qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.pify(wx[i])(e)}})),callbackApiArr.forEach((function(i){wxApis[i]=function(e){return wx[i](e)}})),exports.default=wxApis;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),pifyApiArr=["startWifi","stopWifi","getSystemInfo","getConnectedWifi","connectWifi","getNetworkType"],callbackApiArr=["onGetWifiList","onNetworkStatusChange","offNetworkStatusChange"],wxApis={};pifyApiArr.forEach((function(e){wxApis[e]=function(t){return qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.pify(wx[e])(t)}})),callbackApiArr.forEach((function(e){wxApis[e]=function(t){return wx[e](t)}})),exports.default=wxApis;
//# sourceMappingURL=index.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-core",
"version": "1.0.18-beta-1",
"version": "1.0.18-beta-2",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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