"use strict";var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_wjUtils=require("./wjUtils.js"),_wjUtils2=_interopRequireDefault(_wjUtils),_wjService=require("./wjService.js"),_wjService2=_interopRequireDefault(_wjService),_wjDataInteract=require("./wjDataInteract.js"),_wjDataInteract2=_interopRequireDefault(_wjDataInteract),_wjDataEncode=require("./wjDataEncode.js"),_wjDataEncode2=_interopRequireDefault(_wjDataEncode);function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}var timeID,TAG_FUNCTION="function",SDK_VERSION="WJ_BLESDK_WX_GZ_V1.0.0_20250303";function connectDevice(e,o){e&&e.deviceId?_wjService2.default.reallyConnect(e,function(e){0===e.serviceCode?(void 0===o?"undefined":_typeof(o))===TAG_FUNCTION&&o({code:0,msg:e.serviceInfo||"连接成功"}):(void 0===o?"undefined":_typeof(o))===TAG_FUNCTION&&o({code:-1,msg:e.serviceInfo||"连接失败"})}):(void 0===o?"undefined":_typeof(o))===TAG_FUNCTION&&o({code:-1,msg:"设备参数无效,请重新选择设备"})}function scanDevice(s){var a={},u=[];wx.openBluetoothAdapter({success:function(e){wx.startBluetoothDevicesDiscovery({services:[],success:function(e){wx.onBluetoothDeviceFound(function(e){for(var o=0;o=e.length?(void 0===n?"undefined":_typeof(n))===TAG_FUNCTION&&n({code:0,data:c,msg:"执行成功"}):transCommand(e[i],t,function(e){0===e.serviceCode?(c.push(e.serviceData.dataBuff.substring(4)),i++,o()):(void 0===n?"undefined":_typeof(n))===TAG_FUNCTION&&n({code:-1,msg:e.serviceInfo||"指令执行失败",data:c})})}()):(void 0===n?"undefined":_typeof(n))===TAG_FUNCTION&&n({code:-1,msg:"指令集参数无效"})}function disconnectDeviceBluetooth(o){_wjService2.default.reallyDisConnect(function(e){(void 0===o?"undefined":_typeof(o))===TAG_FUNCTION&&o({code:0,msg:"已断连"})})}module.exports={scanDevice:scanDevice,connectDevice:connectDevice,init:init,disconnectDevice:disconnectDevice,getDeviceInfo:getDeviceInfo,scanBle:scanBle,closBluetooth:closBluetooth,transCmd:transCmd,disconnectDeviceBluetooth:disconnectDeviceBluetooth};