@iotize/tap
Version:
IoTize Device client for Javascript
2,707 lines • 99.5 kB
JavaScript
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@iotize/tap'), require('@iotize/tap/client/api'), require('@iotize/tap/service/core'), require('@iotize/tap/client/impl'), require('@iotize/common/byte-stream')) :
typeof define === 'function' && 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'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.iotize = global.iotize || {}, global.iotize.tap = global.iotize.tap || {}, global.iotize.tap.service = global.iotize.tap.service || {}, global.iotize.tap.service.impl = global.iotize.tap.service.impl || {}, global.iotize.tap.service.impl.target = {}), global.iotize.tap, global.iotize.tap.client.api, global.iotize.tap.service.core, global.iotize.tap.client.impl, global.byteStream));
})(this, (function (exports, tap, api, core, impl, byteStream) { '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.
***************************************************************************** */
/* global Reflect, Promise */
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b)
if (Object.prototype.hasOwnProperty.call(b, p))
d[p] = b[p]; };
return extendStatics(d, b);
};
function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
var __assign = function () {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
function __rest(s, e) {
var t = {};
for (var p in s)
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
r = Reflect.decorate(decorators, target, key, desc);
else
for (var i = decorators.length - 1; i >= 0; i--)
if (d = decorators[i])
r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); };
}
function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
return Reflect.metadata(metadataKey, metadataValue);
}
function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try {
step(generator.next(value));
}
catch (e) {
reject(e);
} }
function rejected(value) { try {
step(generator["throw"](value));
}
catch (e) {
reject(e);
} }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
function __generator(thisArg, body) {
var _ = { label: 0, sent: function () { if (t[0] & 1)
throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f)
throw new TypeError("Generator is already executing.");
while (_)
try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
return t;
if (y = 0, t)
op = [op[0] & 2, t.value];
switch (op[0]) {
case 0:
case 1:
t = op;
break;
case 4:
_.label++;
return { value: op[1], done: false };
case 5:
_.label++;
y = op[1];
op = [0];
continue;
case 7:
op = _.ops.pop();
_.trys.pop();
continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
_ = 0;
continue;
}
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
_.label = op[1];
break;
}
if (op[0] === 6 && _.label < t[1]) {
_.label = t[1];
t = op;
break;
}
if (t && _.label < t[2]) {
_.label = t[2];
_.ops.push(op);
break;
}
if (t[2])
_.ops.pop();
_.trys.pop();
continue;
}
op = body.call(thisArg, _);
}
catch (e) {
op = [6, e];
y = 0;
}
finally {
f = t = 0;
}
if (op[0] & 5)
throw op[1];
return { value: op[0] ? op[1] : void 0, done: true };
}
}
var __createBinding = Object.create ? (function (o, m, k, k2) {
if (k2 === undefined)
k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
}) : (function (o, m, k, k2) {
if (k2 === undefined)
k2 = k;
o[k2] = m[k];
});
function __exportStar(m, o) {
for (var p in m)
if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
__createBinding(o, m, p);
}
function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m)
return m.call(o);
if (o && typeof o.length === "number")
return {
next: function () {
if (o && i >= o.length)
o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m)
return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
ar.push(r.value);
}
catch (error) {
e = { error: error };
}
finally {
try {
if (r && !r.done && (m = i["return"]))
m.call(i);
}
finally {
if (e)
throw e.error;
}
}
return ar;
}
/** @deprecated */
function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++)
s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2)
for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar)
ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
function verb(n) { if (g[n])
i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
function resume(n, v) { try {
step(g[n](v));
}
catch (e) {
settle(q[0][3], e);
} }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length)
resume(q[0][0], q[0][1]); }
}
function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
}
function __asyncValues(o) {
if (!Symbol.asyncIterator)
throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
}
function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) {
Object.defineProperty(cooked, "raw", { value: raw });
}
else {
cooked.raw = raw;
}
return cooked;
}
;
var __setModuleDefault = Object.create ? (function (o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function (o, v) {
o["default"] = v;
};
function __importStar(mod) {
if (mod && mod.__esModule)
return mod;
var result = {};
if (mod != null)
for (var k in mod)
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
__createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
}
function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f)
throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m")
throw new TypeError("Private method is not writable");
if (kind === "a" && !f)
throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
exports.TargetCoreType = void 0;
(function (TargetCoreType) {
TargetCoreType[TargetCoreType["M0_CORTEX"] = 0] = "M0_CORTEX";
TargetCoreType[TargetCoreType["M1_CORTEX"] = 1] = "M1_CORTEX";
})(exports.TargetCoreType || (exports.TargetCoreType = {}));
exports.TargetS3PProtocolConfiguration = void 0;
(function (TargetS3PProtocolConfiguration) {
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var Mode;
(function (Mode) {
Mode[Mode["EMULATION"] = 0] = "EMULATION";
Mode[Mode["INDEXED"] = 1] = "INDEXED";
})(Mode = TargetS3PProtocolConfiguration.Mode || (TargetS3PProtocolConfiguration.Mode = {}));
})(exports.TargetS3PProtocolConfiguration || (exports.TargetS3PProtocolConfiguration = {}));
exports.TargetCanProtocolConfiguration = void 0;
(function (TargetCanProtocolConfiguration) {
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var Mode;
(function (Mode) {
Mode[Mode["NORMAL"] = 0] = "NORMAL";
Mode[Mode["NO_ACK"] = 1] = "NO_ACK";
Mode[Mode["LISTEN"] = 2] = "LISTEN";
})(Mode = TargetCanProtocolConfiguration.Mode || (TargetCanProtocolConfiguration.Mode = {}));
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var Filter;
(function (Filter) {
Filter[Filter["DUAL"] = 0] = "DUAL";
Filter[Filter["SINGLE"] = 1] = "SINGLE";
})(Filter = TargetCanProtocolConfiguration.Filter || (TargetCanProtocolConfiguration.Filter = {}));
})(exports.TargetCanProtocolConfiguration || (exports.TargetCanProtocolConfiguration = {}));
exports.ModbusOptions = void 0;
(function (ModbusOptions) {
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var ObjectType;
(function (ObjectType) {
ObjectType[ObjectType["DEFAULT"] = 0] = "DEFAULT";
ObjectType[ObjectType["COIL"] = 1] = "COIL";
ObjectType[ObjectType["DISCRET_INPUT"] = 2] = "DISCRET_INPUT";
ObjectType[ObjectType["HOLDING_REGISTER"] = 3] = "HOLDING_REGISTER";
ObjectType[ObjectType["INPUT_REGISTER"] = 4] = "INPUT_REGISTER";
})(ObjectType = ModbusOptions.ObjectType || (ModbusOptions.ObjectType = {}));
})(exports.ModbusOptions || (exports.ModbusOptions = {}));
exports.SerialSettings = void 0;
(function (SerialSettings) {
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var BitParity;
(function (BitParity) {
BitParity[BitParity["NONE"] = 0] = "NONE";
BitParity[BitParity["ODD"] = 1] = "ODD";
BitParity[BitParity["EVEN"] = 2] = "EVEN";
})(BitParity = SerialSettings.BitParity || (SerialSettings.BitParity = {}));
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var HardwareFlowControl;
(function (HardwareFlowControl) {
HardwareFlowControl[HardwareFlowControl["NONE"] = 0] = "NONE";
HardwareFlowControl[HardwareFlowControl["RTS"] = 1] = "RTS";
HardwareFlowControl[HardwareFlowControl["CTS"] = 2] = "CTS";
HardwareFlowControl[HardwareFlowControl["RTS_CTS"] = 3] = "RTS_CTS";
})(HardwareFlowControl = SerialSettings.HardwareFlowControl || (SerialSettings.HardwareFlowControl = {}));
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var StopBits;
(function (StopBits) {
StopBits[StopBits["ONE"] = 0] = "ONE";
StopBits[StopBits["ONE_AND_HALF"] = 1] = "ONE_AND_HALF";
StopBits[StopBits["TWO"] = 2] = "TWO";
})(StopBits = SerialSettings.StopBits || (SerialSettings.StopBits = {}));
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var PhysicalPort;
(function (PhysicalPort) {
PhysicalPort[PhysicalPort["NONE"] = 0] = "NONE";
PhysicalPort[PhysicalPort["RS232"] = 1] = "RS232";
PhysicalPort[PhysicalPort["USB"] = 3] = "USB";
PhysicalPort[PhysicalPort["RS485_WITH_SIGNAL_DIRECTION"] = 4] = "RS485_WITH_SIGNAL_DIRECTION";
PhysicalPort[PhysicalPort["AUTO"] = 6] = "AUTO";
PhysicalPort[PhysicalPort["RS485"] = 10] = "RS485";
})(PhysicalPort = SerialSettings.PhysicalPort || (SerialSettings.PhysicalPort = {}));
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var HandshakeDelimiter;
(function (HandshakeDelimiter) {
HandshakeDelimiter[HandshakeDelimiter["NONE"] = 0] = "NONE";
HandshakeDelimiter[HandshakeDelimiter["CR"] = 1] = "CR";
HandshakeDelimiter[HandshakeDelimiter["LF"] = 2] = "LF";
HandshakeDelimiter[HandshakeDelimiter["CR_LF"] = 3] = "CR_LF";
})(HandshakeDelimiter = SerialSettings.HandshakeDelimiter || (SerialSettings.HandshakeDelimiter = {}));
/* tslint:disable */
/**
* This file was automatically generated by json-schema-to-typescript.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run json-schema-to-typescript to regenerate this file.
*/
var DataBits;
(function (DataBits) {
DataBits[DataBits["_7"] = 0] = "_7";
DataBits[DataBits["_8"] = 1] = "_8";
DataBits[DataBits["_9"] = 2] = "_9";
})(DataBits = SerialSettings.DataBits || (SerialSettings.DataBits = {}));
})(exports.SerialSettings || (exports.SerialSettings = {}));
/**
* Generated file. Do not edit
*/
impl.TapStreamReader.prototype.readTargetComStats = function () {
var model = {};
model.nbFailCom = this.readUnsigned(4);
model.nbSuccessfulCom = this.readUnsigned(4);
return model;
};
impl.TapStreamReader.prototype.readTargetSerialModbusProtocolConfiguration =
function () {
var model = {};
model.modbus = this.readTargetSerialModbusProtocolConfigurationModbus();
model.serial = this.readTargetSerialModbusProtocolConfigurationSerial();
return model;
};
impl.TapStreamReader.prototype.readTargetSerialModbusProtocolConfigurationModbus =
function () {
var model = {};
model.slave = this.readUnsigned(1);
this.forwardBits(3);
model.offsetFirstRegister = this.readBoolean(1);
return model;
};
impl.TapStreamReader.prototype.readTargetSerialModbusProtocolConfigurationSerial =
function () {
var model = {};
model.baudRate = this.readBits(20);
this.forwardBits(1);
this.forwardBits(1);
this.forwardBits(1);
this.forwardBits(1);
model.physicalPort = this.readBits(4);
model.stopBits = this.readBits(2);
model.bitParity = this.readBits(4);
model.dataBits = this.readBits(2);
model.handshakeDelimiter = this.readBits(4);
model.hardwareFlowControl = this.readBits(4);
model.timeout = this.readUnsigned(1);
return model;
};
impl.TapStreamReader.prototype.readTargetS3PProtocolConfiguration =
function () {
var model = {};
model.delay = this.readUnsigned(1);
model.mode = this.readUnsigned(1);
return model;
};
impl.TapStreamReader.prototype.readTargetModbusTcpProtocolConfiguration =
function () {
var model = {};
model.firstRegisterAddress = this.readUnsigned(1);
model.ip = this.readStringTerminator(':');
model.port = this.readStringTerminator(':');
model.timeout = this.readString();
return model;
};
impl.TapStreamReader.prototype.readTargetCanProtocolConfiguration =
function () {
var model = {};
model.frequency = this.readUnsigned(2);
model.mode = this.readUnsigned(1);
model.filter = this.readUnsigned(1);
model.code = this.readUnsigned(4);
model.mask = this.readUnsigned(4);
return model;
};
impl.TapStreamReader.prototype.readModbusWriteOptions =
function () {
var model = {};
model.options = this.readModbusOptions();
model.data = this.readBytes();
return model;
};
impl.TapStreamReader.prototype.readModbusOptions = function () {
var model = {};
this.forwardBits(5);
model.objectType = this.readBits(3);
model.slave = this.readUnsigned(1);
model.address = this.readUnsigned(2);
model.length = this.readUnsigned(4);
model.format = this.readUnsigned(1);
return model;
};
impl.TapStreamReader.prototype.readMemoryInfo = function () {
var model = {};
model.address = this.readUnsigned(4);
model.length = this.readUnsigned(4);
model.format = this.readUnsigned(1);
return model;
};
impl.TapStreamReader.prototype.readMemoryWriteInfo = function () {
var model = {};
model.info = this.readMemoryInfo();
model.data = this.readBytes();
return model;
};
impl.TapStreamReader.prototype.readSerialSettings = function () {
var model = {};
return model;
};
// TapStreamWriter.prototype.write(model: TargetComStats) : TapStreamWriter{
// return this.writeTargetComStats(model)
// }
impl.TapStreamWriter.prototype.writeTargetComStats = function (model) {
this.writeUnsigned(model.nbFailCom, 4);
this.writeUnsigned(model.nbSuccessfulCom, 4);
return this;
};
// TapStreamWriter.prototype.write(model: TargetSerialModbusProtocolConfiguration) : TapStreamWriter{
// return this.writeTargetSerialModbusProtocolConfiguration(model)
// }
impl.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfiguration =
function (model) {
this.writeTargetSerialModbusProtocolConfigurationModbus(model.modbus);
this.writeTargetSerialModbusProtocolConfigurationSerial(model.serial);
return this;
};
impl.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfigurationModbus =
function (model) {
this.writeUnsigned(model.slave, 1);
this.forwardBits(3);
this.writeBoolean(model.offsetFirstRegister, 1);
return this;
};
impl.TapStreamWriter.prototype.writeTargetSerialModbusProtocolConfigurationSerial =
function (model) {
this.writeBits(model.baudRate, 20);
this.forwardBits(1);
this.forwardBits(1);
this.forwardBits(1);
this.forwardBits(1);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.physicalPort, exports.SerialSettings.PhysicalPort), 4);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.stopBits, exports.SerialSettings.StopBits), 2);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.bitParity, exports.SerialSettings.BitParity), 4);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.dataBits, exports.SerialSettings.DataBits), 2);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.handshakeDelimiter, exports.SerialSettings.HandshakeDelimiter), 4);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.hardwareFlowControl, exports.SerialSettings.HardwareFlowControl), 4);
this.writeUnsigned(model.timeout, 1);
return this;
};
// TapStreamWriter.prototype.write(model: TargetS3PProtocolConfiguration) : TapStreamWriter{
// return this.writeTargetS3PProtocolConfiguration(model)
// }
impl.TapStreamWriter.prototype.writeTargetS3PProtocolConfiguration = function (model) {
this.writeUnsigned(model.delay, 1);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.mode, exports.TargetS3PProtocolConfiguration.Mode), 8);
return this;
};
// TapStreamWriter.prototype.write(model: TargetModbusTcpProtocolConfiguration) : TapStreamWriter{
// return this.writeTargetModbusTcpProtocolConfiguration(model)
// }
impl.TapStreamWriter.prototype.writeTargetModbusTcpProtocolConfiguration = function (model) {
this.writeUnsigned(model.firstRegisterAddress, 1);
this.writeString(model.ip + ':');
this.writeString(model.port + ':');
this.writeString(model.timeout);
return this;
};
// TapStreamWriter.prototype.write(model: TargetCanProtocolConfiguration) : TapStreamWriter{
// return this.writeTargetCanProtocolConfiguration(model)
// }
impl.TapStreamWriter.prototype.writeTargetCanProtocolConfiguration = function (model) {
this.writeUnsigned(model.frequency, 2);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.mode, exports.TargetCanProtocolConfiguration.Mode), 8);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.filter, exports.TargetCanProtocolConfiguration.Filter), 8);
this.writeUnsigned(model.code, 4);
this.writeUnsigned(model.mask, 4);
return this;
};
// TapStreamWriter.prototype.write(model: ModbusWriteOptions) : TapStreamWriter{
// return this.writeModbusWriteOptions(model)
// }
impl.TapStreamWriter.prototype.writeModbusWriteOptions = function (model) {
this.writeModbusOptions(model.options);
this.writeBytes(model.data);
return this;
};
// TapStreamWriter.prototype.write(model: ModbusOptions) : TapStreamWriter{
// return this.writeModbusOptions(model)
// }
impl.TapStreamWriter.prototype.writeModbusOptions = function (model) {
this.forwardBits(5);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.objectType, exports.ModbusOptions.ObjectType), 3);
this.writeUnsigned(model.slave, 1);
this.writeUnsigned(model.address, 2);
this.writeUnsigned(model.length, 4);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.format, tap.VariableFormat), 8);
return this;
};
// TapStreamWriter.prototype.write(model: MemoryInfo) : TapStreamWriter{
// return this.writeMemoryInfo(model)
// }
impl.TapStreamWriter.prototype.writeMemoryInfo = function (model) {
this.writeUnsigned(model.address, 4);
this.writeUnsigned(model.length, 4);
this.writeBitsInt(impl.enumKeyOrValueToNumber(model.format, tap.VariableFormat), 8);
return this;
};
// TapStreamWriter.prototype.write(model: MemoryWriteInfo) : TapStreamWriter{
// return this.writeMemoryWriteInfo(model)
// }
impl.TapStreamWriter.prototype.writeMemoryWriteInfo = function (model) {
this.writeMemoryInfo(model.info);
this.writeBytes(model.data);
return this;
};
// TapStreamWriter.prototype.write(model: SerialSettings) : TapStreamWriter{
// return this.writeSerialSettings(model)
// }
impl.TapStreamWriter.prototype.writeSerialSettings = function (model) {
return this;
};
/**
* Generated file. Do not edit
*/
var TargetComStatsConverter = /** @class */ (function () {
function TargetComStatsConverter() {
}
TargetComStatsConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeTargetComStats(model);
return stream.toBytes;
};
TargetComStatsConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readTargetComStats();
};
return TargetComStatsConverter;
}());
var TargetSerialModbusProtocolConfigurationConverter = /** @class */ (function () {
function TargetSerialModbusProtocolConfigurationConverter() {
}
TargetSerialModbusProtocolConfigurationConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeTargetSerialModbusProtocolConfiguration(model);
return stream.toBytes;
};
TargetSerialModbusProtocolConfigurationConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readTargetSerialModbusProtocolConfiguration();
};
return TargetSerialModbusProtocolConfigurationConverter;
}());
var TargetS3PProtocolConfigurationConverter = /** @class */ (function () {
function TargetS3PProtocolConfigurationConverter() {
}
TargetS3PProtocolConfigurationConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeTargetS3PProtocolConfiguration(model);
return stream.toBytes;
};
TargetS3PProtocolConfigurationConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readTargetS3PProtocolConfiguration();
};
return TargetS3PProtocolConfigurationConverter;
}());
var TargetModbusTcpProtocolConfigurationConverter = /** @class */ (function () {
function TargetModbusTcpProtocolConfigurationConverter() {
}
TargetModbusTcpProtocolConfigurationConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeTargetModbusTcpProtocolConfiguration(model);
return stream.toBytes;
};
TargetModbusTcpProtocolConfigurationConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readTargetModbusTcpProtocolConfiguration();
};
return TargetModbusTcpProtocolConfigurationConverter;
}());
var TargetCanProtocolConfigurationConverter = /** @class */ (function () {
function TargetCanProtocolConfigurationConverter() {
}
TargetCanProtocolConfigurationConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeTargetCanProtocolConfiguration(model);
return stream.toBytes;
};
TargetCanProtocolConfigurationConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readTargetCanProtocolConfiguration();
};
return TargetCanProtocolConfigurationConverter;
}());
var ModbusWriteOptionsConverter = /** @class */ (function () {
function ModbusWriteOptionsConverter() {
}
ModbusWriteOptionsConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeModbusWriteOptions(model);
return stream.toBytes;
};
ModbusWriteOptionsConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readModbusWriteOptions();
};
return ModbusWriteOptionsConverter;
}());
var ModbusOptionsConverter = /** @class */ (function () {
function ModbusOptionsConverter() {
}
ModbusOptionsConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeModbusOptions(model);
return stream.toBytes;
};
ModbusOptionsConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readModbusOptions();
};
return ModbusOptionsConverter;
}());
var MemoryInfoConverter = /** @class */ (function () {
function MemoryInfoConverter() {
}
MemoryInfoConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeMemoryInfo(model);
return stream.toBytes;
};
MemoryInfoConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readMemoryInfo();
};
return MemoryInfoConverter;
}());
var MemoryWriteInfoConverter = /** @class */ (function () {
function MemoryWriteInfoConverter() {
}
MemoryWriteInfoConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeMemoryWriteInfo(model);
return stream.toBytes;
};
MemoryWriteInfoConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readMemoryWriteInfo();
};
return MemoryWriteInfoConverter;
}());
var SerialSettingsConverter = /** @class */ (function () {
function SerialSettingsConverter() {
}
SerialSettingsConverter.prototype.encode = function (model, stream) {
if (stream === void 0) { stream = new impl.TapStreamWriter(); }
stream.writeSerialSettings(model);
return stream.toBytes;
};
SerialSettingsConverter.prototype.decode = function (data) {
var stream = data instanceof impl.TapStreamReader ? data : impl.TapStreamReader.create(data);
return stream.readSerialSettings();
};
return SerialSettingsConverter;
}());
/**
* Generated file. Do not edit
*/
var targetCoreType = core.createEnumConverter(exports.TargetCoreType, 1);
var targetCoreTypeArray = core.createEnumArrayConverter(exports.TargetCoreType, 1);
var targetComStats = new TargetComStatsConverter();
var targetSerialModbusProtocolConfiguration = new TargetSerialModbusProtocolConfigurationConverter();
var targetS3PProtocolConfiguration = new TargetS3PProtocolConfigurationConverter();
var targetModbusTcpProtocolConfiguration = new TargetModbusTcpProtocolConfigurationConverter();
var targetCanProtocolConfiguration = new TargetCanProtocolConfigurationConverter();
var modbusWriteOptions = new ModbusWriteOptionsConverter();
var modbusOptions = new ModbusOptionsConverter();
var memoryInfo = new MemoryInfoConverter();
var memoryWriteInfo = new MemoryWriteInfoConverter();
var serialSettings = new SerialSettingsConverter();
var serviceConverters = /*#__PURE__*/Object.freeze({
__proto__: null,
targetCoreType: targetCoreType,
targetCoreTypeArray: targetCoreTypeArray,
targetComStats: targetComStats,
targetSerialModbusProtocolConfiguration: targetSerialModbusProtocolConfiguration,
targetS3PProtocolConfiguration: targetS3PProtocolConfiguration,
targetModbusTcpProtocolConfiguration: targetModbusTcpProtocolConfiguration,
targetCanProtocolConfiguration: targetCanProtocolConfiguration,
modbusWriteOptions: modbusWriteOptions,
modbusOptions: modbusOptions,
memoryInfo: memoryInfo,
memoryWriteInfo: memoryWriteInfo,
serialSettings: serialSettings
});
var PROTOCOL_CONF_CTR_LENGHT = 8;
var END_OF_USB_ALIASES = Uint8Array.from([0, 0, 0, 0, 0]);
var ReversedTargetSerialModbusConfigurationConverter = /** @class */ (function () {
function ReversedTargetSerialModbusConfigurationConverter() {
this.converter = new TargetSerialModbusProtocolConfigurationConverter();
}
ReversedTargetSerialModbusConfigurationConverter.prototype.decode = function (data) {
return this.converter.decode(this._reorderBytes(data.slice(0, data.length - END_OF_USB_ALIASES.length)));
};
ReversedTargetSerialModbusConfigurationConverter.prototype.encode = function (settings) {
return byteStream.KaitaiStreamWriter.mergeArrays(this._reorderBytes(this.converter.encode(settings)), END_OF_USB_ALIASES);
};
ReversedTargetSerialModbusConfigurationConverter.prototype._reorderBytes = function (data) {
return byteStream.KaitaiStreamWriter.mergeArrays(data.slice(0, PROTOCOL_CONF_CTR_LENGHT).reverse(), data.slice(PROTOCOL_CONF_CTR_LENGHT));
};
return ReversedTargetSerialModbusConfigurationConverter;
}());
var reversedTargetSerialModbusConfiguration = new ReversedTargetSerialModbusConfigurationConverter();
var customConverters = /*#__PURE__*/Object.freeze({
__proto__: null,
reversedTargetSerialModbusConfiguration: reversedTargetSerialModbusConfiguration
});
/**
* Generated file. Do not edit
*/
var allConverters = Object.assign(Object.assign(Object.assign({}, core.converters), serviceConverters), customConverters);
var SERVICE_CALLS = {
getProtocol: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/protocol',
path: '/1027//1',
responseBodyDecoder: allConverters.targetProtocol,
},
setProtocol: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/protocol',
path: '/1027//1',
bodyEncoder: allConverters.targetProtocol,
},
putProtocol: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/protocol',
path: '/1027//1',
bodyEncoder: allConverters.targetProtocol,
},
getCoreType: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/core-type',
path: '/1027//2',
responseBodyDecoder: allConverters.targetCoreType,
},
putCoreType: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/core-type',
path: '/1027//2',
bodyEncoder: allConverters.targetCoreType,
},
isConnected: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/connect',
path: '/1027//3',
responseBodyDecoder: allConverters.boolean,
},
connect: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/connect',
path: '/1027//3',
},
disconnect: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/disconnect',
path: '/1027//4',
},
reset: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/reset',
path: '/1027//5',
},
getFirmwareVersion: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/firmware-version',
path: '/1027//6',
responseBodyDecoder: allConverters.stringVersion,
},
putFirmwareVersion: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/firmware-version',
path: '/1027//6',
bodyEncoder: allConverters.stringVersion,
},
getVcc: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/vcc',
path: '/1027//7',
responseBodyDecoder: allConverters.uint16,
},
getMinVoltage: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/min-voltage',
path: '/1027//8',
responseBodyDecoder: allConverters.uint16,
},
putMinVoltage: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/min-voltage',
path: '/1027//8',
bodyEncoder: allConverters.uint16,
},
getMaxVoltage: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/max-voltage',
path: '/1027//9',
responseBodyDecoder: allConverters.uint16,
},
putMaxVoltage: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/max-voltage',
path: '/1027//9',
bodyEncoder: allConverters.uint16,
},
getPageSize: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/page-size',
path: '/1027//10',
responseBodyDecoder: allConverters.uint32,
},
putPageSize: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/page-size',
path: '/1027//10',
bodyEncoder: allConverters.uint32,
},
getComStats: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/com-stats',
path: '/1027//11',
responseBodyDecoder: allConverters.targetComStats,
},
clearComStats: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/com-stats',
path: '/1027//11',
},
getAvailableProtocols: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/available-protocols',
path: '/1027//20',
responseBodyDecoder: allConverters.targetProtocolArray,
},
getSerialModbusConfiguration: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/serial-modbus-configuration',
path: '/1027//21',
responseBodyDecoder: allConverters.reversedTargetSerialModbusConfiguration,
},
setSerialModbusConfiguration: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/serial-modbus-configuration',
path: '/1027//21',
bodyEncoder: allConverters.reversedTargetSerialModbusConfiguration,
},
putSerialModbusConfiguration: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/serial-modbus-configuration',
path: '/1027//21',
bodyEncoder: allConverters.reversedTargetSerialModbusConfiguration,
},
getModbusDefaultSlaveAddress: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/modbus-default-slave-address',
path: '/1027//22',
responseBodyDecoder: allConverters.uint32,
},
putModbusDefaultSlaveAddress: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/modbus-default-slave-address',
path: '/1027//22',
bodyEncoder: allConverters.uint32,
},
getS3PConfiguration: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/s3p-configuration',
path: '/1027//21',
responseBodyDecoder: allConverters.targetS3PProtocolConfiguration,
},
setS3PConfiguration: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/s3p-configuration',
path: '/1027//21',
bodyEncoder: allConverters.targetS3PProtocolConfiguration,
},
putS3PConfiguration: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/s3p-configuration',
path: '/1027//21',
bodyEncoder: allConverters.targetS3PProtocolConfiguration,
},
getModbusTcpConfiguration: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/modbus-tcp-configuration',
path: '/1027//21',
responseBodyDecoder: allConverters.targetModbusTcpProtocolConfiguration,
},
setModbusTcpConfiguration: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/modbus-tcp-configuration',
path: '/1027//21',
bodyEncoder: allConverters.targetModbusTcpProtocolConfiguration,
},
putModbusTcpConfiguration: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/modbus-tcp-configuration',
path: '/1027//21',
bodyEncoder: allConverters.targetModbusTcpProtocolConfiguration,
},
getCanConfiguration: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/can-configuration',
path: '/1027//21',
responseBodyDecoder: allConverters.targetCanProtocolConfiguration,
},
setCanConfiguration: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/can-configuration',
path: '/1027//21',
bodyEncoder: allConverters.targetCanProtocolConfiguration,
},
putCanConfiguration: {
method: api.TapRequestFrame.MethodType.PUT,
pathAlias: '/target/can-configuration',
path: '/1027//21',
bodyEncoder: allConverters.targetCanProtocolConfiguration,
},
postResetKeep: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/reset-keep',
path: '/1027//30',
},
readDebug: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/debug-access',
path: '/1027//31',
bodyEncoder: allConverters.uint32,
},
writeDebug: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/debug-access',
path: '/1027//31',
},
getRegisterAccess: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/register-access',
path: '/1027//32',
},
postRegisterAccess: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/register-access',
path: '/1027//32',
},
sendReceive: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/transparent/send-receive',
path: '/1027//34',
},
send: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/transparent/send',
path: '/1027//34',
},
readBytes: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/transparent/read-bytes',
path: '/1027//35',
},
modbusWrite: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/modbus/write',
path: '/1027//37',
bodyEncoder: allConverters.modbusWriteOptions,
},
modbusRead: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/modbus/read',
path: '/1027//38',
bodyEncoder: allConverters.modbusOptions,
},
getSubProtocol: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/sub-protocol',
path: '/1027//40',
responseBodyDecoder: allConverters.targetProtocol,
},
getReceivedCount: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/received-count',
path: '/1027//43',
responseBodyDecoder: allConverters.uint16,
},
readAddress: {
method: api.TapRequestFrame.MethodType.GET,
pathAlias: '/target/read-address',
path: '/1027//33',
bodyEncoder: allConverters.memoryInfo,
},
writeAddress: {
method: api.TapRequestFrame.MethodType.POST,
pathAlias: '/target/read-address',
path: '/1027//33',
bodyEncoder: allConverters.memoryWriteInfo,
},
};
var TargetService = /** @class */ (function (_super) {
__extends(TargetService, _super);
function TargetService() {
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
_this.resources = SERVICE_CALLS;
return _this;
}
/**
* Get target protocol
*
* LWM2M path: /1027//1
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getProtocol = function () {
return this.serviceCallRunner.execute(this.getProtocolCall());
};
/**
*
*
* LWM2M path: /1027//1
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getProtocolCall = function () {
var callOptions = Object.assign({}, this.resources.getProtocol);
return callOptions;
};
/**
* Temporarily change target protocol
*
* LWM2M path: /1027//1
*
* @tapVersion(">=1.0")
* @param targetProtocol input
* @return
*/
TargetService.prototype.setProtocol = function (
/*
* TargetProtocol object to set
*/
targetProtocol) {
return this.serviceCallRunner.execute(this.setProtocolCall(targetProtocol));
};
/**
*
*
* LWM2M path: /1027//1
*
* @tapVersion(">=1.0")
* @param targetProtocol input
* @return call options
*/
TargetService.prototype.setProtocolCall = function (
/*
* TargetProtocol object to set
*/
targetProtocol) {
var callOptions = Object.assign({}, this.resources.setProtocol);
callOptions.body = targetProtocol;
return callOptions;
};
/**
* Write target protocol in configuration
*
* LWM2M path: /1027//1
*
* @tapVersion(">=1.0")
* @param targetProtocol input
* @return
*/
TargetService.prototype.putProtocol = function (
/*
* TargetProtocol object to set
*/
targetProtocol) {
return this.serviceCallRunner.execute(this.putProtocolCall(targetProtocol));
};
/**
*
*
* LWM2M path: /1027//1
*
* @tapVersion(">=1.0")
* @param targetProtocol input
* @return call options
*/
TargetService.prototype.putProtocolCall = function (
/*
* TargetProtocol object to set
*/
targetProtocol) {
var callOptions = Object.assign({}, this.resources.putProtocol);
callOptions.body = targetProtocol;
return callOptions;
};
/**
* Get core type
*
* LWM2M path: /1027//2
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getCoreType = function () {
return this.serviceCallRunner.execute(this.getCoreTypeCall());
};
/**
*
*
* LWM2M path: /1027//2
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getCoreTypeCall = function () {
var callOptions = Object.assign({}, this.resources.getCoreType);
return callOptions;
};
/**
* Write core type
*
* LWM2M path: /1027//2
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.putCoreType = function (
/*
* Write core type
*/
value) {
return this.serviceCallRunner.execute(this.putCoreTypeCall(value));
};
/**
*
*
* LWM2M path: /1027//2
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.putCoreTypeCall = function (
/*
* Write core type
*/
value) {
var callOptions = Object.assign({}, this.resources.putCoreType);
callOptions.body = value;
return callOptions;
};
/**
* Read target protocol connection status
*
* LWM2M path: /1027//3
*
* @tapVersion(">=1.63")
* @return
*/
TargetService.prototype.isConnected = function () {
return this.serviceCallRunner.execute(this.isConnectedCall());
};
/**
*
*
* LWM2M path: /1027//3
*
* @tapVersion(">=1.63")
* @return call options
*/
TargetService.prototype.isConnectedCall = function () {
var callOptions = Object.assign({}, this.resources.isConnected);
return callOptions;
};
/**
* Connect to target
*
* LWM2M path: /1027//3
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.connect = function () {
return this.serviceCallRunner.execute(this.connectCall());
};
/**
*
*
* LWM2M path: /1027//3
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.connectCall = function () {
var callOptions = Object.assign({}, this.resources.connect);
return callOptions;
};
/**
* Disconnect from target
*
* LWM2M path: /1027//4
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.disconnect = function () {
return this.serviceCallRunner.execute(this.disconnectCall());
};
/**
*
*
* LWM2M path: /1027//4
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.disconnectCall = function () {
var callOptions = Object.assign({}, this.resources.disconnect);
return callOptions;
};
/**
* Reset target
*
* LWM2M path: /1027//5
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.reset = function () {
return this.serviceCallRunner.execute(this.resetCall());
};
/**
*
*
* LWM2M path: /1027//5
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.resetCall = function () {
var callOptions = Object.assign({}, this.resources.reset);
return callOptions;
};
/**
* Get target firmware version
*
* LWM2M path: /1027//6
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getFirmwareVersion = function () {
return this.serviceCallRunner.execute(this.getFirmwareVersionCall());
};
/**
*
*
* LWM2M path: /1027//6
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getFirmwareVersionCall = function () {
var callOptions = Object.assign({}, this.resources.getFirmwareVersion);
return callOptions;
};
/**
* Write target firmware version
*
* LWM2M path: /1027//6
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.putFirmwareVersion = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.putFirmwareVersionCall(value));
};
/**
*
*
* LWM2M path: /1027//6
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.putFirmwareVersionCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.putFirmwareVersion);
callOptions.body = value;
return callOptions;
};
/**
* Get vcc
*
* LWM2M path: /1027//7
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getVcc = function () {
return this.serviceCallRunner.execute(this.getVccCall());
};
/**
*
*
* LWM2M path: /1027//7
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getVccCall = function () {
var callOptions = Object.assign({}, this.resources.getVcc);
return callOptions;
};
/**
* Get min target voltage
*
* LWM2M path: /1027//8
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getMinVoltage = function () {
return this.serviceCallRunner.execute(this.getMinVoltageCall());
};
/**
*
*
* LWM2M path: /1027//8
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getMinVoltageCall = function () {
var callOptions = Object.assign({}, this.resources.getMinVoltage);
return callOptions;
};
/**
* Write min target voltage value
*
* LWM2M path: /1027//8
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.putMinVoltage = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.putMinVoltageCall(value));
};
/**
*
*
* LWM2M path: /1027//8
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.putMinVoltageCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.putMinVoltage);
callOptions.body = value;
return callOptions;
};
/**
* Get max target voltage
*
* LWM2M path: /1027//9
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getMaxVoltage = function () {
return this.serviceCallRunner.execute(this.getMaxVoltageCall());
};
/**
*
*
* LWM2M path: /1027//9
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getMaxVoltageCall = function () {
var callOptions = Object.assign({}, this.resources.getMaxVoltage);
return callOptions;
};
/**
* Write max target voltage value
*
* LWM2M path: /1027//9
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.putMaxVoltage = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.putMaxVoltageCall(value));
};
/**
*
*
* LWM2M path: /1027//9
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.putMaxVoltageCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.putMaxVoltage);
callOptions.body = value;
return callOptions;
};
/**
* Get target page size
*
* LWM2M path: /1027//10
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getPageSize = function () {
return this.serviceCallRunner.execute(this.getPageSizeCall());
};
/**
*
*
* LWM2M path: /1027//10
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getPageSizeCall = function () {
var callOptions = Object.assign({}, this.resources.getPageSize);
return callOptions;
};
/**
* Write target page size
*
* LWM2M path: /1027//10
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.putPageSize = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.putPageSizeCall(value));
};
/**
*
*
* LWM2M path: /1027//10
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.putPageSizeCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.putPageSize);
callOptions.body = value;
return callOptions;
};
/**
* Get communication stats
*
* LWM2M path: /1027//11
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getComStats = function () {
return this.serviceCallRunner.execute(this.getComStatsCall());
};
/**
*
*
* LWM2M path: /1027//11
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getComStatsCall = function () {
var callOptions = Object.assign({}, this.resources.getComStats);
return callOptions;
};
/**
* Clear communication stats
*
* LWM2M path: /1027//11
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.clearComStats = function () {
return this.serviceCallRunner.execute(this.clearComStatsCall());
};
/**
*
*
* LWM2M path: /1027//11
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.clearComStatsCall = function () {
var callOptions = Object.assign({}, this.resources.clearComStats);
return callOptions;
};
/**
* List available target protocols
*
* LWM2M path: /1027//20
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getAvailableProtocols = function () {
return this.serviceCallRunner.execute(this.getAvailableProtocolsCall());
};
/**
*
*
* LWM2M path: /1027//20
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getAvailableProtocolsCall = function () {
var callOptions = Object.assign({}, this.resources.getAvailableProtocols);
return callOptions;
};
/**
* Get Serial/Modbus protocol configuration options
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getSerialModbusConfiguration = function () {
return this.serviceCallRunner.execute(this.getSerialModbusConfigurationCall());
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getSerialModbusConfigurationCall = function () {
var callOptions = Object.assign({}, this.resources.getSerialModbusConfiguration);
return callOptions;
};
/**
* Temporary update configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.setSerialModbusConfiguration = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.setSerialModbusConfigurationCall(value));
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.setSerialModbusConfigurationCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.setSerialModbusConfiguration);
callOptions.body = value;
return callOptions;
};
/**
* Write protocol options in Tap configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.putSerialModbusConfiguration = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.putSerialModbusConfigurationCall(value));
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.putSerialModbusConfigurationCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.putSerialModbusConfiguration);
callOptions.body = value;
return callOptions;
};
/**
* Get modbus default slave address
*
* LWM2M path: /1027//22
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getModbusDefaultSlaveAddress = function () {
return this.serviceCallRunner.execute(this.getModbusDefaultSlaveAddressCall());
};
/**
*
*
* LWM2M path: /1027//22
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getModbusDefaultSlaveAddressCall = function () {
var callOptions = Object.assign({}, this.resources.getModbusDefaultSlaveAddress);
return callOptions;
};
/**
* Write modbus default slave address
*
* LWM2M path: /1027//22
*
* @tapVersion(">=1.0")
* @param address input
* @return
*/
TargetService.prototype.putModbusDefaultSlaveAddress = function (
/*
* New default modbus slave address
*/
address) {
return this.serviceCallRunner.execute(this.putModbusDefaultSlaveAddressCall(address));
};
/**
*
*
* LWM2M path: /1027//22
*
* @tapVersion(">=1.0")
* @param address input
* @return call options
*/
TargetService.prototype.putModbusDefaultSlaveAddressCall = function (
/*
* New default modbus slave address
*/
address) {
var callOptions = Object.assign({}, this.resources.putModbusDefaultSlaveAddress);
callOptions.body = address;
return callOptions;
};
/**
* Get S3P protocol configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getS3PConfiguration = function () {
return this.serviceCallRunner.execute(this.getS3PConfigurationCall());
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getS3PConfigurationCall = function () {
var callOptions = Object.assign({}, this.resources.getS3PConfiguration);
return callOptions;
};
/**
* Temporary update S3P configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.setS3PConfiguration = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.setS3PConfigurationCall(value));
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.setS3PConfigurationCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.setS3PConfiguration);
callOptions.body = value;
return callOptions;
};
/**
* Update protocol configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.putS3PConfiguration = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.putS3PConfigurationCall(value));
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.putS3PConfigurationCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.putS3PConfiguration);
callOptions.body = value;
return callOptions;
};
/**
* Get Modbus TCP protocol configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getModbusTcpConfiguration = function () {
return this.serviceCallRunner.execute(this.getModbusTcpConfigurationCall());
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getModbusTcpConfigurationCall = function () {
var callOptions = Object.assign({}, this.resources.getModbusTcpConfiguration);
return callOptions;
};
/**
* Temporary update Modbus TCP configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.setModbusTcpConfiguration = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.setModbusTcpConfigurationCall(value));
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.setModbusTcpConfigurationCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.setModbusTcpConfiguration);
callOptions.body = value;
return callOptions;
};
/**
* Update Modbus TCP configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.putModbusTcpConfiguration = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.putModbusTcpConfigurationCall(value));
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.putModbusTcpConfigurationCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.putModbusTcpConfiguration);
callOptions.body = value;
return callOptions;
};
/**
* Get CAN protocol configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=2.6")
* @return
*/
TargetService.prototype.getCanConfiguration = function () {
return this.serviceCallRunner.execute(this.getCanConfigurationCall());
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=2.6")
* @return call options
*/
TargetService.prototype.getCanConfigurationCall = function () {
var callOptions = Object.assign({}, this.resources.getCanConfiguration);
return callOptions;
};
/**
* Temporary update CAN configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=2.6")
* @param value input
* @return
*/
TargetService.prototype.setCanConfiguration = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.setCanConfigurationCall(value));
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=2.6")
* @param value input
* @return call options
*/
TargetService.prototype.setCanConfigurationCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.setCanConfiguration);
callOptions.body = value;
return callOptions;
};
/**
* Update CAN protocol configuration
*
* LWM2M path: /1027//21
*
* @tapVersion(">=2.6")
* @param value input
* @return
*/
TargetService.prototype.putCanConfiguration = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.putCanConfigurationCall(value));
};
/**
*
*
* LWM2M path: /1027//21
*
* @tapVersion(">=2.6")
* @param value input
* @return call options
*/
TargetService.prototype.putCanConfigurationCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.putCanConfiguration);
callOptions.body = value;
return callOptions;
};
/**
* Put and keep target in Reset state
*
* LWM2M path: /1027//30
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.postResetKeep = function () {
return this.serviceCallRunner.execute(this.postResetKeepCall());
};
/**
*
*
* LWM2M path: /1027//30
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.postResetKeepCall = function () {
var callOptions = Object.assign({}, this.resources.postResetKeep);
return callOptions;
};
/**
* Debug access
*
* LWM2M path: /1027//31
*
* @tapVersion(">=1.0")
* @param address input
* @return
*/
TargetService.prototype.readDebug = function (
/*
*
*/
address) {
return this.serviceCallRunner.execute(this.readDebugCall(address));
};
/**
*
*
* LWM2M path: /1027//31
*
* @tapVersion(">=1.0")
* @param address input
* @return call options
*/
TargetService.prototype.readDebugCall = function (
/*
*
*/
address) {
var callOptions = Object.assign({}, this.resources.readDebug);
callOptions.body = address;
return callOptions;
};
/**
* Write address
*
* LWM2M path: /1027//31
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.writeDebug = function () {
return this.serviceCallRunner.execute(this.writeDebugCall());
};
/**
*
*
* LWM2M path: /1027//31
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.writeDebugCall = function () {
var callOptions = Object.assign({}, this.resources.writeDebug);
return callOptions;
};
/**
* Register access
*
* LWM2M path: /1027//32
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getRegisterAccess = function () {
return this.serviceCallRunner.execute(this.getRegisterAccessCall());
};
/**
*
*
* LWM2M path: /1027//32
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getRegisterAccessCall = function () {
var callOptions = Object.assign({}, this.resources.getRegisterAccess);
return callOptions;
};
/**
* Write register value
*
* LWM2M path: /1027//32
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.postRegisterAccess = function () {
return this.serviceCallRunner.execute(this.postRegisterAccessCall());
};
/**
*
*
* LWM2M path: /1027//32
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.postRegisterAccessCall = function () {
var callOptions = Object.assign({}, this.resources.postRegisterAccess);
return callOptions;
};
/**
* Transparent send and receive
*
* LWM2M path: /1027//34
*
* @tapVersion(">=1.0")
* @param data input
* @return
*/
TargetService.prototype.sendReceive = function (
/*
*
*/
data) {
return this.serviceCallRunner.execute(this.sendReceiveCall(data));
};
/**
*
*
* LWM2M path: /1027//34
*
* @tapVersion(">=1.0")
* @param data input
* @return call options
*/
TargetService.prototype.sendReceiveCall = function (
/*
*
*/
data) {
var callOptions = Object.assign({}, this.resources.sendReceive);
callOptions.body = data;
return callOptions;
};
/**
* Transparent send
*
* LWM2M path: /1027//34
*
* @tapVersion(">=1.0")
* @param data input
* @return
*/
TargetService.prototype.send = function (
/*
*
*/
data) {
return this.serviceCallRunner.execute(this.sendCall(data));
};
/**
*
*
* LWM2M path: /1027//34
*
* @tapVersion(">=1.0")
* @param data input
* @return call options
*/
TargetService.prototype.sendCall = function (
/*
*
*/
data) {
var callOptions = Object.assign({}, this.resources.send);
callOptions.body = data;
return callOptions;
};
/**
* Read data transparent mode with limit
*
* LWM2M path: /1027//35
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.readBytes = function () {
return this.serviceCallRunner.execute(this.readBytesCall());
};
/**
*
*
* LWM2M path: /1027//35
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.readBytesCall = function () {
var callOptions = Object.assign({}, this.resources.readBytes);
return callOptions;
};
/**
* Direct modbus write
*
* LWM2M path: /1027//37
*
* @tapVersion(">=1.0")
* @param data input
* @return
*/
TargetService.prototype.modbusWrite = function (
/*
*
*/
data) {
return this.serviceCallRunner.execute(this.modbusWriteCall(data));
};
/**
*
*
* LWM2M path: /1027//37
*
* @tapVersion(">=1.0")
* @param data input
* @return call options
*/
TargetService.prototype.modbusWriteCall = function (
/*
*
*/
data) {
var callOptions = Object.assign({}, this.resources.modbusWrite);
callOptions.body = data;
return callOptions;
};
/**
* Direct modbus read
*
* LWM2M path: /1027//38
*
* @tapVersion(">=1.0")
* @param data input
* @return
*/
TargetService.prototype.modbusRead = function (
/*
*
*/
data) {
return this.serviceCallRunner.execute(this.modbusReadCall(data));
};
/**
*
*
* LWM2M path: /1027//38
*
* @tapVersion(">=1.0")
* @param data input
* @return call options
*/
TargetService.prototype.modbusReadCall = function (
/*
*
*/
data) {
var callOptions = Object.assign({}, this.resources.modbusRead);
callOptions.body = data;
return callOptions;
};
/**
* Get current sub protocol
*
* LWM2M path: /1027//40
*
* @tapVersion(">=1.0")
* @return
*/
TargetService.prototype.getSubProtocol = function () {
return this.serviceCallRunner.execute(this.getSubProtocolCall());
};
/**
*
*
* LWM2M path: /1027//40
*
* @tapVersion(">=1.0")
* @return call options
*/
TargetService.prototype.getSubProtocolCall = function () {
var callOptions = Object.assign({}, this.resources.getSubProtocol);
return callOptions;
};
/**
* Get byte length received in buffer
*
* LWM2M path: /1027//43
*
* @tapVersion(">=1.57")
* @return
*/
TargetService.prototype.getReceivedCount = function () {
return this.serviceCallRunner.execute(this.getReceivedCountCall());
};
/**
*
*
* LWM2M path: /1027//43
*
* @tapVersion(">=1.57")
* @return call options
*/
TargetService.prototype.getReceivedCountCall = function () {
var callOptions = Object.assign({}, this.resources.getReceivedCount);
return callOptions;
};
/**
* SWD direct Read
*
* LWM2M path: /1027//33
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.readAddress = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.readAddressCall(value));
};
/**
*
*
* LWM2M path: /1027//33
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.readAddressCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.readAddress);
callOptions.body = value;
return callOptions;
};
/**
* SWD direct Write
*
* LWM2M path: /1027//33
*
* @tapVersion(">=1.0")
* @param value input
* @return
*/
TargetService.prototype.writeAddress = function (
/*
*
*/
value) {
return this.serviceCallRunner.execute(this.writeAddressCall(value));
};
/**
*
*
* LWM2M path: /1027//33
*
* @tapVersion(">=1.0")
* @param value input
* @return call options
*/
TargetService.prototype.writeAddressCall = function (
/*
*
*/
value) {
var callOptions = Object.assign({}, this.resources.writeAddress);
callOptions.body = value;
return callOptions;
};
return TargetService;
}(tap.AbstractService));
var _TAP_SERVICE_EXTENSION_TARGET_ = tap.extendServiceContainer('target', TargetService);
/**
* Generated file. Do not edit
*/
var ResourceMetaData = {
'/target/protocol': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
$ref: './definitions.yaml#/TargetProtocol',
},
},
},
'/target/core-type': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
$ref: './definitions.yaml#/TargetCoreType',
},
},
},
'/target/firmware-version': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
type: 'string',
format: 'version',
},
},
},
'/target/min-voltage': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
type: 'integer',
format: 'uint16',
},
},
},
'/target/max-voltage': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
type: 'integer',
format: 'uint16',
},
},
},
'/target/page-size': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
type: 'integer',
format: 'uint32',
},
},
},
'/target/serial-modbus-configuration': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
$ref: './definitions.yaml#/TargetSerialModbusProtocolConfiguration',
},
},
},
'/target/modbus-default-slave-address': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
type: 'integer',
format: 'uint32',
},
},
},
'/target/s3p-configuration': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
$ref: './definitions.yaml#/TargetS3PProtocolConfiguration',
},
},
},
'/target/modbus-tcp-configuration': {
put: {
minApiVersion: 1.0,
configModeRequired: true,
schema: {
$ref: './definitions.yaml#/TargetModbusTcpProtocolConfiguration',
},
},
},
'/target/can-configuration': {
put: {
minApiVersion: 2.6,
configModeRequired: true,
schema: {
$ref: './definitions.yaml#/TargetCanProtocolConfiguration',
},
},
},
};
/**
* Generated bundle index. Do not edit.
*/
exports.MemoryInfoConverter = MemoryInfoConverter;
exports.MemoryWriteInfoConverter = MemoryWriteInfoConverter;
exports.ModbusOptionsConverter = ModbusOptionsConverter;
exports.ModbusWriteOptionsConverter = ModbusWriteOptionsConverter;
exports.ReversedTargetSerialModbusConfigurationConverter = ReversedTargetSerialModbusConfigurationConverter;
exports.SerialSettingsConverter = SerialSettingsConverter;
exports.TARGET_SERVICE_CALLS = SERVICE_CALLS;
exports.TargetCanProtocolConfigurationConverter = TargetCanProtocolConfigurationConverter;
exports.TargetComStatsConverter = TargetComStatsConverter;
exports.TargetModbusTcpProtocolConfigurationConverter = TargetModbusTcpProtocolConfigurationConverter;
exports.TargetResourceMetaData = ResourceMetaData;
exports.TargetS3PProtocolConfigurationConverter = TargetS3PProtocolConfigurationConverter;
exports.TargetSerialModbusProtocolConfigurationConverter = TargetSerialModbusProtocolConfigurationConverter;
exports.TargetService = TargetService;
exports._TAP_SERVICE_EXTENSION_TARGET_ = _TAP_SERVICE_EXTENSION_TARGET_;
exports.reversedTargetSerialModbusConfiguration = reversedTargetSerialModbusConfiguration;
exports.targetConverters = serviceConverters;
Object.defineProperty(exports, '__esModule', { value: true });
}));
//# sourceMappingURL=iotize-tap-service-impl-target.umd.js.map