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.6 to 1.0.7

2

lib/constants/errors.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConnectLogWifiError=exports.WifiConnectErrorMsg=exports.WifiConfErrorMsg=void 0;var tslib_1=require("tslib"),wxlib=tslib_1.__importStar(require("@wxlib")),isIOS=wxlib.system.isIOS();exports.WifiConfErrorMsg={UDP_ERROR:"发送配网消息失败,请重启微信APP后重试配网",UDP_CLOSED:"设备连接中断,请检查设备配网状态后重试",UDP_SEND_MSG_FAIL:"设备连接失败,请检查设备配网状态后重试",UDP_NOT_RESPONSE:"设备未响应,请检查设备和网络后重试",WIFI_CONF_FAIL:"配网失败,请检查设备和网络后重试",PROTOCOL_FAIL:"配网失败,请检查设备和网络后重试",PROTOCOL_TIMEOUT:"配网超时,请检查设备和网络后重试",PROTOCOL_INVALID_RESPONSE:"无效响应,请检查设备和网络后重试",BUSINESS_DEVICE_ERROR:"设备连接中断,请检查设备配网状态后重试",BUSINESS_INVALID_RESPONSE:"设备响应错误,请检查设备和网络后重试",BUSINESS_DEVICE_CONNECT_MQTT_FAIL:"设备连接云端失败,请检查网络后重试",BUSINESS_DEVICE_CONNECT_WIFI_FAIL:"设备连接网络失败,请检查WiFi密码后重试",BUSINESS_ADD_DEVICE_FAIL:"添加设备失败",BUSINESS_QUERY_BIND_TOKEN_TIMEOUT:"设备连接云端超时,请检查WiFi密码后重试",BUSINESS_QUERY_BIND_TOKEN_FAIL:"查询设备连接云端状态失败,请检查网络后重试",BUSINESS_WIFI_RECONNECT_FAIL:"小程序重新连接目标WI-FI失败,重试时请弹窗提示失败后手动切换再按确定",MODULE_REPORT_CONNECT_WIFI_ERROR:"连接设备失败,请检查设备电源和信号后重试",MODULE_REPORT_COMMUNICATE_AP_ERROR:"与设备通信失败,请检查设备电源和信号后重试",MODULE_REPORT_ERROR:"收集设备日志失败,请检查设备电源和信号后重试",MODULE_REPORT_TIMEOUT:"收集设备日志超时,请检查设备电源和信号后重试"},exports.WifiConnectErrorMsg={12e3:"WiFi模块初始化失败,请重启微信后重试",12001:"您的设备或系统不支持进行WiFi连接",12002:"请检查您的WiFi密码是否正确",12003:"连接WiFi热点超时,请重新连接",12004:"重复连接 Wi-Fi",12005:"配网操作需打开WiFi开关,请打开后重试",12006:"配网操作需打开GPS定位开关,请打开后重试",12007:isIOS?"WiFi连接操作被拒绝,请重试并在弹出的提示框中点击“加入”":"WiFi连接操作被拒绝,请重试并在弹出的提示框中点击允许连接WiFi",12008:"请确认连接的WiFi热点是否正确",12009:"配置WiFi连接失败,请尝试其他WiFi热点",12011:"配置WiFi连接失败,请重试",12013:"系统保存的WiFi配置过期,请在系统设置中忘记该WiFi后重试",NO_WIFI_IS_CONNECTED:"请检查WiFi信号和密码后重试",SSID_MISMATCH:"请检查WiFi信号和密码后重试",IOS_REFRESH_TIMEOUT:"获取WiFi列表超时,请重试",DEFAULT:"请检查WiFi开关是否打开后重试"},exports.ConnectLogWifiError=Object.assign({12002:"连接设备失败",12003:"连接设备超时,请检查设备电源和信号后重试",12005:"收集设备日志需打开WiFi开关,请打开后重试",12006:"收集设备日志需打开GPS定位开关,请打开后重试",12009:"连接设备失败",12011:"连接设备失败,请重试",NO_WIFI_IS_CONNECTED:"连接设备失败,请检查设备电源和信号后重试",RECONNECT_WIFI_FAIL:"连接设备失败,请检查设备电源和信号后重试",DEFAULT:"连接设备失败,请检查设备电源和信号后重试"},exports.WifiConnectErrorMsg);
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ConnectLogWifiError=exports.WifiConnectErrorMsg=exports.WifiConfErrorMsg=void 0;var isIOS="ios"===wx.getSystemInfoSync().platform;exports.WifiConfErrorMsg={UDP_ERROR:"发送配网消息失败,请重启微信APP后重试配网",UDP_CLOSED:"设备连接中断,请检查设备配网状态后重试",UDP_SEND_MSG_FAIL:"设备连接失败,请检查设备配网状态后重试",UDP_NOT_RESPONSE:"设备未响应,请检查设备和网络后重试",WIFI_CONF_FAIL:"配网失败,请检查设备和网络后重试",PROTOCOL_FAIL:"配网失败,请检查设备和网络后重试",PROTOCOL_TIMEOUT:"配网超时,请检查设备和网络后重试",PROTOCOL_INVALID_RESPONSE:"无效响应,请检查设备和网络后重试",BUSINESS_DEVICE_ERROR:"设备连接中断,请检查设备配网状态后重试",BUSINESS_INVALID_RESPONSE:"设备响应错误,请检查设备和网络后重试",BUSINESS_DEVICE_CONNECT_MQTT_FAIL:"设备连接云端失败,请检查网络后重试",BUSINESS_DEVICE_CONNECT_WIFI_FAIL:"设备连接网络失败,请检查WiFi密码后重试",BUSINESS_ADD_DEVICE_FAIL:"添加设备失败",BUSINESS_QUERY_BIND_TOKEN_TIMEOUT:"设备连接云端超时,请检查WiFi密码后重试",BUSINESS_QUERY_BIND_TOKEN_FAIL:"查询设备连接云端状态失败,请检查网络后重试",BUSINESS_WIFI_RECONNECT_FAIL:"小程序重新连接目标WI-FI失败,重试时请弹窗提示失败后手动切换再按确定",MODULE_REPORT_CONNECT_WIFI_ERROR:"连接设备失败,请检查设备电源和信号后重试",MODULE_REPORT_COMMUNICATE_AP_ERROR:"与设备通信失败,请检查设备电源和信号后重试",MODULE_REPORT_ERROR:"收集设备日志失败,请检查设备电源和信号后重试",MODULE_REPORT_TIMEOUT:"收集设备日志超时,请检查设备电源和信号后重试"},exports.WifiConnectErrorMsg={12e3:"WiFi模块初始化失败,请重启微信后重试",12001:"您的设备或系统不支持进行WiFi连接",12002:"请检查您的WiFi密码是否正确",12003:"连接WiFi热点超时,请重新连接",12004:"重复连接 Wi-Fi",12005:"配网操作需打开WiFi开关,请打开后重试",12006:"配网操作需打开GPS定位开关,请打开后重试",12007:isIOS?"WiFi连接操作被拒绝,请重试并在弹出的提示框中点击“加入”":"WiFi连接操作被拒绝,请重试并在弹出的提示框中点击允许连接WiFi",12008:"请确认连接的WiFi热点是否正确",12009:"配置WiFi连接失败,请尝试其他WiFi热点",12011:"配置WiFi连接失败,请重试",12013:"系统保存的WiFi配置过期,请在系统设置中忘记该WiFi后重试",NO_WIFI_IS_CONNECTED:"请检查WiFi信号和密码后重试",SSID_MISMATCH:"请检查WiFi信号和密码后重试",IOS_REFRESH_TIMEOUT:"获取WiFi列表超时,请重试",DEFAULT:"请检查WiFi开关是否打开后重试"},exports.ConnectLogWifiError=Object.assign({12002:"连接设备失败",12003:"连接设备超时,请检查设备电源和信号后重试",12005:"收集设备日志需打开WiFi开关,请打开后重试",12006:"收集设备日志需打开GPS定位开关,请打开后重试",12009:"连接设备失败",12011:"连接设备失败,请重试",NO_WIFI_IS_CONNECTED:"连接设备失败,请检查设备电源和信号后重试",RECONNECT_WIFI_FAIL:"连接设备失败,请检查设备电源和信号后重试",DEFAULT:"连接设备失败,请检查设备电源和信号后重试"},exports.WifiConnectErrorMsg);
//# sourceMappingURL=errors.js.map

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UdpServer=void 0;var tslib_1=require("tslib"),_utillib_1=require("@utillib"),decodeUdpMsg=function(r){var e=new Uint8Array(r),s=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(s))},UdpServer=function(){function r(r){var e=this,s=r.address,t=r.port,o=r.sdk,n=r.retryTime,i=void 0===n?5:n,a=r.retryGap,d=void 0===a?2e3:a,p=r.messageNoParse,u=void 0!==p&&p;Object.assign(this,{address:s,port:t,sdk:o,retryTime:i,retryGap:d,messageNoParse:u});var c=this.socket=wx.createUDPSocket();c.bind();var l=function(r){return e._onErrorHandler(r)},h=function(r){return e._onMessageHandler(r)};c.onError(l),c.onMessage(h),this.destroy=function(){e.socket.offError(l),e.socket.offMessage(h),e.socket.close()}}return r.prototype._onErrorHandler=function(r){"function"==typeof this._errorHandler?this._errorHandler(r):console.warn("UdpServer unhandled error",r)},r.prototype._onMessageHandler=function(r){try{if(this.messageNoParse){var e=decodeUdpMsg(r.message);return this.sdk&&this.sdk.reporter.info("udp-on-message",{data:{message:e}}),void("function"==typeof this._msgHandler?this._msgHandler(e):console.warn("UdpServer unhandled msg",e))}var s=JSON.parse(decodeUdpMsg(r.message));this.sdk&&this.sdk.reporter.info("udp-on-message",{data:{message:s}}),2==+s.cmdType&&("Current_Error"===s.deviceReply?this._onProgressErrorHandler({code:"BUSINESS_DEVICE_ERROR",detail:s}):"Previous_Error"===s.deviceReply?this.sdk&&this.sdk.reporter.info("softap-receive-prev-error",{data:{message:s}}):"function"==typeof this._msgHandler?this._msgHandler(s):console.warn("UdpServer unhandled msg",s))}catch(r){this.sdk&&this.sdk.reporter.info("udp-parse-message-error",{error:r})}},r.prototype._onProgressErrorHandler=function(r){"function"==typeof this._progressErrorHandler?this._progressErrorHandler(r):console.warn("UdpServer unhandled progress error",r)},r.prototype.onError=function(r){return this._errorHandler=r,this},r.prototype.onProgressError=function(r){return this._progressErrorHandler=r,this},r.prototype.onMessage=function(r){return this._msgHandler=r,this},r.prototype._send=function(r){"string"!=typeof r&&(r=JSON.stringify(r)),this.socket.send({address:this.address,port:this.port,message:r})},r.prototype.send=function(r){var e=this;return this.aborted=!1,new Promise((function(s,t){return tslib_1.__awaiter(e,void 0,void 0,(function(){var e,o,n,i,a=this;return tslib_1.__generator(this,(function(d){switch(d.label){case 0:d.trys.push([0,4,,5]),e=!0,o=0,this.onMessage((function(r){try{e=!1,s(r)}catch(r){t(r)}})),(n=function(){o++,a.sdk&&a.sdk.reporter.info("udp-send-msg",{data:{msg:r,retryCount:o}}),a._send(r)})(),d.label=1;case 1:return!this.aborted&&e&&o<=this.retryTime?[4,_utillib_1.delay(this.retryGap)]:[3,3];case 2:return d.sent(),this.aborted?[2,t(null)]:e?(n(),[3,1]):[2];case 3:return this.aborted?[2,t(null)]:(t({code:"UDP_NOT_RESPONSE"}),[3,5]);case 4:return i=d.sent(),t(tslib_1.__assign({code:"UDP_SEND_MSG_FAIL"},i)),[3,5];case 5:return[2]}}))}))}))},r.prototype.abort=function(){this.aborted=!0},r}();exports.UdpServer=UdpServer;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.UdpServer=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),decodeUdpMsg=function(r){var e=new Uint8Array(r),s=String.fromCharCode.apply(null,e);return decodeURIComponent(escape(s))},UdpServer=function(){function r(r){var e=this,s=r.address,t=r.port,o=r.sdk,n=r.retryTime,d=void 0===n?5:n,i=r.retryGap,a=void 0===i?2e3:i,p=r.messageNoParse,c=void 0!==p&&p;Object.assign(this,{address:s,port:t,sdk:o,retryTime:d,retryGap:a,messageNoParse:c});var u=this.socket=wx.createUDPSocket();u.bind();var l=function(r){return e._onErrorHandler(r)},h=function(r){return e._onMessageHandler(r)};u.onError(l),u.onMessage(h),this.destroy=function(){e.socket.offError(l),e.socket.offMessage(h),e.socket.close()}}return r.prototype._onErrorHandler=function(r){"function"==typeof this._errorHandler?this._errorHandler(r):console.warn("UdpServer unhandled error",r)},r.prototype._onMessageHandler=function(r){try{if(this.messageNoParse){var e=decodeUdpMsg(r.message);return this.sdk&&this.sdk.reporter.info("udp-on-message",{data:{message:e}}),void("function"==typeof this._msgHandler?this._msgHandler(e):console.warn("UdpServer unhandled msg",e))}var s=JSON.parse(decodeUdpMsg(r.message));this.sdk&&this.sdk.reporter.info("udp-on-message",{data:{message:s}}),2==+s.cmdType&&("Current_Error"===s.deviceReply?this._onProgressErrorHandler({code:"BUSINESS_DEVICE_ERROR",detail:s}):"Previous_Error"===s.deviceReply?this.sdk&&this.sdk.reporter.info("softap-receive-prev-error",{data:{message:s}}):"function"==typeof this._msgHandler?this._msgHandler(s):console.warn("UdpServer unhandled msg",s))}catch(r){this.sdk&&this.sdk.reporter.info("udp-parse-message-error",{error:r})}},r.prototype._onProgressErrorHandler=function(r){"function"==typeof this._progressErrorHandler?this._progressErrorHandler(r):console.warn("UdpServer unhandled progress error",r)},r.prototype.onError=function(r){return this._errorHandler=r,this},r.prototype.onProgressError=function(r){return this._progressErrorHandler=r,this},r.prototype.onMessage=function(r){return this._msgHandler=r,this},r.prototype._send=function(r){"string"!=typeof r&&(r=JSON.stringify(r)),this.socket.send({address:this.address,port:this.port,message:r})},r.prototype.send=function(r){var e=this;return this.aborted=!1,new Promise((function(s,t){return tslib_1.__awaiter(e,void 0,void 0,(function(){var e,o,n,d,i=this;return tslib_1.__generator(this,(function(a){switch(a.label){case 0:a.trys.push([0,4,,5]),e=!0,o=0,this.onMessage((function(r){try{e=!1,s(r)}catch(r){t(r)}})),(n=function(){o++,i.sdk&&i.sdk.reporter.info("udp-send-msg",{data:{msg:r,retryCount:o}}),i._send(r)})(),a.label=1;case 1:return!this.aborted&&e&&o<=this.retryTime?[4,qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay(this.retryGap)]:[3,3];case 2:return a.sent(),this.aborted?[2,t(null)]:e?(n(),[3,1]):[2];case 3:return this.aborted?[2,t(null)]:(t({code:"UDP_NOT_RESPONSE"}),[3,5]);case 4:return d=a.sent(),t(tslib_1.__assign({code:"UDP_SEND_MSG_FAIL"},d)),[3,5];case 5:return[2]}}))}))}))},r.prototype.abort=function(){this.aborted=!0},r}();exports.UdpServer=UdpServer;
//# sourceMappingURL=UdpServer.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-core",
"version": "1.0.6",
"version": "1.0.7",
"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