Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

ArtcBleUtil.js 18KB

1
  1. const _0x2a8a=['连接配置失败,即将断开物理层连接!','getBLEDeviceCharacteristics','B200','connected','DEV_COMMAND_RESPONSE_DATA_ERROR','发送失败','devices','RESPONSE_DATA_PROTOBUF_EXCEPTION','length','log','SendDataAC','toUpperCase','OPEN_BLE_ADAPTER_FAIL','errMsg','onBLECharacteristicValueChange','forEach','getBLEDeviceServices','搜索到:','FEE7','errCode','advertisServiceUUIDs','uuid','createBLEConnection','b500','ESAM返回信息:','onBluetoothDeviceFound','BLE_SCAN_STOP_OK','FEC7','数据协议结构异常','localName','characteristicId','fail','发送超时','services','SendDataA3','closeBluetoothAdapter','服务ID:','DISCONNECT_OK','reTLV','物理层连接成功','writeBLECharacteristicValue','已断开连接','startsWith','打开蓝牙适配器','BLE_STATUS_CLOSE_Adapter_FAIL','notifyBLECharacteristicValueChange','info','BLE_SCAN_STOP_FAIL','RESPONSE_DATA_PROTOCOL_ERROR','POST_COMMAND_FAIL','stopBluetoothDevicesDiscovery','设备信息:','createTLV','RESPONSE_DATA_STRUCTURE_EXCEPTION','startBluetoothDevicesDiscovery','MakeInitResponse','warn','打开蓝牙适配器失败','MakeAuthResponse','RESPONSE_DATA_BCC_CHECKOUT_FAIL','value','data','打开消息监听器失败','打开消息监听器','连接成功','push','当前蓝牙标签并不是埃特斯厂家!','WECHAT_PROTOCOL_AUTH_FAIL','断开物理层连接:','HANDSHAKE_FAIL','analyticData','characteristics','获取特征失败','SEND_OVERTIME','success','BC00','FEC8','code','BCC校验失败','BLE_STATUS_OK'];const _0x15ba=function(_0x2a8a3f,_0x15ba5d){_0x2a8a3f=_0x2a8a3f-0x0;let _0x302f7f=_0x2a8a[_0x2a8a3f];return _0x302f7f;};const artcProtocol=require('./ArtcBleProtocol.js');const artcDataUtil=require('./ArtcDataUtil.js');import{ArtcBleStatusCodes,ArtcStatusDescriptions}from'./ReturnStatusCode';import _0x5337a5 from'./ArtcConsole';const FUNCTION='function';var foundDevices=[];var artcDeviceId='';var artcServiceId='';var artcWriteId='';var artcReadId='';const ARTC_SERVICE_UUID='0000FEE7-0000-1000-8000-00805F9B34FB';const ARTC_WRTIE_UUID='0000FEC7-0000-1000-8000-00805F9B34FB';const ARTC_READ_UUID='0000FEC8-0000-1000-8000-00805F9B34FB';const SHORT_ARTC_SERVICE_UUID=_0x15ba('0x12');const SHORT_ARTC_WRTIE_UUID=_0x15ba('0x1b');const SHORT_ARTC_READ_UUID=_0x15ba('0x4c');let DevResult=function(_0x721fa1,_0x3d4462){this['code']=_0x721fa1;this['data']=_0x3d4462;};let BleStatusResult=function(_0x4683be,_0x3e56fd,_0x1f8a13){this['code']=_0x4683be;this['msg']=_0x3e56fd;this[_0x15ba('0x3d')]=_0x1f8a13;};let isConnectedStatus=![];let _connectCallBack;let _forceDisconnectCallBack;_0x5337a5['info']('埃特斯-贵州-LW协议蓝牙标签_version:1.0');function startScanBleDevice(_0xc0a972,_0x2db1de,_0xb2929e,_0x964b29){foundDevices=[];setTimeout(()=>{typeof _0xb2929e===FUNCTION&&_0xb2929e(new DevResult(ArtcBleStatusCodes['OK'],foundDevices));},_0x2db1de);wx['openBluetoothAdapter']({'success':function(_0xc04108){_0x5337a5[_0x15ba('0x9')](_0x15ba('0x2b'));wx[_0x15ba('0x36')]({'services':[SHORT_ARTC_SERVICE_UUID],'success':function(_0x3dbc33){_0x964b29(new BleStatusResult(ArtcBleStatusCodes['BLE_STATUS_OK'],ArtcStatusDescriptions['BLE_STATUS_OK']));_0x5337a5['log']('开始搜寻附近的蓝牙外围设备');wx[_0x15ba('0x19')](function(_0x9906c6){if(_0x9906c6[_0x15ba('0x6')][_0x15ba('0x8')]>0x0){for(let _0x469931=0x0;_0x469931<_0x9906c6['devices']['length'];_0x469931++){const _0x23139e=_0x9906c6[_0x15ba('0x6')][_0x469931][_0x15ba('0x14')];_0x23139e[_0x15ba('0xf')](_0x350637=>{if(_0x350637===ARTC_SERVICE_UUID||_0x350637===SHORT_ARTC_SERVICE_UUID){_0x5337a5['info'](_0x15ba('0x11')+_0x9906c6[_0x15ba('0x6')][_0x469931]['localName']);_0x5337a5[_0x15ba('0x9')](_0x15ba('0x24')+_0x350637);if(_0xc0a972!=null&&_0x9906c6['devices'][_0x469931][_0x15ba('0x1d')][_0x15ba('0x2a')](_0xc0a972)){foundDevices[_0x15ba('0x41')](_0x9906c6[_0x15ba('0x6')][_0x469931]);}}});}}});},'fail':function(_0x30a285){_0x5337a5['warn'](_0x30a285[_0x15ba('0xd')]+':'+_0x30a285['errCode']);_0x964b29(new BleStatusResult(_0x30a285['errCode'],ArtcStatusDescriptions['BLE_STATUS_DevicesDiscovery_FAIL']));typeof _0xb2929e['fail']===FUNCTION&&_0xb2929e[_0x15ba('0x1f')](new DevResult(_0x30a285[_0x15ba('0x13')],_0x30a285[_0x15ba('0xd')]));}});},'fail':function(_0xb964a7){_0x5337a5['warn']('打开蓝牙适配器失败');_0x964b29(new BleStatusResult(_0xb964a7[_0x15ba('0x13')],ArtcStatusDescriptions['BLE_STATUS_OPEN_Adapter_FAIL']));typeof _0xb2929e['fail']===FUNCTION&&_0xb2929e[_0x15ba('0x1f')](new DevResult(ArtcBleStatusCodes[_0x15ba('0xc')],_0x15ba('0x39')));}});}function stopScanBleDevice(_0x4367c5){wx[_0x15ba('0x32')]({'success':function(_0x4fa6b2){_0x5337a5[_0x15ba('0x2e')]('停止搜索');_0x4367c5(new BleStatusResult(ArtcBleStatusCodes[_0x15ba('0x1a')],ArtcStatusDescriptions[_0x15ba('0x4f')]));},'fail':function(_0x57a1c8){_0x5337a5[_0x15ba('0x2e')]('停止搜索失败');_0x4367c5(new BleStatusResult(ArtcBleStatusCodes['BLE_SCAN_STOP_FAIL'],ArtcStatusDescriptions[_0x15ba('0x2f')]));}});}function connectBleDev(_0x36b0d9,_0x5cf11f){connectBle(_0x36b0d9,{'success':function(){deployBle({'success':function(_0x410aab){isConnectedStatus=!![];typeof _0x5cf11f['success']===FUNCTION&&_0x5cf11f[_0x15ba('0x4a')](new DevResult(ArtcBleStatusCodes['OK'],_0x15ba('0x40')));},'fail':function(_0x24479e){_0x5337a5['warn'](_0x15ba('0x0'));disconnectBle(_0x29d996=>{_0x5337a5['log'](_0x15ba('0x44')+_0x29d996);});typeof _0x5cf11f['fail']===FUNCTION&&_0x5cf11f[_0x15ba('0x1f')](_0x24479e);}});},'fail':function(){typeof _0x5cf11f['fail']===FUNCTION&&_0x5cf11f['fail'](new DevResult(ArtcBleStatusCodes['PHYSICS_CONNECT_FAIL'],'物理层连接失败'));}});}function connectBle(_0x360cac,_0x19511c){artcDeviceId=_0x360cac['deviceId'];wx[_0x15ba('0x16')]({'deviceId':artcDeviceId,'timeout':0x1388,'success':function(_0x14d9b9){_0x5337a5[_0x15ba('0x2e')](_0x15ba('0x27'));typeof _0x19511c['success']===FUNCTION&&_0x19511c['success']();},'fail':function(){typeof _0x19511c['fail']===FUNCTION&&_0x19511c[_0x15ba('0x1f')]();}});}function disconnectBle(_0x1107db){wx['closeBLEConnection']({'deviceId':artcDeviceId,'success':function(_0x2a8bdb){wx['closeBluetoothAdapter']({'success'(_0x285dac){_0x5337a5['info']('关闭蓝牙适配器');typeof _0x1107db===FUNCTION&&_0x1107db(new BleStatusResult(ArtcBleStatusCodes[_0x15ba('0x25')],_0x15ba('0x29')));},'fail'(_0x1a3c70){_0x5337a5['warn']('关闭蓝牙适配器失败:'+_0x1a3c70['errCode']);typeof _0x1107db===FUNCTION&&_0x1107db(new BleStatusResult(ArtcBleStatusCodes[_0x15ba('0x2c')],'断连失败['+_0x1a3c70['errCode']+']'));}});isConnectedStatus=![];},'fail':function(_0x44e886){typeof _0x1107db===FUNCTION&&_0x1107db(new BleStatusResult(ArtcBleStatusCodes['DISCONNECT_FAIL'],'断连失败['+_0x44e886['errCode']+']'));}});}function deployBle(_0x10b6d0){artcWriteId='';artcReadId='';_connectCallBack=_0x10b6d0;_0x5337a5[_0x15ba('0x9')]('配置连接信息');wx[_0x15ba('0x10')]({'deviceId':artcDeviceId,'success':function(_0x3f554f){for(let _0xb6c316=0x0;_0xb6c316<_0x3f554f['services']['length'];_0xb6c316++){let _0x32653d=_0x3f554f[_0x15ba('0x21')][_0xb6c316]['uuid']||_0x3f554f[_0x15ba('0x21')][_0xb6c316]['serviceId'];if(_0x32653d['toUpperCase']()===ARTC_SERVICE_UUID||_0x32653d[_0x15ba('0xb')]()===SHORT_ARTC_SERVICE_UUID){artcServiceId=_0x32653d;wx[_0x15ba('0x1')]({'deviceId':artcDeviceId,'serviceId':artcServiceId,'success':function(_0x1d8bf9){for(let _0x30f4aa=0x0;_0x30f4aa<_0x1d8bf9[_0x15ba('0x47')]['length'];_0x30f4aa++){let _0x2fec44=_0x1d8bf9[_0x15ba('0x47')][_0x30f4aa][_0x15ba('0x15')]||_0x1d8bf9['characteristics'][_0x30f4aa][_0x15ba('0x1e')];if(_0x2fec44['toUpperCase']()===ARTC_READ_UUID||_0x2fec44['toUpperCase']()===SHORT_ARTC_READ_UUID){artcReadId=_0x2fec44;}else if(_0x2fec44['toUpperCase']()===ARTC_WRTIE_UUID||_0x2fec44['toUpperCase']()===SHORT_ARTC_WRTIE_UUID){artcWriteId=_0x2fec44;}}if(artcWriteId[_0x15ba('0x8')]===0x0||artcReadId[_0x15ba('0x8')]===0x0){typeof _0x10b6d0[_0x15ba('0x1f')]===FUNCTION&&_0x10b6d0['fail'](new DevResult(ArtcBleStatusCodes['NOT_CHARACTERISTICS'],'没有目标特征'));}else{_0x5337a5['log'](_0x15ba('0x3f'));openReceiveData(function(_0x5d3085){if(_0x5d3085===0x0){_0x5337a5['info']('物理连接成功,开始监听');}else{typeof _0x10b6d0[_0x15ba('0x1f')]===FUNCTION&&_0x10b6d0[_0x15ba('0x1f')](new DevResult(_0x5d3085,_0x15ba('0x3e')));}});}},'fail':function(_0x2ab365){typeof _0x10b6d0['fail']===FUNCTION&&_0x10b6d0[_0x15ba('0x1f')](new DevResult(_0x2ab365['errCode'],_0x15ba('0x48')));}});return;}}typeof _0x10b6d0['fail']===FUNCTION&&_0x10b6d0['fail'](new DevResult(ArtcBleStatusCodes['NOT_SERVICE_ID'],'没有目标服务'));},'fail':function(_0x1125df){typeof _0x10b6d0['fail']===FUNCTION&&_0x10b6d0['fail'](new DevResult(_0x1125df['errCode'],'获取服务失败'));}});}function openReceiveData(_0x3b20cb){wx[_0x15ba('0x2d')]({'deviceId':artcDeviceId,'serviceId':artcServiceId,'characteristicId':artcReadId,'state':!![],'success':function(_0x29204c){typeof _0x3b20cb===FUNCTION&&_0x3b20cb(ArtcBleStatusCodes['OK']);},'fail':function(_0x1fbae0){typeof _0x3b20cb===FUNCTION&&_0x3b20cb(_0x1fbae0[_0x15ba('0x13')]);}});wx[_0x15ba('0xe')](function(_0x3a62ed){if(_0x3a62ed['characteristicId']['toUpperCase']()===ARTC_READ_UUID||_0x3a62ed['characteristicId'][_0x15ba('0xb')]()===SHORT_ARTC_READ_UUID){let _0xc394f0=artcDataUtil['buf2hex'](_0x3a62ed[_0x15ba('0x3c')]);_0x5337a5['log']('接收:'+_0xc394f0);const _0x5c8396=artcProtocol[_0x15ba('0x46')](_0xc394f0);switch(_0x5c8396[_0x15ba('0x4d')]){case ArtcBleStatusCodes[_0x15ba('0x30')]:if(_sendDataCall)_sendDataCall=![];typeof _sendCallback===FUNCTION&&_sendCallback(new DevResult(_0x5c8396['code'],'接收数据协议结构错误'));break;case ArtcBleStatusCodes[_0x15ba('0x3a')]:sendData(artcProtocol['makeAuthResponse'](),_0x10540e=>{disconnectBle({});_0x5337a5['warn'](ArtcStatusDescriptions['WECHAT_PROTOCOL_AUTH_FAIL']);typeof _connectCallBack[_0x15ba('0x1f')]===FUNCTION&&_connectCallBack['fail'](new DevResult(_0x5c8396[_0x15ba('0x4d')],ArtcStatusDescriptions[_0x15ba('0x43')]));});break;case ArtcBleStatusCodes[_0x15ba('0x37')]:sendData(artcProtocol['makeInitResponse'](),_0x57ce4c=>{disconnectBle({});_0x5337a5['warn'](ArtcStatusDescriptions['WECHAT_PROTOCOL_INIT_FAIL']);typeof _connectCallBack['fail']===FUNCTION&&_connectCallBack[_0x15ba('0x1f')](new DevResult(_0x5c8396['code'],ArtcStatusDescriptions['WECHAT_PROTOCOL_INIT_FAIL']));});setTimeout(()=>{checkBleDeviceIsArtc();},0x1f4);break;case ArtcBleStatusCodes[_0x15ba('0x35')]:if(_sendDataCall)_sendDataCall=![];typeof _sendCallback===FUNCTION&&_sendCallback(new DevResult(_0x5c8396['code'],_0x15ba('0x1c')));break;case ArtcBleStatusCodes[_0x15ba('0x7')]:if(_sendDataCall)_sendDataCall=![];typeof _sendCallback===FUNCTION&&_sendCallback(new DevResult(_0x5c8396[_0x15ba('0x4d')],'protobuf数据协议长度异常'));break;case ArtcBleStatusCodes['RESPONSE_DATA_CTL_EXCEPTION']:if(_sendDataCall)_sendDataCall=![];typeof _sendCallback===FUNCTION&&_sendCallback(new DevResult(_0x5c8396['code'],'CTL字段数据异常'));break;case ArtcBleStatusCodes[_0x15ba('0x3b')]:if(_sendDataCall)_sendDataCall=![];typeof _sendCallback===FUNCTION&&_sendCallback(new DevResult(_0x5c8396['code'],_0x15ba('0x4e')));break;case ArtcBleStatusCodes['OK']:if(_sendDataCall)_sendDataCall=![];_0x5337a5[_0x15ba('0x2e')]('returnResult.data'+JSON['stringify'](_0x5c8396));typeof _sendCallback===FUNCTION&&_sendCallback(new DevResult(_0x5c8396['code'],_0x5c8396[_0x15ba('0x3d')]));break;}}});}let _sendTime;let _sendDataCall=![];let _sendCallback;let _sendDatas;let _sendIndex=0x0;function sendData(_0x3b3d79,_0x47e24c,_0x132a43){_sendDataCall=!![];artcProtocol['clearAnalyticData']();_sendCallback=_0x47e24c;_sendDatas=_0x3b3d79;_sendIndex=0x0;startSendData();let _0x357363=_0x132a43;if(!_0x132a43){_0x357363=0x8*0x3e8;}clearTimeout(_sendTime);_sendTime=setTimeout(()=>{if(_sendDataCall){_sendDataCall=![];typeof _sendCallback===FUNCTION&&_sendCallback(new DevResult(ArtcBleStatusCodes[_0x15ba('0x49')],_0x15ba('0x20')));}},_0x357363);}function startSendData(){if(_sendIndex<_sendDatas['length']){let _0x122780=_sendDatas[_sendIndex];wx[_0x15ba('0x28')]({'deviceId':artcDeviceId,'serviceId':artcServiceId,'characteristicId':artcWriteId,'value':_0x122780,'success':function(_0x2dc831){_0x5337a5[_0x15ba('0x9')]('发送:'+artcDataUtil['buf2hex'](_0x122780));setTimeout(()=>{_sendIndex++;startSendData();},0x14);},'fail':function(_0x2e6313){clearTimeout(_sendTime);if(_sendDataCall){_sendDataCall=![];typeof _sendCallback===FUNCTION&&_sendCallback(new DevResult(_0x2e6313['errCode'],_0x15ba('0x5')));}}});}}function checkBleDeviceIsArtc(){sendData(artcProtocol['SendDataA5']('C6'),function(_0x474e78){if(_0x474e78[_0x15ba('0x4d')]===0x0){let _0x9258df=_0x474e78[_0x15ba('0x3d')];_0x5337a5[_0x15ba('0x9')]('设备信息:'+_0x9258df);if(_0x9258df['startsWith']('B50005C6')||_0x9258df['startsWith']('b50005c6')){let _0x4c3e35=_0x9258df['substring'](0x8,0xa);if(_0x4c3e35['startsWith']('01')||_0x4c3e35[_0x15ba('0x2a')]('65')||_0x4c3e35[_0x15ba('0x2a')]('6C')){typeof _connectCallBack[_0x15ba('0x4a')]===FUNCTION&&_connectCallBack[_0x15ba('0x4a')](new DevResult(ArtcBleStatusCodes['OK'],_0x15ba('0x40')));}else{typeof _connectCallBack[_0x15ba('0x1f')]===FUNCTION&&_connectCallBack[_0x15ba('0x1f')](new DevResult(ArtcBleStatusCodes['DEV_IS_NOT_ARTC'],_0x15ba('0x42')));}}else{typeof _connectCallBack['fail']===FUNCTION&&_connectCallBack['fail'](new DevResult(ArtcBleStatusCodes[_0x15ba('0x4')],'设备通道指令响应错误'));}}else{typeof _connectCallBack[_0x15ba('0x1f')]===FUNCTION&&_connectCallBack['fail'](_0x474e78);}},0x7d0);}function bleConnectionState(_0x143b59){wx['onBLEConnectionStateChange'](_0xad6ea3=>{if(artcDeviceId===_0xad6ea3['deviceId']){if(_0xad6ea3[_0x15ba('0x3')]===![]){wx[_0x15ba('0x23')]({'success'(_0x416529){_0x5337a5['info']('关闭蓝牙适配器');},'fail'(_0xd7d476){_0x5337a5[_0x15ba('0x38')]('关闭蓝牙适配器失败:'+_0xd7d476[_0x15ba('0x13')]);}});isConnectedStatus=![];if(_forceDisconnectCallBack!=null){setTimeout(()=>{typeof _forceDisconnectCallBack===FUNCTION&&_forceDisconnectCallBack(ArtcBleStatusCodes[_0x15ba('0x25')]);_forceDisconnectCallBack=null;},0x1f4);}typeof _0x143b59===FUNCTION&&_0x143b59(ArtcBleStatusCodes['DISCONNECT_OK']);}}});}function isConnected(){return isConnectedStatus;}function forceDisconnectBleDev(_0x58ab32){sendData(artcProtocol['SendDataA5']('C3'),function(_0x53ce04,_0x534321){});_forceDisconnectCallBack=_0x58ab32;}function handshake(_0x39ad0c){sendData(artcProtocol['SendDataA2'](),function(_0x5b4215){if(_0x5b4215['code']===0x0){let _0x1b01a8=_0x5b4215[_0x15ba('0x3d')];_0x5337a5['log']('握手信息:'+_0x1b01a8);if(_0x1b01a8[_0x15ba('0x2a')](_0x15ba('0x2'))){_0x5337a5[_0x15ba('0x9')]('握手成功');typeof _0x39ad0c[_0x15ba('0x4a')]===FUNCTION&&_0x39ad0c[_0x15ba('0x4a')](new DevResult(ArtcBleStatusCodes['OK'],_0x1b01a8['substring'](0x4,_0x1b01a8['length'])));}else{typeof _0x39ad0c[_0x15ba('0x1f')]===FUNCTION&&_0x39ad0c[_0x15ba('0x1f')](new DevResult(ArtcBleStatusCodes[_0x15ba('0x45')],'初始化(握手)失败'));}}else{typeof _0x39ad0c[_0x15ba('0x1f')]===FUNCTION&&_0x39ad0c['fail'](_0x5b4215);}},0x1f40);}function getBleDeviceInfo(_0x5b7018,_0x431890){sendData(artcProtocol['SendDataA5'](_0x5b7018),function(_0x2feb13){if(_0x2feb13[_0x15ba('0x4d')]===0x0){let _0x295760=_0x2feb13[_0x15ba('0x3d')];_0x5337a5['log'](_0x15ba('0x33')+_0x295760);if(_0x295760['startsWith']('B500')||_0x295760['startsWith'](_0x15ba('0x17'))){let _0x598c23=_0x295760['substring'](0x8,_0x295760['length']);typeof _0x431890[_0x15ba('0x4a')]===FUNCTION&&_0x431890[_0x15ba('0x4a')](new DevResult(ArtcBleStatusCodes['OK'],_0x598c23));}else{typeof _0x431890['fail']===FUNCTION&&_0x431890[_0x15ba('0x1f')](new DevResult(ArtcBleStatusCodes['DEV_COMMAND_RESPONSE_DATA_ERROR'],_0x295760));}}else{typeof _0x431890['fail']===FUNCTION&&_0x431890[_0x15ba('0x1f')](_0x2feb13);}},0x1f40);}function postCommand(_0x33105b,_0x4ac966,_0x1fa898,_0x5a7107){if(_0x33105b===0x0){let _0x39e73c=artcProtocol[_0x15ba('0x34')](_0x4ac966);let _0x54fb7a=artcProtocol[_0x15ba('0x22')]('00',_0x39e73c);sendData(_0x54fb7a,function(_0x4f1ae3){if(_0x4f1ae3['code']===0x0){let _0x508787=_0x4f1ae3[_0x15ba('0x3d')];_0x5337a5[_0x15ba('0x9')]('ICC返回信息:'+_0x508787);if(_0x508787['startsWith']('B300')||_0x508787[_0x15ba('0x2a')]('b300')){let _0x30358f=artcProtocol[_0x15ba('0x26')](_0x508787['slice'](0xa));typeof _0x1fa898['success']===FUNCTION&&_0x1fa898['success'](new DevResult(ArtcBleStatusCodes['OK'],_0x30358f));}else{typeof _0x1fa898[_0x15ba('0x1f')]===FUNCTION&&_0x1fa898['fail'](new DevResult(ArtcBleStatusCodes['POST_COMMAND_FAIL'],_0x508787));}}else{typeof _0x1fa898['fail']===FUNCTION&&_0x1fa898[_0x15ba('0x1f')](_0x4f1ae3);}},_0x5a7107);}else if(_0x33105b===0x1){let _0x191baa=artcProtocol['createTLV'](_0x4ac966);let _0x5272e7=artcProtocol[_0x15ba('0xa')]('00',_0x191baa);sendData(_0x5272e7,function(_0x326147){if(_0x326147['code']===0x0){let _0x208c53=_0x326147['data'];_0x5337a5['log'](_0x15ba('0x18')+_0x208c53);if(_0x208c53['startsWith'](_0x15ba('0x4b'))||_0x208c53[_0x15ba('0x2a')]('bc00')){let _0x107207=artcProtocol[_0x15ba('0x26')](_0x208c53['slice'](0xa));typeof _0x1fa898[_0x15ba('0x4a')]===FUNCTION&&_0x1fa898['success'](new DevResult(ArtcBleStatusCodes['OK'],_0x107207));}else{typeof _0x1fa898[_0x15ba('0x1f')]===FUNCTION&&_0x1fa898['fail'](new DevResult(ArtcBleStatusCodes[_0x15ba('0x31')],_0x208c53));}}else{typeof _0x1fa898[_0x15ba('0x1f')]===FUNCTION&&_0x1fa898[_0x15ba('0x1f')](_0x326147);}},_0x5a7107);}else{typeof _0x1fa898[_0x15ba('0x1f')]===FUNCTION&&_0x1fa898['fail'](new DevResult(ArtcBleStatusCodes['SEND_FAIL'],'发送数据失败'));}}module['exports']={'startScanBleDevice':startScanBleDevice,'stopScanBleDevice':stopScanBleDevice,'connectBleDev':connectBleDev,'bleConnectionState':bleConnectionState,'isConnected':isConnected,'forceDisconnectBleDev':forceDisconnectBleDev,'disconnectBle':disconnectBle,'handshake':handshake,'getBleDeviceInfo':getBleDeviceInfo,'postCommand':postCommand,'BleStatusResult':BleStatusResult};