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

qcloud-iotexplorer-appdev-plugin-wificonf-blecombo

Package Overview
Dependencies
Maintainers
2
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 1.1.1 to 1.1.2

2

lib/index.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboLLSyncDeviceAdapter=exports.BleComboEspDeviceAdapter=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),protocols_1=require("./protocols");Object.defineProperty(exports,"BleComboEspDeviceAdapter",{enumerable:!0,get:function(){return protocols_1.BleComboEspDeviceAdapter}}),Object.defineProperty(exports,"BleComboLLSyncDeviceAdapter",{enumerable:!0,get:function(){return protocols_1.BleComboLLSyncDeviceAdapter}});var BleComboTask_1=require("./protocols/BleComboTask"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,WifiConfStepDesp=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepDesp,getBleComboProtoHandler=function(e){switch(e.wifiConfType){case BleComboTask_1.BleComboType.BLE_COMBO_ESP:return new protocols_1.BleComboEspTask(e);case BleComboTask_1.BleComboType.BLE_COMBO_LLSYNC:return new protocols_1.BleComboLLSyncTask(e);default:console.warn("没有找到 wifiConfType 对应的 bleComboHandler:",e.wifiConfType)}},BleComboPlugin=function(){function e(){}return e.install=function(e){e.plugins.wifiConfBleCombo={start:function(e){return tslib_1.__awaiter(this,void 0,void 0,(function(){var o,t,r,i,n,s,l,a,c,_,p,d,u,C,f=this;return tslib_1.__generator(this,(function(b){switch(b.label){case 0:o=e.onError,t=e.onProgress,r=e.onComplete,i=e.wifiConfToken,n=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(f,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,delay(e)];case 1:return o.sent(),[2]}}))}))},t({code:WifiConfStepCode.PROTOCOL_START}),b.label=1;case 1:b.trys.push([1,13,,14]),s=Date.now(),l=getBleComboProtoHandler(tslib_1.__assign(tslib_1.__assign({},e),{reporter:{info:function(e,o){void 0===o&&(o={}),t({code:WifiConfStepCode.PROTOCOL_DETAIL,detail:{message:WifiConfStepCode.PROTOCOL_DETAIL+"("+WifiConfStepDesp[WifiConfStepCode.PROTOCOL_DETAIL]+": "+e+")",data:o}})},error:function(e){o({code:"PROTOCOL_FAIL",detail:{error:e}})}}})),b.label=2;case 2:return b.trys.push([2,4,,5]),[4,l.start()];case 3:return b.sent(),[3,5];case 4:throw a=b.sent(),console.error(a),tslib_1.__assign({code:"PROTOCOL_FAIL"},a);case 5:return t({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-s}}),[4,n()];case 6:b.sent(),t({code:WifiConfStepCode.BUSINESS_START}),t({code:"BLE_SEND_TOKEN_START",detail:{data:{wifiConfToken:i}}}),c=Date.now(),_=void 0,b.label=7;case 7:return b.trys.push([7,9,,10]),[4,l.sendToken()];case 8:return _=b.sent(),[3,10];case 9:throw p=b.sent(),tslib_1.__assign({code:"BLE_SEND_TOKEN_ERROR"},p);case 10:return[4,t({code:"BLE_SEND_TOKEN_SUCCESS",detail:{timeCost:Date.now()-c,response:_}})];case 11:return b.sent(),[4,n()];case 12:return b.sent(),d=_.productId,u=_.deviceName,r({productId:d,deviceName:u}),l.interrupt(),t({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:{timeCost:Date.now()-s}}),[3,14];case 13:return C=b.sent(),o({code:"",detail:{error:C}}),[3,14];case 14:return[2]}}))}))}}},e}();exports.default=BleComboPlugin;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboLLSyncDeviceAdapter=exports.BleComboEspDeviceAdapter=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),protocols_1=require("./protocols");Object.defineProperty(exports,"BleComboEspDeviceAdapter",{enumerable:!0,get:function(){return protocols_1.BleComboEspDeviceAdapter}}),Object.defineProperty(exports,"BleComboLLSyncDeviceAdapter",{enumerable:!0,get:function(){return protocols_1.BleComboLLSyncDeviceAdapter}});var qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),iotexplorer_ui_dev_config_1=require("iotexplorer-ui-dev-config"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,WifiConfStepDesp=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepDesp,getBleComboProtoHandler=function(e){switch(e.wifiConfType){case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboEsp:return new protocols_1.BleComboEspTask(e);case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboLLSync:return new protocols_1.BleComboLLSyncTask(e);default:console.warn("没有找到 wifiConfType 对应的 bleComboHandler:",e.wifiConfType)}},BleComboPlugin=function(){function e(){}return e.install=function(e){e.plugins.wifiConfBleCombo={start:function(e){return tslib_1.__awaiter(this,void 0,void 0,(function(){var o,t,r,i,n,s,c,l,_,a,p,d,f,u,C=this;return tslib_1.__generator(this,(function(b){switch(b.label){case 0:o=e.onError,t=e.onProgress,r=e.onComplete,i=e.wifiConfToken,n=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(C,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,delay(e)];case 1:return o.sent(),[2]}}))}))},t({code:WifiConfStepCode.PROTOCOL_START}),b.label=1;case 1:b.trys.push([1,13,,14]),s=Date.now(),c=getBleComboProtoHandler(tslib_1.__assign(tslib_1.__assign({},e),{reporter:{info:function(e,o){void 0===o&&(o={}),t({code:WifiConfStepCode.PROTOCOL_DETAIL,detail:{message:WifiConfStepCode.PROTOCOL_DETAIL+"("+WifiConfStepDesp[WifiConfStepCode.PROTOCOL_DETAIL]+": "+e+")",data:o}})},error:function(e){o({code:"PROTOCOL_FAIL",detail:{error:e}})}}})),b.label=2;case 2:return b.trys.push([2,4,,5]),[4,c.start()];case 3:return b.sent(),[3,5];case 4:throw l=b.sent(),console.error(l),tslib_1.__assign({code:"PROTOCOL_FAIL"},l);case 5:return t({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-s}}),[4,n()];case 6:b.sent(),t({code:WifiConfStepCode.BUSINESS_START}),t({code:"BLE_SEND_TOKEN_START",detail:{data:{wifiConfToken:i}}}),_=Date.now(),a=void 0,b.label=7;case 7:return b.trys.push([7,9,,10]),[4,c.sendToken()];case 8:return a=b.sent(),[3,10];case 9:throw p=b.sent(),tslib_1.__assign({code:"BLE_SEND_TOKEN_ERROR"},p);case 10:return[4,t({code:"BLE_SEND_TOKEN_SUCCESS",detail:{timeCost:Date.now()-_,response:a}})];case 11:return b.sent(),[4,n()];case 12:return b.sent(),d=a.productId,f=a.deviceName,r({productId:d,deviceName:f}),c.interrupt(),t({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:{timeCost:Date.now()-s}}),[3,14];case 13:return u=b.sent(),o({code:"",detail:{error:u}}),[3,14];case 14:return[2]}}))}))}}},e}();exports.default=BleComboPlugin;
//# sourceMappingURL=index.js.map

@@ -1,6 +0,7 @@

import { BleComboTask, BleComboTaskOptions, BleComboType } from '../BleComboTask';
import { BleComboTask, BleComboTaskOptions } from '../BleComboTask';
import { BleComboEspDeviceAdapter } from './BleComboEspDeviceAdapter';
import { WifiConfType } from 'iotexplorer-ui-dev-config';
export interface BleComboEspTaskOptions extends BleComboTaskOptions<BleComboEspDeviceAdapter> {
deviceAdapter: BleComboEspDeviceAdapter;
wifiConfType: BleComboType.BLE_COMBO_ESP;
wifiConfType: WifiConfType.BLEComboEsp;
}

@@ -7,0 +8,0 @@ export declare class BleComboEspTask extends BleComboTask<BleComboEspDeviceAdapter> {

import { BleComboLLSyncDeviceAdapter } from './BleComboLLSyncDeviceAdapter';
import { BleComboTask, BleComboTaskOptions, BleComboType } from '../BleComboTask';
import { BleComboTask, BleComboTaskOptions } from '../BleComboTask';
import { WifiConfType } from 'iotexplorer-ui-dev-config';
declare type LLSyncComboDeviceAdapterType = InstanceType<typeof BleComboLLSyncDeviceAdapter>;
export interface BleComboLLSyncTaskOptions extends BleComboTaskOptions<LLSyncComboDeviceAdapterType> {
deviceAdapter: LLSyncComboDeviceAdapterType;
wifiConfType: BleComboType.BLE_COMBO_LLSYNC;
wifiConfType: WifiConfType.BLEComboLLSync;
}

@@ -8,0 +9,0 @@ export declare class BleComboLLSyncTask extends BleComboTask<LLSyncComboDeviceAdapterType> {

import { AppDevSdk, Reporter } from 'qcloud-iotexplorer-appdev-sdk';
import { WifiConfOption } from 'qcloud-iotexplorer-appdev-plugin-wificonf-core';
import { DeviceAdapter } from 'qcloud-iotexplorer-bluetooth-adapter';
export declare enum BleComboType {
BLE_COMBO_ESP = "BLE_COMBO_ESP",
BLE_COMBO_LLSYNC = "BLE_COMBO_LLSYNC"
}
export interface BleComboTaskOptions<T extends DeviceAdapter> extends WifiConfOption {
deviceAdapter: T;
wifiConfType: BleComboType;
reporter: Reporter;

@@ -12,0 +7,0 @@ }

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboTask=exports.BleComboType=void 0;var BleComboType,tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay;!function(e){e.BLE_COMBO_ESP="BLE_COMBO_ESP",e.BLE_COMBO_LLSYNC="BLE_COMBO_LLSYNC"}(BleComboType=exports.BleComboType||(exports.BleComboType={}));var BleComboTask=function(e){function t(t){var r=t.targetWifiInfo,s=t.wifiConfToken,o=void 0===s?"":s,i=t.deviceAdapter,n=t.reporter,a=e.call(this)||this;a.sequence=0,a.sendDataInterval=300;var l=r.SSID,p=r.password;return a.ssid=l,a.password=p||"",a.token=o,a.deviceAdapter=i,a.logger=n,a.processing=!1,a.logger.info("ssid/password",{data:l+"/"+p.replace(/^\w{3}/,"***")}),a}return tslib_1.__extends(t,e),t.prototype.start=function(){return tslib_1.__awaiter(this,void 0,void 0,(function(){var e;return tslib_1.__generator(this,(function(t){switch(t.label){case 0:if(this.processing)return[2,Promise.reject({code:"PROCESSING_PLEASE_WAIT"})];this.processing=!0,t.label=1;case 1:return t.trys.push([1,8,,9]),console.info("[plugin]: start to set wifi mode"),[4,this.setWiFiMode()];case 2:return t.sent(),[4,delay(this.sendDataInterval)];case 3:return t.sent(),console.info("[plugin]: start to send wifi info"),[4,this.sendWiFiInfo()];case 4:return t.sent(),[4,delay(this.sendDataInterval)];case 5:return t.sent(),console.info("[plugin]: start to connect wifi"),[4,this.connectWifi()];case 6:return t.sent(),[4,delay(this.sendDataInterval)];case 7:return t.sent(),[3,9];case 8:return e=t.sent(),console.error(e),[2,Promise.reject({error:e})];case 9:return[2]}}))}))},t.prototype.interrupt=function(){this.processing=!1,this.deviceAdapter.disconnectDevice()},t}(qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.EventEmitter);exports.BleComboTask=BleComboTask;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboTask=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,BleComboTask=function(e){function t(t){var r=t.targetWifiInfo,s=t.wifiConfToken,i=void 0===s?"":s,o=t.deviceAdapter,n=t.reporter,a=e.call(this)||this;a.sequence=0,a.sendDataInterval=300;var d=r.SSID,c=r.password;return a.ssid=d,a.password=c||"",a.token=i,a.deviceAdapter=o,a.logger=n,a.processing=!1,a.logger.info("ssid/password",{data:d+"/"+c.replace(/^\w{3}/,"***")}),a}return tslib_1.__extends(t,e),t.prototype.start=function(){return tslib_1.__awaiter(this,void 0,void 0,(function(){var e;return tslib_1.__generator(this,(function(t){switch(t.label){case 0:if(this.processing)return[2,Promise.reject({code:"PROCESSING_PLEASE_WAIT"})];this.processing=!0,t.label=1;case 1:return t.trys.push([1,8,,9]),console.info("[plugin]: start to set wifi mode"),[4,this.setWiFiMode()];case 2:return t.sent(),[4,delay(this.sendDataInterval)];case 3:return t.sent(),console.info("[plugin]: start to send wifi info"),[4,this.sendWiFiInfo()];case 4:return t.sent(),[4,delay(this.sendDataInterval)];case 5:return t.sent(),console.info("[plugin]: start to connect wifi"),[4,this.connectWifi()];case 6:return t.sent(),[4,delay(this.sendDataInterval)];case 7:return t.sent(),[3,9];case 8:return e=t.sent(),console.error(e),[2,Promise.reject({error:e})];case 9:return[2]}}))}))},t.prototype.interrupt=function(){this.processing=!1,this.deviceAdapter.disconnectDevice()},t}(qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.EventEmitter);exports.BleComboTask=BleComboTask;
//# sourceMappingURL=BleComboTask.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-blecombo",
"version": "1.1.1",
"version": "1.1.2",
"description": "",

@@ -18,3 +18,4 @@ "main": "lib/index.js",

"dependencies": {
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.11",
"iotexplorer-ui-dev-config": "^1.0.22",
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.12",
"qcloud-iotexplorer-appdev-sdk": "^1.1.10",

@@ -30,3 +31,4 @@ "qcloud-iotexplorer-bluetooth-adapter": "^0.3.0",

"url": "https://github.com/tencentyun/qcloud-iotexplorer-appdev-sdk/issues"
}
},
"gitHead": "41265eba454c257256bbfc03b6349888edabbd60"
}

@@ -136,7 +136,7 @@ # qcloud-iotexplorer-appdev-plugin-wificonf-blecombo

targetWifiInfo: { // 用于设备联网的wifi信息,由用户填入
SSID: '你的Wi-Fi名称';
password: '你的Wi-Fi密码';
BSSID: '';
SSID: '你的Wi-Fi名称',
password: '你的Wi-Fi密码',
BSSID: '',
},
wifiConfType: 'BLE_COMBO_ESP' // 可传 'BLE_COMBO_ESP' | 'BLE_COMBO_LLSYNC'
wifiConfType: 'ble', // 'ble' | 'llsyncble'
deviceAdapter, // 由连接设备之后获得

@@ -143,0 +143,0 @@

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