@iotize/tap
Version:
IoTize Device client for Javascript
16 lines (14 loc) • 33.5 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@iotize/tap"),require("@iotize/tap/client/api"),require("@iotize/tap/service/core"),require("@iotize/tap/client/impl"),require("@iotize/common/byte-stream")):"function"==typeof define&&define.amd?define("@iotize/tap/service/impl/target",["exports","@iotize/tap","@iotize/tap/client/api","@iotize/tap/service/core","@iotize/tap/client/impl","@iotize/common/byte-stream"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).iotize=e.iotize||{},e.iotize.tap=e.iotize.tap||{},e.iotize.tap.service=e.iotize.tap.service||{},e.iotize.tap.service.impl=e.iotize.tap.service.impl||{},e.iotize.tap.service.impl.target={}),e.iotize.tap,e.iotize.tap.client.api,e.iotize.tap.service.core,e.iotize.tap.client.impl,e.byteStream)}(this,(function(e,t,r,o,i,n){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var a=function(e,t){return a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},a(e,t)};Object.create;function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var o,i,n=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(e){i={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function u(e,t,r){if(r||2===arguments.length)for(var o,i=0,n=t.length;i<n;i++)!o&&i in t||(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var p,c,d,l,g,h,f,y,C,T,m,b,S,R;Object.create;e.TargetCoreType=void 0,(p=e.TargetCoreType||(e.TargetCoreType={}))[p.M0_CORTEX=0]="M0_CORTEX",p[p.M1_CORTEX=1]="M1_CORTEX",e.TargetS3PProtocolConfiguration=void 0,d=e.TargetS3PProtocolConfiguration||(e.TargetS3PProtocolConfiguration={}),(c=d.Mode||(d.Mode={}))[c.EMULATION=0]="EMULATION",c[c.INDEXED=1]="INDEXED",e.TargetCanProtocolConfiguration=void 0,function(e){e[e.NORMAL=0]="NORMAL",e[e.NO_ACK=1]="NO_ACK",e[e.LISTEN=2]="LISTEN"}((g=e.TargetCanProtocolConfiguration||(e.TargetCanProtocolConfiguration={})).Mode||(g.Mode={})),(l=g.Filter||(g.Filter={}))[l.DUAL=0]="DUAL",l[l.SINGLE=1]="SINGLE",e.ModbusOptions=void 0,f=e.ModbusOptions||(e.ModbusOptions={}),(h=f.ObjectType||(f.ObjectType={}))[h.DEFAULT=0]="DEFAULT",h[h.COIL=1]="COIL",h[h.DISCRET_INPUT=2]="DISCRET_INPUT",h[h.HOLDING_REGISTER=3]="HOLDING_REGISTER",h[h.INPUT_REGISTER=4]="INPUT_REGISTER",e.SerialSettings=void 0,R=e.SerialSettings||(e.SerialSettings={}),(S=R.BitParity||(R.BitParity={}))[S.NONE=0]="NONE",S[S.ODD=1]="ODD",S[S.EVEN=2]="EVEN",(b=R.HardwareFlowControl||(R.HardwareFlowControl={}))[b.NONE=0]="NONE",b[b.RTS=1]="RTS",b[b.CTS=2]="CTS",b[b.RTS_CTS=3]="RTS_CTS",(m=R.StopBits||(R.StopBits={}))[m.ONE=0]="ONE",m[m.ONE_AND_HALF=1]="ONE_AND_HALF",m[m.TWO=2]="TWO",(T=R.PhysicalPort||(R.PhysicalPort={}))[T.NONE=0]="NONE",T[T.RS232=1]="RS232",T[T.USB=3]="USB",T[T.RS485_WITH_SIGNAL_DIRECTION=4]="RS485_WITH_SIGNAL_DIRECTION",T[T.AUTO=6]="AUTO",T[T.RS485=10]="RS485",(C=R.HandshakeDelimiter||(R.HandshakeDelimiter={}))[C.NONE=0]="NONE",C[C.CR=1]="CR",C[C.LF=2]="LF",C[C.CR_LF=3]="CR_LF",(y=R.DataBits||(R.DataBits={}))[y._7=0]="_7",y[y._8=1]="_8",y[y._9=2]="_9",i.TapStreamReader.prototype.readTargetComStats=function(){var e={};return e.nbFailCom=this.readUnsigned(4),e.nbSuccessfulCom=this.readUnsigned(4),e},i.TapStreamReader.prototype.readTargetSerialModbusProtocolConfiguration=function(){var e={};return e.modbus=this.readTargetSerialModbusProtocolConfigurationModbus(),e.serial=this.readTargetSerialModbusProtocolConfigurationSerial(),e},i.TapStreamReader.prototype.readTargetSerialModbusProtocolConfigurationModbus=function(){var e={};return e.slave=this.readUnsigned(1),this.forwardBits(3),e.offsetFirstRegister=this.readBoolean(1),e},i.TapStreamReader.prototype.readTargetSerialModbusProtocolConfigurationSerial=function(){var e={};return e.baudRate=this.readBits(20),this.forwardBits(1),this.forwardBits(1),this.forwardBits(1),this.forwardBits(1),e.physicalPort=this.readBits(4),e.stopBits=this.readBits(2),e.bitParity=this.readBits(4),e.dataBits=this.readBits(2),e.handshakeDelimiter=this.readBits(4),e.hardwareFlowControl=this.readBits(4),e.timeout=this.readUnsigned(1),e},i.TapStreamReader.prototype.readTargetS3PProtocolConfiguration=function(){var e={};return e.delay=this.readUnsigned(1),e.mode=this.readUnsigned(1),e},i.TapStreamReader.prototype.readTargetModbusTcpProtocolConfiguration=function(){var e={};return e.firstRegisterAddress=this.readUnsigned(1),e.ip=this.readStringTerminator(":"),e.port=this.readStringTerminator(":"),e.timeout=this.readString(),e},i.TapStreamReader.prototype.readTargetCanProtocolConfiguration=function(){var e={};return e.frequency=this.readUnsigned(2),e.mode=this.readUnsigned(1),e.filter=this.readUnsigned(1),e.code=this.readUnsigned(4),e.mask=this.readUnsigned(4),e},i.TapStreamReader.prototype.readModbusWriteOptions=function(){var e={};return e.options=this.readModbusOptions(),e.data=this.readBytes(),e},i.TapStreamReader.prototype.readModbusOptions=function(){var e={};return this.forwardBits(5),e.objectType=this.readBits(3),e.slave=this.readUnsigned(1),e.address=this.readUnsigned(2),e.length=this.readUnsigned(4),e.format=this.readUnsigned(1),e},i.TapStreamReader.prototype.readMemoryInfo=function(){var e={};return e.address=this.readUnsigned(4),e.length=this.readUnsigned(4),e.format=this.readUnsigned(1),e},i.TapStreamReader.prototype.readMemoryWriteInfo=function(){var e={};return e.info=this.readMemoryInfo(),e.data=this.readBytes(),e},i.TapStreamReader.prototype.readSerialSettings=function(){return{}},i.TapStreamWriter.prototype.writeTargetComStats=function(e){return this.writeUnsigned(e.nbFailCom,4),this.writeUnsigned(e.nbSuccessfulCom,4),this},i.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfiguration=function(e){return this.writeTargetSerialModbusProtocolConfigurationModbus(e.modbus),this.writeTargetSerialModbusProtocolConfigurationSerial(e.serial),this},i.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfigurationModbus=function(e){return this.writeUnsigned(e.slave,1),this.forwardBits(3),this.writeBoolean(e.offsetFirstRegister,1),this},i.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfigurationSerial=function(t){return this.writeBits(t.baudRate,20),this.forwardBits(1),this.forwardBits(1),this.forwardBits(1),this.forwardBits(1),this.writeBitsInt(i.enumKeyOrValueToNumber(t.physicalPort,e.SerialSettings.PhysicalPort),4),this.writeBitsInt(i.enumKeyOrValueToNumber(t.stopBits,e.SerialSettings.StopBits),2),this.writeBitsInt(i.enumKeyOrValueToNumber(t.bitParity,e.SerialSettings.BitParity),4),this.writeBitsInt(i.enumKeyOrValueToNumber(t.dataBits,e.SerialSettings.DataBits),2),this.writeBitsInt(i.enumKeyOrValueToNumber(t.handshakeDelimiter,e.SerialSettings.HandshakeDelimiter),4),this.writeBitsInt(i.enumKeyOrValueToNumber(t.hardwareFlowControl,e.SerialSettings.HardwareFlowControl),4),this.writeUnsigned(t.timeout,1),this},i.TapStreamWriter.prototype.writeTargetS3PProtocolConfiguration=function(t){return this.writeUnsigned(t.delay,1),this.writeBitsInt(i.enumKeyOrValueToNumber(t.mode,e.TargetS3PProtocolConfiguration.Mode),8),this},i.TapStreamWriter.prototype.writeTargetModbusTcpProtocolConfiguration=function(e){return this.writeUnsigned(e.firstRegisterAddress,1),this.writeString(e.ip+":"),this.writeString(e.port+":"),this.writeString(e.timeout),this},i.TapStreamWriter.prototype.writeTargetCanProtocolConfiguration=function(t){return this.writeUnsigned(t.frequency,2),this.writeBitsInt(i.enumKeyOrValueToNumber(t.mode,e.TargetCanProtocolConfiguration.Mode),8),this.writeBitsInt(i.enumKeyOrValueToNumber(t.filter,e.TargetCanProtocolConfiguration.Filter),8),this.writeUnsigned(t.code,4),this.writeUnsigned(t.mask,4),this},i.TapStreamWriter.prototype.writeModbusWriteOptions=function(e){return this.writeModbusOptions(e.options),this.writeBytes(e.data),this},i.TapStreamWriter.prototype.writeModbusOptions=function(r){return this.forwardBits(5),this.writeBitsInt(i.enumKeyOrValueToNumber(r.objectType,e.ModbusOptions.ObjectType),3),this.writeUnsigned(r.slave,1),this.writeUnsigned(r.address,2),this.writeUnsigned(r.length,4),this.writeBitsInt(i.enumKeyOrValueToNumber(r.format,t.VariableFormat),8),this},i.TapStreamWriter.prototype.writeMemoryInfo=function(e){return this.writeUnsigned(e.address,4),this.writeUnsigned(e.length,4),this.writeBitsInt(i.enumKeyOrValueToNumber(e.format,t.VariableFormat),8),this},i.TapStreamWriter.prototype.writeMemoryWriteInfo=function(e){return this.writeMemoryInfo(e.info),this.writeBytes(e.data),this},i.TapStreamWriter.prototype.writeSerialSettings=function(e){return this};var M=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeTargetComStats(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readTargetComStats()},e}(),v=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeTargetSerialModbusProtocolConfiguration(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readTargetSerialModbusProtocolConfiguration()},e}(),P=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeTargetS3PProtocolConfiguration(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readTargetS3PProtocolConfiguration()},e}(),O=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeTargetModbusTcpProtocolConfiguration(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readTargetModbusTcpProtocolConfiguration()},e}(),w=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeTargetCanProtocolConfiguration(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readTargetCanProtocolConfiguration()},e}(),A=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeModbusWriteOptions(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readModbusWriteOptions()},e}(),E=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeModbusOptions(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readModbusOptions()},e}(),B=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeMemoryInfo(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readMemoryInfo()},e}(),F=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeMemoryWriteInfo(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readMemoryWriteInfo()},e}(),x=function(){function e(){}return e.prototype.encode=function(e,t){return void 0===t&&(t=new i.TapStreamWriter),t.writeSerialSettings(e),t.toBytes},e.prototype.decode=function(e){return(e instanceof i.TapStreamReader?e:i.TapStreamReader.create(e)).readSerialSettings()},e}(),q=o.createEnumConverter(e.TargetCoreType,1),j=o.createEnumArrayConverter(e.TargetCoreType,1),D=new M,V=new v,I=new P,N=new O,_=new w,U=new A,W=new E,z=new B,G=new F,L=new x,K=Object.freeze({__proto__:null,targetCoreType:q,targetCoreTypeArray:j,targetComStats:D,targetSerialModbusProtocolConfiguration:V,targetS3PProtocolConfiguration:I,targetModbusTcpProtocolConfiguration:N,targetCanProtocolConfiguration:_,modbusWriteOptions:U,modbusOptions:W,memoryInfo:z,memoryWriteInfo:G,serialSettings:L}),H=Uint8Array.from([0,0,0,0,0]),k=function(){function e(){this.converter=new v}return e.prototype.decode=function(e){return this.converter.decode(this._reorderBytes(e.slice(0,e.length-H.length)))},e.prototype.encode=function(e){return n.KaitaiStreamWriter.mergeArrays(this._reorderBytes(this.converter.encode(e)),H)},e.prototype._reorderBytes=function(e){return n.KaitaiStreamWriter.mergeArrays(e.slice(0,8).reverse(),e.slice(8))},e}(),X=new k,$=Object.freeze({__proto__:null,reversedTargetSerialModbusConfiguration:X}),J=Object.assign(Object.assign(Object.assign({},o.converters),K),$),Q={getProtocol:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/protocol",path:"/1027//1",responseBodyDecoder:J.targetProtocol},setProtocol:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/protocol",path:"/1027//1",bodyEncoder:J.targetProtocol},putProtocol:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/protocol",path:"/1027//1",bodyEncoder:J.targetProtocol},getCoreType:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/core-type",path:"/1027//2",responseBodyDecoder:J.targetCoreType},putCoreType:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/core-type",path:"/1027//2",bodyEncoder:J.targetCoreType},isConnected:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/connect",path:"/1027//3",responseBodyDecoder:J.boolean},connect:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/connect",path:"/1027//3"},disconnect:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/disconnect",path:"/1027//4"},reset:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/reset",path:"/1027//5"},getFirmwareVersion:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/firmware-version",path:"/1027//6",responseBodyDecoder:J.stringVersion},putFirmwareVersion:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/firmware-version",path:"/1027//6",bodyEncoder:J.stringVersion},getVcc:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/vcc",path:"/1027//7",responseBodyDecoder:J.uint16},getMinVoltage:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/min-voltage",path:"/1027//8",responseBodyDecoder:J.uint16},putMinVoltage:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/min-voltage",path:"/1027//8",bodyEncoder:J.uint16},getMaxVoltage:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/max-voltage",path:"/1027//9",responseBodyDecoder:J.uint16},putMaxVoltage:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/max-voltage",path:"/1027//9",bodyEncoder:J.uint16},getPageSize:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/page-size",path:"/1027//10",responseBodyDecoder:J.uint32},putPageSize:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/page-size",path:"/1027//10",bodyEncoder:J.uint32},getComStats:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/com-stats",path:"/1027//11",responseBodyDecoder:J.targetComStats},clearComStats:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/com-stats",path:"/1027//11"},getAvailableProtocols:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/available-protocols",path:"/1027//20",responseBodyDecoder:J.targetProtocolArray},getSerialModbusConfiguration:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/serial-modbus-configuration",path:"/1027//21",responseBodyDecoder:J.reversedTargetSerialModbusConfiguration},setSerialModbusConfiguration:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/serial-modbus-configuration",path:"/1027//21",bodyEncoder:J.reversedTargetSerialModbusConfiguration},putSerialModbusConfiguration:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/serial-modbus-configuration",path:"/1027//21",bodyEncoder:J.reversedTargetSerialModbusConfiguration},getModbusDefaultSlaveAddress:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/modbus-default-slave-address",path:"/1027//22",responseBodyDecoder:J.uint32},putModbusDefaultSlaveAddress:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/modbus-default-slave-address",path:"/1027//22",bodyEncoder:J.uint32},getS3PConfiguration:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/s3p-configuration",path:"/1027//21",responseBodyDecoder:J.targetS3PProtocolConfiguration},setS3PConfiguration:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/s3p-configuration",path:"/1027//21",bodyEncoder:J.targetS3PProtocolConfiguration},putS3PConfiguration:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/s3p-configuration",path:"/1027//21",bodyEncoder:J.targetS3PProtocolConfiguration},getModbusTcpConfiguration:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/modbus-tcp-configuration",path:"/1027//21",responseBodyDecoder:J.targetModbusTcpProtocolConfiguration},setModbusTcpConfiguration:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/modbus-tcp-configuration",path:"/1027//21",bodyEncoder:J.targetModbusTcpProtocolConfiguration},putModbusTcpConfiguration:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/modbus-tcp-configuration",path:"/1027//21",bodyEncoder:J.targetModbusTcpProtocolConfiguration},getCanConfiguration:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/can-configuration",path:"/1027//21",responseBodyDecoder:J.targetCanProtocolConfiguration},setCanConfiguration:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/can-configuration",path:"/1027//21",bodyEncoder:J.targetCanProtocolConfiguration},putCanConfiguration:{method:r.TapRequestFrame.MethodType.PUT,pathAlias:"/target/can-configuration",path:"/1027//21",bodyEncoder:J.targetCanProtocolConfiguration},postResetKeep:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/reset-keep",path:"/1027//30"},readDebug:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/debug-access",path:"/1027//31",bodyEncoder:J.uint32},writeDebug:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/debug-access",path:"/1027//31"},getRegisterAccess:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/register-access",path:"/1027//32"},postRegisterAccess:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/register-access",path:"/1027//32"},sendReceive:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/transparent/send-receive",path:"/1027//34"},send:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/transparent/send",path:"/1027//34"},readBytes:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/transparent/read-bytes",path:"/1027//35"},modbusWrite:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/modbus/write",path:"/1027//37",bodyEncoder:J.modbusWriteOptions},modbusRead:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/modbus/read",path:"/1027//38",bodyEncoder:J.modbusOptions},getSubProtocol:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/sub-protocol",path:"/1027//40",responseBodyDecoder:J.targetProtocol},getReceivedCount:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/received-count",path:"/1027//43",responseBodyDecoder:J.uint16},readAddress:{method:r.TapRequestFrame.MethodType.GET,pathAlias:"/target/read-address",path:"/1027//33",bodyEncoder:J.memoryInfo},writeAddress:{method:r.TapRequestFrame.MethodType.POST,pathAlias:"/target/read-address",path:"/1027//33",bodyEncoder:J.memoryWriteInfo}},Y=function(e){function t(){var t=e.apply(this,u([],s(arguments)))||this;return t.resources=Q,t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}(t,e),t.prototype.getProtocol=function(){return this.serviceCallRunner.execute(this.getProtocolCall())},t.prototype.getProtocolCall=function(){return Object.assign({},this.resources.getProtocol)},t.prototype.setProtocol=function(e){return this.serviceCallRunner.execute(this.setProtocolCall(e))},t.prototype.setProtocolCall=function(e){var t=Object.assign({},this.resources.setProtocol);return t.body=e,t},t.prototype.putProtocol=function(e){return this.serviceCallRunner.execute(this.putProtocolCall(e))},t.prototype.putProtocolCall=function(e){var t=Object.assign({},this.resources.putProtocol);return t.body=e,t},t.prototype.getCoreType=function(){return this.serviceCallRunner.execute(this.getCoreTypeCall())},t.prototype.getCoreTypeCall=function(){return Object.assign({},this.resources.getCoreType)},t.prototype.putCoreType=function(e){return this.serviceCallRunner.execute(this.putCoreTypeCall(e))},t.prototype.putCoreTypeCall=function(e){var t=Object.assign({},this.resources.putCoreType);return t.body=e,t},t.prototype.isConnected=function(){return this.serviceCallRunner.execute(this.isConnectedCall())},t.prototype.isConnectedCall=function(){return Object.assign({},this.resources.isConnected)},t.prototype.connect=function(){return this.serviceCallRunner.execute(this.connectCall())},t.prototype.connectCall=function(){return Object.assign({},this.resources.connect)},t.prototype.disconnect=function(){return this.serviceCallRunner.execute(this.disconnectCall())},t.prototype.disconnectCall=function(){return Object.assign({},this.resources.disconnect)},t.prototype.reset=function(){return this.serviceCallRunner.execute(this.resetCall())},t.prototype.resetCall=function(){return Object.assign({},this.resources.reset)},t.prototype.getFirmwareVersion=function(){return this.serviceCallRunner.execute(this.getFirmwareVersionCall())},t.prototype.getFirmwareVersionCall=function(){return Object.assign({},this.resources.getFirmwareVersion)},t.prototype.putFirmwareVersion=function(e){return this.serviceCallRunner.execute(this.putFirmwareVersionCall(e))},t.prototype.putFirmwareVersionCall=function(e){var t=Object.assign({},this.resources.putFirmwareVersion);return t.body=e,t},t.prototype.getVcc=function(){return this.serviceCallRunner.execute(this.getVccCall())},t.prototype.getVccCall=function(){return Object.assign({},this.resources.getVcc)},t.prototype.getMinVoltage=function(){return this.serviceCallRunner.execute(this.getMinVoltageCall())},t.prototype.getMinVoltageCall=function(){return Object.assign({},this.resources.getMinVoltage)},t.prototype.putMinVoltage=function(e){return this.serviceCallRunner.execute(this.putMinVoltageCall(e))},t.prototype.putMinVoltageCall=function(e){var t=Object.assign({},this.resources.putMinVoltage);return t.body=e,t},t.prototype.getMaxVoltage=function(){return this.serviceCallRunner.execute(this.getMaxVoltageCall())},t.prototype.getMaxVoltageCall=function(){return Object.assign({},this.resources.getMaxVoltage)},t.prototype.putMaxVoltage=function(e){return this.serviceCallRunner.execute(this.putMaxVoltageCall(e))},t.prototype.putMaxVoltageCall=function(e){var t=Object.assign({},this.resources.putMaxVoltage);return t.body=e,t},t.prototype.getPageSize=function(){return this.serviceCallRunner.execute(this.getPageSizeCall())},t.prototype.getPageSizeCall=function(){return Object.assign({},this.resources.getPageSize)},t.prototype.putPageSize=function(e){return this.serviceCallRunner.execute(this.putPageSizeCall(e))},t.prototype.putPageSizeCall=function(e){var t=Object.assign({},this.resources.putPageSize);return t.body=e,t},t.prototype.getComStats=function(){return this.serviceCallRunner.execute(this.getComStatsCall())},t.prototype.getComStatsCall=function(){return Object.assign({},this.resources.getComStats)},t.prototype.clearComStats=function(){return this.serviceCallRunner.execute(this.clearComStatsCall())},t.prototype.clearComStatsCall=function(){return Object.assign({},this.resources.clearComStats)},t.prototype.getAvailableProtocols=function(){return this.serviceCallRunner.execute(this.getAvailableProtocolsCall())},t.prototype.getAvailableProtocolsCall=function(){return Object.assign({},this.resources.getAvailableProtocols)},t.prototype.getSerialModbusConfiguration=function(){return this.serviceCallRunner.execute(this.getSerialModbusConfigurationCall())},t.prototype.getSerialModbusConfigurationCall=function(){return Object.assign({},this.resources.getSerialModbusConfiguration)},t.prototype.setSerialModbusConfiguration=function(e){return this.serviceCallRunner.execute(this.setSerialModbusConfigurationCall(e))},t.prototype.setSerialModbusConfigurationCall=function(e){var t=Object.assign({},this.resources.setSerialModbusConfiguration);return t.body=e,t},t.prototype.putSerialModbusConfiguration=function(e){return this.serviceCallRunner.execute(this.putSerialModbusConfigurationCall(e))},t.prototype.putSerialModbusConfigurationCall=function(e){var t=Object.assign({},this.resources.putSerialModbusConfiguration);return t.body=e,t},t.prototype.getModbusDefaultSlaveAddress=function(){return this.serviceCallRunner.execute(this.getModbusDefaultSlaveAddressCall())},t.prototype.getModbusDefaultSlaveAddressCall=function(){return Object.assign({},this.resources.getModbusDefaultSlaveAddress)},t.prototype.putModbusDefaultSlaveAddress=function(e){return this.serviceCallRunner.execute(this.putModbusDefaultSlaveAddressCall(e))},t.prototype.putModbusDefaultSlaveAddressCall=function(e){var t=Object.assign({},this.resources.putModbusDefaultSlaveAddress);return t.body=e,t},t.prototype.getS3PConfiguration=function(){return this.serviceCallRunner.execute(this.getS3PConfigurationCall())},t.prototype.getS3PConfigurationCall=function(){return Object.assign({},this.resources.getS3PConfiguration)},t.prototype.setS3PConfiguration=function(e){return this.serviceCallRunner.execute(this.setS3PConfigurationCall(e))},t.prototype.setS3PConfigurationCall=function(e){var t=Object.assign({},this.resources.setS3PConfiguration);return t.body=e,t},t.prototype.putS3PConfiguration=function(e){return this.serviceCallRunner.execute(this.putS3PConfigurationCall(e))},t.prototype.putS3PConfigurationCall=function(e){var t=Object.assign({},this.resources.putS3PConfiguration);return t.body=e,t},t.prototype.getModbusTcpConfiguration=function(){return this.serviceCallRunner.execute(this.getModbusTcpConfigurationCall())},t.prototype.getModbusTcpConfigurationCall=function(){return Object.assign({},this.resources.getModbusTcpConfiguration)},t.prototype.setModbusTcpConfiguration=function(e){return this.serviceCallRunner.execute(this.setModbusTcpConfigurationCall(e))},t.prototype.setModbusTcpConfigurationCall=function(e){var t=Object.assign({},this.resources.setModbusTcpConfiguration);return t.body=e,t},t.prototype.putModbusTcpConfiguration=function(e){return this.serviceCallRunner.execute(this.putModbusTcpConfigurationCall(e))},t.prototype.putModbusTcpConfigurationCall=function(e){var t=Object.assign({},this.resources.putModbusTcpConfiguration);return t.body=e,t},t.prototype.getCanConfiguration=function(){return this.serviceCallRunner.execute(this.getCanConfigurationCall())},t.prototype.getCanConfigurationCall=function(){return Object.assign({},this.resources.getCanConfiguration)},t.prototype.setCanConfiguration=function(e){return this.serviceCallRunner.execute(this.setCanConfigurationCall(e))},t.prototype.setCanConfigurationCall=function(e){var t=Object.assign({},this.resources.setCanConfiguration);return t.body=e,t},t.prototype.putCanConfiguration=function(e){return this.serviceCallRunner.execute(this.putCanConfigurationCall(e))},t.prototype.putCanConfigurationCall=function(e){var t=Object.assign({},this.resources.putCanConfiguration);return t.body=e,t},t.prototype.postResetKeep=function(){return this.serviceCallRunner.execute(this.postResetKeepCall())},t.prototype.postResetKeepCall=function(){return Object.assign({},this.resources.postResetKeep)},t.prototype.readDebug=function(e){return this.serviceCallRunner.execute(this.readDebugCall(e))},t.prototype.readDebugCall=function(e){var t=Object.assign({},this.resources.readDebug);return t.body=e,t},t.prototype.writeDebug=function(){return this.serviceCallRunner.execute(this.writeDebugCall())},t.prototype.writeDebugCall=function(){return Object.assign({},this.resources.writeDebug)},t.prototype.getRegisterAccess=function(){return this.serviceCallRunner.execute(this.getRegisterAccessCall())},t.prototype.getRegisterAccessCall=function(){return Object.assign({},this.resources.getRegisterAccess)},t.prototype.postRegisterAccess=function(){return this.serviceCallRunner.execute(this.postRegisterAccessCall())},t.prototype.postRegisterAccessCall=function(){return Object.assign({},this.resources.postRegisterAccess)},t.prototype.sendReceive=function(e){return this.serviceCallRunner.execute(this.sendReceiveCall(e))},t.prototype.sendReceiveCall=function(e){var t=Object.assign({},this.resources.sendReceive);return t.body=e,t},t.prototype.send=function(e){return this.serviceCallRunner.execute(this.sendCall(e))},t.prototype.sendCall=function(e){var t=Object.assign({},this.resources.send);return t.body=e,t},t.prototype.readBytes=function(){return this.serviceCallRunner.execute(this.readBytesCall())},t.prototype.readBytesCall=function(){return Object.assign({},this.resources.readBytes)},t.prototype.modbusWrite=function(e){return this.serviceCallRunner.execute(this.modbusWriteCall(e))},t.prototype.modbusWriteCall=function(e){var t=Object.assign({},this.resources.modbusWrite);return t.body=e,t},t.prototype.modbusRead=function(e){return this.serviceCallRunner.execute(this.modbusReadCall(e))},t.prototype.modbusReadCall=function(e){var t=Object.assign({},this.resources.modbusRead);return t.body=e,t},t.prototype.getSubProtocol=function(){return this.serviceCallRunner.execute(this.getSubProtocolCall())},t.prototype.getSubProtocolCall=function(){return Object.assign({},this.resources.getSubProtocol)},t.prototype.getReceivedCount=function(){return this.serviceCallRunner.execute(this.getReceivedCountCall())},t.prototype.getReceivedCountCall=function(){return Object.assign({},this.resources.getReceivedCount)},t.prototype.readAddress=function(e){return this.serviceCallRunner.execute(this.readAddressCall(e))},t.prototype.readAddressCall=function(e){var t=Object.assign({},this.resources.readAddress);return t.body=e,t},t.prototype.writeAddress=function(e){return this.serviceCallRunner.execute(this.writeAddressCall(e))},t.prototype.writeAddressCall=function(e){var t=Object.assign({},this.resources.writeAddress);return t.body=e,t},t}(t.AbstractService),Z=t.extendServiceContainer("target",Y);e.MemoryInfoConverter=B,e.MemoryWriteInfoConverter=F,e.ModbusOptionsConverter=E,e.ModbusWriteOptionsConverter=A,e.ReversedTargetSerialModbusConfigurationConverter=k,e.SerialSettingsConverter=x,e.TARGET_SERVICE_CALLS=Q,e.TargetCanProtocolConfigurationConverter=w,e.TargetComStatsConverter=M,e.TargetModbusTcpProtocolConfigurationConverter=O,e.TargetResourceMetaData={"/target/protocol":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetProtocol"}}},"/target/core-type":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetCoreType"}}},"/target/firmware-version":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"string",format:"version"}}},"/target/min-voltage":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/target/max-voltage":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint16"}}},"/target/page-size":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}},"/target/serial-modbus-configuration":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetSerialModbusProtocolConfiguration"}}},"/target/modbus-default-slave-address":{put:{minApiVersion:1,configModeRequired:!0,schema:{type:"integer",format:"uint32"}}},"/target/s3p-configuration":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetS3PProtocolConfiguration"}}},"/target/modbus-tcp-configuration":{put:{minApiVersion:1,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetModbusTcpProtocolConfiguration"}}},"/target/can-configuration":{put:{minApiVersion:2.6,configModeRequired:!0,schema:{$ref:"./definitions.yaml#/TargetCanProtocolConfiguration"}}}},e.TargetS3PProtocolConfigurationConverter=P,e.TargetSerialModbusProtocolConfigurationConverter=v,e.TargetService=Y,e._TAP_SERVICE_EXTENSION_TARGET_=Z,e.reversedTargetSerialModbusConfiguration=X,e.targetConverters=K,Object.defineProperty(e,"__esModule",{value:!0})}));
//# sourceMappingURL=iotize-tap-service-impl-target.umd.min.js.map