@iotize/tap
Version:
IoTize Device client for Javascript
1,523 lines (1,515 loc) • 113 kB
JavaScript
import { TapRequestFrame } from '@iotize/tap/client/api';
import { createEnumConverter, createEnumArrayConverter, converters } from '@iotize/tap/service/core';
import { CpuFrequencySpeed, AbstractService, TapResponse, TapError, ServiceCallRunner, extendServiceContainer } from '@iotize/tap';
export { CpuFrequencySpeed } from '@iotize/tap';
import { TapStreamReader, TapStreamWriter, enumKeyOrValueToNumber } from '@iotize/tap/client/impl';
/* eslint-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 NfcPairingMode;
(function (NfcPairingMode) {
NfcPairingMode[NfcPairingMode["NO"] = 0] = "NO";
NfcPairingMode[NfcPairingMode["MANDATORY"] = 1] = "MANDATORY";
NfcPairingMode[NfcPairingMode["MANDATORY_FOR_LOGIN"] = 2] = "MANDATORY_FOR_LOGIN";
})(NfcPairingMode || (NfcPairingMode = {}));
var WirelessPairingOptions;
(function (WirelessPairingOptions) {
/* eslint-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.
*/
let NfcPairingMode;
(function (NfcPairingMode) {
NfcPairingMode[NfcPairingMode["NO"] = 0] = "NO";
NfcPairingMode[NfcPairingMode["MANDATORY"] = 1] = "MANDATORY";
NfcPairingMode[NfcPairingMode["MANDATORY_FOR_LOGIN"] = 2] = "MANDATORY_FOR_LOGIN";
})(NfcPairingMode = WirelessPairingOptions.NfcPairingMode || (WirelessPairingOptions.NfcPairingMode = {}));
})(WirelessPairingOptions || (WirelessPairingOptions = {}));
/* eslint-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 LowPowerOptimizationLevel;
(function (LowPowerOptimizationLevel) {
LowPowerOptimizationLevel[LowPowerOptimizationLevel["NO"] = 0] = "NO";
LowPowerOptimizationLevel[LowPowerOptimizationLevel["LOW"] = 1] = "LOW";
LowPowerOptimizationLevel[LowPowerOptimizationLevel["STANDBY"] = 2] = "STANDBY";
LowPowerOptimizationLevel[LowPowerOptimizationLevel["SHUTDOWN"] = 3] = "SHUTDOWN";
})(LowPowerOptimizationLevel || (LowPowerOptimizationLevel = {}));
/* eslint-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 ServiceCode;
(function (ServiceCode) {
ServiceCode[ServiceCode["DATALOG"] = 1] = "DATALOG";
ServiceCode[ServiceCode["JVM"] = 2] = "JVM";
})(ServiceCode || (ServiceCode = {}));
/* eslint-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 NfcConnectionPriority;
(function (NfcConnectionPriority) {
NfcConnectionPriority[NfcConnectionPriority["NFC_PRIORITY"] = 0] = "NFC_PRIORITY";
NfcConnectionPriority[NfcConnectionPriority["NFC_NON_PRIORITY"] = 1] = "NFC_NON_PRIORITY";
})(NfcConnectionPriority || (NfcConnectionPriority = {}));
var MultiRequestFrame;
(function (MultiRequestFrame) {
/* eslint-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.
*/
/* eslint-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.
*/
let ExpectedResponseStatus;
(function (ExpectedResponseStatus) {
ExpectedResponseStatus[ExpectedResponseStatus["SUCCESS"] = 127] = "SUCCESS";
ExpectedResponseStatus[ExpectedResponseStatus["ANYTHING"] = 255] = "ANYTHING";
})(ExpectedResponseStatus = MultiRequestFrame.ExpectedResponseStatus || (MultiRequestFrame.ExpectedResponseStatus = {}));
})(MultiRequestFrame || (MultiRequestFrame = {}));
/**
* Generated file. Do not edit
*/
TapStreamReader.prototype.readLoginCredential = function () {
const model = {};
model.username = this.readString(16);
model.password = this.readString(16);
return model;
};
TapStreamReader.prototype.readLoginCredentialHashed =
function () {
const model = {};
model.username = this.readString(16);
model.password = this.readBytes(16);
return model;
};
TapStreamReader.prototype.readSecurityOptions = function () {
const model = {};
this.forwardBits(8);
this.forwardBits(2);
model.maxWakeUpTimeActivated = this.readBoolean(1);
model.scramActivated = this.readBoolean(1);
model.hashPassword = this.readBoolean(1);
model.disableHardwareFactoryReset = this.readBoolean(1);
model.disableLoginWithUID = this.readBoolean(1);
model.disableResourceFactoryReset = this.readBoolean(1);
return model;
};
TapStreamReader.prototype.readWirelessPairingOptions =
function () {
const model = {};
this.forwardBits(5);
model.blePairing = this.readBoolean(1);
model.nfcPairingMode = this.readBits(2);
return model;
};
TapStreamReader.prototype.readCpuFrequencyOptions =
function () {
const model = {};
this.forwardBits(6);
model.speed = this.readBits(2);
return model;
};
TapStreamReader.prototype.readPowerOptimizationOptions =
function () {
const model = {};
this.forwardBits(4);
model.cpuFrequencySpeed = this.readBits(2);
model.lowPowerOptimizationLevel = this.readBits(2);
return model;
};
TapStreamReader.prototype.readNetworkOptions = function () {
const model = {};
this.forwardBits(3);
model.radioMixEnabled = this.readBoolean(1);
model.lteEnabled = this.readBoolean(1);
model.ethernetEnabled = this.readBoolean(1);
model.wifiDisabled = this.readBoolean(1);
model.wifiNetworkMode = this.readBoolean(1);
return model;
};
TapStreamReader.prototype.readProtocolMaxFrameSize =
function () {
const model = {};
model.request = this.readUnsigned(2);
model.response = this.readUnsigned(2);
return model;
};
TapStreamReader.prototype.readMultiRequestFrame =
function () {
const model = {};
model.requests = [];
while (!this.isEof()) {
model.requests.push(this.readMultiRequestFrameRequestItem());
}
return model;
};
TapStreamReader.prototype.readMultiRequestFrameRequestItem =
function () {
const model = {};
model.requestLen = this.readUnsigned(2);
model.request = this.subStream(model.requestLen).readTapRequestFrame();
model.expectedResponseStatus = this.readUnsigned(1);
return model;
};
TapStreamReader.prototype.readMultiResponseFrame =
function () {
const model = {};
model.responses = [];
while (!this.isEof()) {
model.responses.push(this.readMultiResponseFrameResponseItem());
}
return model;
};
TapStreamReader.prototype.readMultiResponseFrameResponseItem =
function () {
const model = {};
model.responseLen = this.readUnsigned(2);
model.response = this.subStream(model.responseLen).readTapResponseFrame();
return model;
};
// TapStreamWriter.prototype.write(model: LoginCredential) : TapStreamWriter{
// return this.writeLoginCredential(model)
// }
TapStreamWriter.prototype.writeLoginCredential = function (model) {
this.writeString(model.username, 16);
this.writeString(model.password, 16);
return this;
};
// TapStreamWriter.prototype.write(model: LoginCredentialHashed) : TapStreamWriter{
// return this.writeLoginCredentialHashed(model)
// }
TapStreamWriter.prototype.writeLoginCredentialHashed = function (model) {
this.writeString(model.username, 16);
this.writeBytes(model.password, 16);
return this;
};
// TapStreamWriter.prototype.write(model: SecurityOptions) : TapStreamWriter{
// return this.writeSecurityOptions(model)
// }
TapStreamWriter.prototype.writeSecurityOptions = function (model) {
this.forwardBits(8);
this.forwardBits(2);
this.writeBoolean(model.maxWakeUpTimeActivated, 1);
this.writeBoolean(model.scramActivated, 1);
this.writeBoolean(model.hashPassword, 1);
this.writeBoolean(model.disableHardwareFactoryReset, 1);
this.writeBoolean(model.disableLoginWithUID, 1);
this.writeBoolean(model.disableResourceFactoryReset, 1);
return this;
};
// TapStreamWriter.prototype.write(model: WirelessPairingOptions) : TapStreamWriter{
// return this.writeWirelessPairingOptions(model)
// }
TapStreamWriter.prototype.writeWirelessPairingOptions = function (model) {
this.forwardBits(5);
this.writeBoolean(model.blePairing, 1);
this.writeBitsInt(enumKeyOrValueToNumber(model.nfcPairingMode, WirelessPairingOptions.NfcPairingMode), 2);
return this;
};
// TapStreamWriter.prototype.write(model: CpuFrequencyOptions) : TapStreamWriter{
// return this.writeCpuFrequencyOptions(model)
// }
TapStreamWriter.prototype.writeCpuFrequencyOptions = function (model) {
this.forwardBits(6);
this.writeBitsInt(enumKeyOrValueToNumber(model.speed, CpuFrequencySpeed), 2);
return this;
};
// TapStreamWriter.prototype.write(model: PowerOptimizationOptions) : TapStreamWriter{
// return this.writePowerOptimizationOptions(model)
// }
TapStreamWriter.prototype.writePowerOptimizationOptions = function (model) {
this.forwardBits(4);
this.writeBitsInt(enumKeyOrValueToNumber(model.cpuFrequencySpeed, CpuFrequencySpeed), 2);
this.writeBitsInt(enumKeyOrValueToNumber(model.lowPowerOptimizationLevel, LowPowerOptimizationLevel), 2);
return this;
};
// TapStreamWriter.prototype.write(model: NetworkOptions) : TapStreamWriter{
// return this.writeNetworkOptions(model)
// }
TapStreamWriter.prototype.writeNetworkOptions = function (model) {
this.forwardBits(3);
this.writeBoolean(model.radioMixEnabled !== undefined ? model.radioMixEnabled : 0, 1);
this.writeBoolean(model.lteEnabled !== undefined ? model.lteEnabled : 0, 1);
this.writeBoolean(model.ethernetEnabled !== undefined ? model.ethernetEnabled : 0, 1);
this.writeBoolean(model.wifiDisabled !== undefined ? model.wifiDisabled : 0, 1);
this.writeBoolean(model.wifiNetworkMode !== undefined ? model.wifiNetworkMode : 0, 1);
return this;
};
// TapStreamWriter.prototype.write(model: ProtocolMaxFrameSize) : TapStreamWriter{
// return this.writeProtocolMaxFrameSize(model)
// }
TapStreamWriter.prototype.writeProtocolMaxFrameSize = function (model) {
this.writeUnsigned(model.request, 2);
this.writeUnsigned(model.response, 2);
return this;
};
// TapStreamWriter.prototype.write(model: MultiRequestFrame) : TapStreamWriter{
// return this.writeMultiRequestFrame(model)
// }
TapStreamWriter.prototype.writeMultiRequestFrame = function (model) {
for (let item of model.requests) {
this.writeMultiRequestFrameRequestItem(item);
}
return this;
};
TapStreamWriter.prototype.writeMultiRequestFrameRequestItem = function (model) {
this.writeUnsigned(model.requestLen, 2);
this.writeTapRequestFrame(model.request);
this.writeUnsigned(model.expectedResponseStatus, 1);
return this;
};
// TapStreamWriter.prototype.write(model: MultiResponseFrame) : TapStreamWriter{
// return this.writeMultiResponseFrame(model)
// }
TapStreamWriter.prototype.writeMultiResponseFrame = function (model) {
for (let item of model.responses) {
this.writeMultiResponseFrameResponseItem(item);
}
return this;
};
TapStreamWriter.prototype.writeMultiResponseFrameResponseItem = function (model) {
this.writeUnsigned(model.responseLen, 2);
this.writeTapResponseFrame(model.response);
return this;
};
/**
* Generated file. Do not edit
*/
class LoginCredentialConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeLoginCredential(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readLoginCredential();
}
}
class LoginCredentialHashedConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeLoginCredentialHashed(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readLoginCredentialHashed();
}
}
class SecurityOptionsConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeSecurityOptions(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readSecurityOptions();
}
}
class WirelessPairingOptionsConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeWirelessPairingOptions(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readWirelessPairingOptions();
}
}
class CpuFrequencyOptionsConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeCpuFrequencyOptions(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readCpuFrequencyOptions();
}
}
class PowerOptimizationOptionsConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writePowerOptimizationOptions(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readPowerOptimizationOptions();
}
}
class NetworkOptionsConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeNetworkOptions(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readNetworkOptions();
}
}
class ProtocolMaxFrameSizeConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeProtocolMaxFrameSize(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readProtocolMaxFrameSize();
}
}
class MultiRequestFrameConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeMultiRequestFrame(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readMultiRequestFrame();
}
}
class MultiResponseFrameConverter {
encode(model, stream = new TapStreamWriter()) {
stream.writeMultiResponseFrame(model);
return stream.toBytes;
}
decode(data) {
const stream = data instanceof TapStreamReader ? data : TapStreamReader.create(data);
return stream.readMultiResponseFrame();
}
}
/**
* Generated file. Do not edit
*/
const loginCredential = new LoginCredentialConverter();
const loginCredentialHashed = new LoginCredentialHashedConverter();
const securityOptions = new SecurityOptionsConverter();
const nfcPairingMode = createEnumConverter(NfcPairingMode, 1);
const nfcPairingModeArray = createEnumArrayConverter(NfcPairingMode, 1);
const wirelessPairingOptions = new WirelessPairingOptionsConverter();
const lowPowerOptimizationLevel = createEnumConverter(LowPowerOptimizationLevel, 1);
const lowPowerOptimizationLevelArray = createEnumArrayConverter(LowPowerOptimizationLevel, 1);
const cpuFrequencyOptions = new CpuFrequencyOptionsConverter();
const powerOptimizationOptions = new PowerOptimizationOptionsConverter();
const serviceCode = createEnumConverter(ServiceCode, 1);
const serviceCodeArray = createEnumArrayConverter(ServiceCode, 1);
const networkOptions = new NetworkOptionsConverter();
const nfcConnectionPriority = createEnumConverter(NfcConnectionPriority, 1);
const nfcConnectionPriorityArray = createEnumArrayConverter(NfcConnectionPriority, 1);
const protocolMaxFrameSize = new ProtocolMaxFrameSizeConverter();
const multiRequestFrame = new MultiRequestFrameConverter();
const multiResponseFrame = new MultiResponseFrameConverter();
var serviceConverters = /*#__PURE__*/Object.freeze({
__proto__: null,
loginCredential: loginCredential,
loginCredentialHashed: loginCredentialHashed,
securityOptions: securityOptions,
nfcPairingMode: nfcPairingMode,
nfcPairingModeArray: nfcPairingModeArray,
wirelessPairingOptions: wirelessPairingOptions,
lowPowerOptimizationLevel: lowPowerOptimizationLevel,
lowPowerOptimizationLevelArray: lowPowerOptimizationLevelArray,
cpuFrequencyOptions: cpuFrequencyOptions,
powerOptimizationOptions: powerOptimizationOptions,
serviceCode: serviceCode,
serviceCodeArray: serviceCodeArray,
networkOptions: networkOptions,
nfcConnectionPriority: nfcConnectionPriority,
nfcConnectionPriorityArray: nfcConnectionPriorityArray,
protocolMaxFrameSize: protocolMaxFrameSize,
multiRequestFrame: multiRequestFrame,
multiResponseFrame: multiResponseFrame
});
/**
* Generated file. Do not edit
*/
const allConverters = Object.assign(Object.assign({}, converters), serviceConverters);
const SERVICE_CALLS = {
login: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/login',
path: '/1024//0',
bodyEncoder: allConverters.loginCredential,
},
loginWithHash: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/login-with-hash',
path: '/1024//0',
bodyEncoder: allConverters.loginCredentialHashed,
},
logout: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/logout',
path: '/1024//1',
},
getCurrentProfileId: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/current-profile/id',
path: '/1024//2',
responseBodyDecoder: allConverters.uint16,
},
getCurrentHostProtocol: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/current-host-protocol',
path: '/1024//3',
responseBodyDecoder: allConverters.hostProtocol,
},
putCurrentHostProtocol: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/current-host-protocol',
path: '/1024//3',
bodyEncoder: allConverters.hostProtocol,
},
getUID: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/uid',
path: '/1024//5',
},
loginWithUID: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/uid',
path: '/1024//5',
},
keepAlive: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/keep-alive',
path: '/1024//4',
responseBodyDecoder: allConverters.uint32,
},
postKeepAlive: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/keep-alive',
path: '/1024//4',
},
getSecurityOptions: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/security-options',
path: '/1024//6',
responseBodyDecoder: allConverters.securityOptions,
},
putSecurityOptions: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/security-options',
path: '/1024//6',
bodyEncoder: allConverters.securityOptions,
},
getCurrentGroupId: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/current-group-id',
path: '/1024//7',
responseBodyDecoder: allConverters.uint16,
},
getBundleIdSwdDirectAccess: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/bundle-id-swd-direct-access',
path: '/1024//100',
responseBodyDecoder: allConverters.uint16,
},
putBundleIdSwdDirectAccess: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/bundle-id-swd-direct-access',
path: '/1024//100',
bodyEncoder: allConverters.uint16,
},
getBundleIdSerialAccess: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/bundle-id-serial-access',
path: '/1024//101',
responseBodyDecoder: allConverters.uint16,
},
putBundleIdSerialAccess: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/bundle-id-serial-access',
path: '/1024//101',
bodyEncoder: allConverters.uint16,
},
getBundleIdModbusDirectAccess: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/bundle-id-modbus-direct-access',
path: '/1024//102',
responseBodyDecoder: allConverters.uint16,
},
putBundleIdModbusDirectAccess: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/bundle-id-modbus-direct-access',
path: '/1024//102',
bodyEncoder: allConverters.uint16,
},
getBundleIdTapnpassControlAccess: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/bundle-id-tapnpass-control-access',
path: '/1024//103',
responseBodyDecoder: allConverters.uint16,
},
putBundleIdTapnpassControlAccess: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/bundle-id-tapnpass-control-access',
path: '/1024//103',
bodyEncoder: allConverters.uint16,
},
getBundleIdFirmwareUpdateAccess: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/bundle-id-firmware-update-access',
path: '/1024//104',
responseBodyDecoder: allConverters.uint16,
},
putBundleIdFirmwareUpdateAccess: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/bundle-id-firmware-update-access',
path: '/1024//104',
bodyEncoder: allConverters.uint16,
},
getBundleIdMqttIdsAccess: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/bundle-id-mqtt-ids-access',
path: '/1024//105',
responseBodyDecoder: allConverters.uint16,
},
putBundleIdMqttIdsAccess: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/bundle-id-mqtt-ids-access',
path: '/1024//105',
bodyEncoder: allConverters.uint16,
},
getBundleIdVariableConfigAccess: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/bundle-id-variable-config-access',
path: '/1024//106',
responseBodyDecoder: allConverters.uint16,
},
putBundleIdVariableConfigAccess: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/bundle-id-variable-config-access',
path: '/1024//106',
bodyEncoder: allConverters.uint16,
},
getBundleIdFileSystemAccess: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/bundle-id-file-system-access',
path: '/1024//107',
responseBodyDecoder: allConverters.uint16,
},
putBundleIdFileSystemAccess: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/bundle-id-file-system-access',
path: '/1024//107',
bodyEncoder: allConverters.uint16,
},
getConfigFormatVersion: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/config-format-version',
path: '/1024//8',
responseBodyDecoder: allConverters.uint16,
},
putConfigFormatVersion: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/config-format-version',
path: '/1024//8',
bodyEncoder: allConverters.uint16,
},
getAppName: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/app-name',
path: '/1024//9',
responseBodyDecoder: allConverters.ascii,
},
putAppName: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/app-name',
path: '/1024//9',
bodyEncoder: allConverters.ascii,
},
getConfigVersion: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/config-version',
path: '/1024//10',
responseBodyDecoder: allConverters.stringVersion,
},
putConfigVersion: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/config-version',
path: '/1024//10',
bodyEncoder: allConverters.stringVersion,
},
reloadConfig: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/config-version',
path: '/1024//10',
},
getAppPath: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/app-path',
path: '/1024//11',
responseBodyDecoder: allConverters.ascii,
},
putAppPath: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/app-path',
path: '/1024//11',
bodyEncoder: allConverters.ascii,
},
postAppPath: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/app-path',
path: '/1024//11',
bodyEncoder: allConverters.ascii,
},
getNfcPairingMode: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/nfc/pairing-mode',
path: '/1024//13',
responseBodyDecoder: allConverters.nfcPairingMode,
},
putNfcPairingMode: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/nfc/pairing-mode',
path: '/1024//13',
bodyEncoder: allConverters.nfcPairingMode,
},
getPairingOptions: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/pairing-options',
path: '/1024//13',
responseBodyDecoder: allConverters.wirelessPairingOptions,
},
postPairingOptions: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/pairing-options',
path: '/1024//13',
bodyEncoder: allConverters.wirelessPairingOptions,
},
putPairingOptions: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/pairing-options',
path: '/1024//13',
bodyEncoder: allConverters.wirelessPairingOptions,
},
getPowerOptimisationLevel: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/power-optimisation-level',
path: '/1024//14',
responseBodyDecoder: allConverters.lowPowerOptimizationLevel,
},
putPowerOptimisationLevel: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/power-optimisation-level',
path: '/1024//14',
bodyEncoder: allConverters.lowPowerOptimizationLevel,
},
getCpuFrequencyOptions: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/cpu-frequency-options',
path: '/1024//141',
responseBodyDecoder: allConverters.cpuFrequencyOptions,
},
putCpuFrequencyOptions: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/cpu-frequency-options',
path: '/1024//141',
bodyEncoder: allConverters.cpuFrequencySpeed,
},
getPowerOptimisationOptions: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/power-optimisation-options',
path: '/1024//142',
responseBodyDecoder: allConverters.powerOptimizationOptions,
},
putPowerOptimisationOptions: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/power-optimisation-options',
path: '/1024//142',
bodyEncoder: allConverters.powerOptimizationOptions,
},
getMaxLowPowerTime: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/max-low-power-time',
path: '/1024//33',
responseBodyDecoder: allConverters.uint32,
},
putMaxLowPowerTime: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/max-low-power-time',
path: '/1024//33',
bodyEncoder: allConverters.uint32,
},
getAutoRebootTimeout: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/auto-reboot-timeout',
path: '/1024//123',
responseBodyDecoder: allConverters.uint16,
},
putAutoRebootTimeout: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/auto-reboot-timeout',
path: '/1024//123',
bodyEncoder: allConverters.uint16,
},
getAuthorizedHostProtocol: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/authorized-host-protocol',
path: '/1024//17',
responseBodyDecoder: allConverters.hostProtocolArray,
},
putAuthorizedHostProtocol: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/authorized-host-protocol',
path: '/1024//17',
bodyEncoder: allConverters.hostProtocolArray,
},
getConfigFormatFirmwareVersion: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/config-format-firmware-version',
path: '/1024//18',
responseBodyDecoder: allConverters.uint16,
},
getUniversalLink: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/universal-link',
path: '/1024//19',
responseBodyDecoder: allConverters.ascii,
},
putUniversalLink: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/universal-link',
path: '/1024//19',
bodyEncoder: allConverters.ascii,
},
postUniversalLink: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/universal-link',
path: '/1024//19',
bodyEncoder: allConverters.ascii,
},
listObjectInstances: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/list-object-instances',
path: '/1024//140',
bodyEncoder: allConverters.uint16,
},
getAvailableHostProtocols: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/available-host-protocols',
path: '/1024//21',
responseBodyDecoder: allConverters.hostProtocolArray,
},
getDisabledServices: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/disabled-services',
path: '/1024//75',
responseBodyDecoder: allConverters.serviceCodeArray,
},
postDisabledServices: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/disabled-services',
path: '/1024//75',
bodyEncoder: allConverters.serviceCodeArray,
},
getNetworkOptions: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/network-options',
path: '/1024//127',
responseBodyDecoder: allConverters.networkOptions,
},
putNetworkOptions: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/network-options',
path: '/1024//127',
bodyEncoder: allConverters.networkOptions,
},
getRadioMixEnabled: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/radio-mix-enabled',
path: '/1024//132',
responseBodyDecoder: allConverters.uint8,
},
putRadioMixEnabled: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/radio-mix-enabled',
path: '/1024//132',
bodyEncoder: allConverters.uint8,
},
getNfcConnectionPriority: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/nfc_connection_priority',
path: '/1024//24',
responseBodyDecoder: allConverters.nfcConnectionPriority,
},
postNfcConnectionPriority: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/nfc_connection_priority',
path: '/1024//24',
bodyEncoder: allConverters.nfcConnectionPriority,
},
putNfcConnectionPriority: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/nfc_connection_priority',
path: '/1024//24',
bodyEncoder: allConverters.nfcConnectionPriority,
},
getNfcAutologProfileId: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/nfc-autolog-profile-id',
path: '/1024//43',
responseBodyDecoder: allConverters.uint16,
},
putNfcAutologProfileId: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/nfc-autolog-profile-id',
path: '/1024//43',
bodyEncoder: allConverters.uint16,
},
getHostInactivityPeriod: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/host-inactivity-period',
path: '/1024//34',
responseBodyDecoder: allConverters.uint16,
},
putHostInactivityPeriod: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/host-inactivity-period',
path: '/1024//34',
bodyEncoder: allConverters.uint16,
},
getApplicationData: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/application-data',
path: '/1024//36',
},
putApplicationData: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/application-data',
path: '/1024//36',
},
postApplicationData: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/application-data',
path: '/1024//36',
},
getProductKey: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/product-key',
path: '/1024//60',
responseBodyDecoder: allConverters.ascii,
},
getCurrentHostProtocolMaxFrameSize: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/current-host-protocol-max-frame-size',
path: '/1024//88',
responseBodyDecoder: allConverters.protocolMaxFrameSize,
},
executeMultiRequestFrame: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/multi-request-frame',
path: '/1024//89',
responseBodyDecoder: allConverters.multiResponseFrame,
bodyEncoder: allConverters.multiRequestFrame,
},
putCertificatePublicKey: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/certificate/public-key',
append: true,
path: '/1024//37',
},
putCertificatePrivateKey: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/certificate/private-key',
append: true,
path: '/1024//38',
},
putCertificateRootKey: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/certificate/root-key',
append: true,
path: '/1024//39',
},
getProductCode: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/product-code',
path: '/1024//84',
responseBodyDecoder: allConverters.ascii,
},
putProductCode: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/product-code',
path: '/1024//84',
bodyEncoder: allConverters.ascii,
},
getSpecialFeatureProfile: {
method: TapRequestFrame.MethodType.GET,
pathAlias: '/interface/special-feature/{featureId}',
path: '/1024//{featureId}',
responseBodyDecoder: allConverters.uint16,
},
setSpecialFeatureProfile: {
method: TapRequestFrame.MethodType.POST,
pathAlias: '/interface/special-feature/{featureId}',
path: '/1024//{featureId}',
bodyEncoder: allConverters.uint16,
},
putSpecialFeatureProfile: {
method: TapRequestFrame.MethodType.PUT,
pathAlias: '/interface/special-feature/{featureId}',
path: '/1024//{featureId}',
bodyEncoder: allConverters.uint16,
},
};
class InterfaceService extends AbstractService {
constructor() {
super(...arguments);
this.resources = SERVICE_CALLS;
}
/**
* Login
*
* LWM2M path: /1024//0
*
* @tapVersion(">=1.0")
* @param credential input
* @return
*/
login(
/*
* Username/password credentials
*/
credential) {
return this.serviceCallRunner.execute(this.loginCall(credential));
}
/**
*
*
* LWM2M path: /1024//0
*
* @tapVersion(">=1.0")
* @param credential input
* @return call options
*/
loginCall(
/*
* Username/password credentials
*/
credential) {
const callOptions = Object.assign({}, this.resources.login);
callOptions.body = credential;
return callOptions;
}
/**
* Login
*
* LWM2M path: /1024//0
*
* @tapVersion(">=1.0")
* @param credential input
* @return
*/
loginWithHash(
/*
*
*/
credential) {
return this.serviceCallRunner.execute(this.loginWithHashCall(credential));
}
/**
*
*
* LWM2M path: /1024//0
*
* @tapVersion(">=1.0")
* @param credential input
* @return call options
*/
loginWithHashCall(
/*
*
*/
credential) {
const callOptions = Object.assign({}, this.resources.loginWithHash);
callOptions.body = credential;
return callOptions;
}
/**
* Logout
*
* LWM2M path: /1024//1
*
* @tapVersion(">=1.0")
* @return
*/
logout() {
return this.serviceCallRunner.execute(this.logoutCall());
}
/**
*
*
* LWM2M path: /1024//1
*
* @tapVersion(">=1.0")
* @return call options
*/
logoutCall() {
const callOptions = Object.assign({}, this.resources.logout);
return callOptions;
}
/**
* Get current profile id
*
* LWM2M path: /1024//2
*
* @tapVersion(">=1.0")
* @return
*/
getCurrentProfileId() {
return this.serviceCallRunner.execute(this.getCurrentProfileIdCall());
}
/**
*
*
* LWM2M path: /1024//2
*
* @tapVersion(">=1.0")
* @return call options
*/
getCurrentProfileIdCall() {
const callOptions = Object.assign({}, this.resources.getCurrentProfileId);
return callOptions;
}
/**
* Get current host protocol
*
* LWM2M path: /1024//3
*
* @tapVersion(">=1.0")
* @return
*/
getCurrentHostProtocol() {
return this.serviceCallRunner.execute(this.getCurrentHostProtocolCall());
}
/**
*
*
* LWM2M path: /1024//3
*
* @tapVersion(">=1.0")
* @return call options
*/
getCurrentHostProtocolCall() {
const callOptions = Object.assign({}, this.resources.getCurrentHostProtocol);
return callOptions;
}
/**
* Write current host protocol
*
* LWM2M path: /1024//3
*
* @tapVersion(">=1.0")
* @param hostProtocol input
* @return
*/
putCurrentHostProtocol(
/*
*
*/
hostProtocol) {
return this.serviceCallRunner.execute(this.putCurrentHostProtocolCall(hostProtocol));
}
/**
*
*
* LWM2M path: /1024//3
*
* @tapVersion(">=1.0")
* @param hostProtocol input
* @return call options
*/
putCurrentHostProtocolCall(
/*
*
*/
hostProtocol) {
const callOptions = Object.assign({}, this.resources.putCurrentHostProtocol);
callOptions.body = hostProtocol;
return callOptions;
}
/**
* Get PUK UID value
*
* LWM2M path: /1024//5
*
* @tapVersion(">=1.0")
* @return
*/
getUID() {
return this.serviceCallRunner.execute(this.getUIDCall());
}
/**
*
*
* LWM2M path: /1024//5
*
* @tapVersion(">=1.0")
* @return call options
*/
getUIDCall() {
const callOptions = Object.assign({}, this.resources.getUID);
return callOptions;
}
/**
* Administrator login with UID.
*
* LWM2M path: /1024//5
*
* @tapVersion(">=1.0")
* @param uid input
* @return
*/
loginWithUID(
/*
*
*/
uid) {
return this.serviceCallRunner.execute(this.loginWithUIDCall(uid));
}
/**
*
*
* LWM2M path: /1024//5
*
* @tapVersion(">=1.0")
* @param uid input
* @return call options
*/
loginWithUIDCall(
/*
*
*/
uid) {
const callOptions = Object.assign({}, this.resources.loginWithUID);
callOptions.body = uid;
return callOptions;
}
/**
* Keep alive.
*
* LWM2M path: /1024//4
*
* @tapVersion(">=1.0")
* @return
*/
keepAlive() {
return this.serviceCallRunner.execute(this.keepAliveCall());
}
/**
*
*
* LWM2M path: /1024//4
*
* @tapVersion(">=1.0")
* @return call options
*/
keepAliveCall() {
const callOptions = Object.assign({}, this.resources.keepAlive);
return callOptions;
}
/**
* Keep alive.
*
* LWM2M path: /1024//4
*
* @tapVersion(">=1.0")
* @return
*/
postKeepAlive() {
return this.serviceCallRunner.execute(this.postKeepAliveCall());
}
/**
*
*
* LWM2M path: /1024//4
*
* @tapVersion(">=1.0")
* @return call options
*/
postKeepAliveCall() {
const callOptions = Object.assign({}, this.resources.postKeepAlive);
return callOptions;
}
/**
* Get lock infos
*
* LWM2M path: /1024//6
*
* @tapVersion(">=1.0")
* @return
*/
getSecurityOptions() {
return this.serviceCallRunner.execute(this.getSecurityOptionsCall());
}
/**
*
*
* LWM2M path: /1024//6
*
* @tapVersion(">=1.0")
* @return call options
*/
getSecurityOptionsCall() {
const callOptions = Object.assign({}, this.resources.getSecurityOptions);
return callOptions;
}
/**
* Put lock infos
*
* LWM2M path: /1024//6
*
* @tapVersion(">=1.0")
* @param infos input
* @return
*/
putSecurityOptions(
/*
* lock informations
*/
infos) {
return this.serviceCallRunner.execute(this.putSecurityOptionsCall(infos));
}
/**
*
*
* LWM2M path: /1024//6
*
* @tapVersion(">=1.0")
* @param infos input
* @return call options
*/
putSecurityOptionsCall(
/*
* lock informations
*/
infos) {
const callOptions = Object.assign({}, this.resources.putSecurityOptions);
callOptions.body = infos;
return callOptions;
}
/**
* Get current group id
*
* LWM2M path: /1024//7
*
* @tapVersion(">=1.0")
* @return
*/
getCurrentGroupId() {
return this.serviceCallRunner.execute(this.getCurrentGroupIdCall());
}
/**
*
*
* LWM2M path: /1024//7
*
* @tapVersion(">=1.0")
* @return call options
*/
getCurrentGroupIdCall() {
const callOptions = Object.assign({}, this.resources.getCurrentGroupId);
return callOptions;
}
/**
* Get bundle Id for SWD Direct
*
* LWM2M path: /1024//100
*
* @tapVersion(">=1.23")
* @return
*/
getBundleIdSwdDirectAccess() {
return this.serviceCallRunner.execute(this.getBundleIdSwdDirectAccessCall());
}
/**
*
*
* LWM2M path: /1024//100
*
* @tapVersion(">=1.23")
* @return call options
*/
getBundleIdSwdDirectAccessCall() {
const callOptions = Object.assign({}, this.resources.getBundleIdSwdDirectAccess);
return callOptions;
}
/**
* Set bundle Id for SWD Direct
*
* LWM2M path: /1024//100
*
* @tapVersion(">=1.23")
* @param bundleId input
* @return
*/
putBundleIdSwdDirectAccess(
/*
*
*/
bundleId) {
return this.serviceCallRunner.execute(this.putBundleIdSwdDirectAccessCall(bundleId));
}
/**
*
*
* LWM2M path: /1024//100
*
* @tapVersion(">=1.23")
* @param bundleId input
* @return call options
*/
putBundleIdSwdDirectAccessCall(
/*
*
*/
bundleId) {
const callOptions = Object.assign({}, this.resources.putBundleIdSwdDirectAccess);
callOptions.body = bundleId;
return callOptions;
}
/**
* Get bundle Id for Serial Direct
*
* LWM2M path: /1024//101
*
* @tapVersion(">=1.23")
* @return
*/
getBundleIdSerialAccess() {
return this.serviceCallRunner.execute(this.getBundleIdSerialAccessCall());
}
/**
*
*
* LWM2M path: /1024//101
*
* @tapVersion(">=1.23")
* @return call options
*/
getBundleIdSerialAccessCall() {
const callOptions = Object.assign({}, this.resources.getBundleIdSerialAccess);
return callOptions;
}
/**
* Set bundle Id for Serial Direct
*
* LWM2M path: /1024//101
*
* @tapVersion(">=1.23")
* @param bundleId input
* @return
*/
putBundleIdSerialAccess(
/*
*
*/
bundleId) {
return this.serviceCallRunner.execute(this.putBundleIdSerialAccessCall(bundleId));
}
/**
*
*
* LWM2M path: /1024//101
*
* @tapVersion(">=1.23")
* @param bundleId input
* @return call options
*/
putBundleIdSerialAccessCall(
/*
*
*/
bundleId) {
const callOptions = Object.assign({}, this.resources.putBundleIdSerialAccess);
callOptions.body = bundleId;
return callOptions;
}
/**
* Get bundle Id for Modbus Direct
*
* LWM2M path: /1024//102
*
* @tapVersion(">=1.23")
* @return
*/
getBundleIdModbusDirectAccess() {
return this.serviceCallRunner.execute(this.getBundleIdModbusDirectAccessCall());
}
/**
*
*
* LWM2M path: /1024//102
*
* @tapVersion(">=1.23")
* @return call options
*/
getBundleIdModbusDirectAccessCall() {
const callOptions = Object.assign({}, this.resources.getBundleIdModbusDirectAccess);
return callOptions;
}
/**
* Set bundle Id for Modbus Direct
*
* LWM2M path: /1024//102
*
* @tapVersion(">=1.23")
* @param bundleId input
* @return
*/
putBundleIdModbusDirectAccess(
/*
*
*/
bundleId) {
return this.serviceCallRunner.execute(this.putBundleIdModbusDirectAccessCall(bundleId));
}
/**
*
*
* LWM2M path: /1024//102
*
* @tapVersion(">=1.23")
* @param bundleId input
* @return call options
*/
putBundleIdModbusDirectAccessCall(
/*
*
*/
bundleId) {
const callOptions = Object.assign({}, this.resources.putBundleIdModbusDirectAccess);
callOptions.body = bundleId;
return callOptions;
}
/**
* Get bundle Id for TapNPass Control
*
* LWM2M path: /1024//103
*
* @tapVersion(">=1.23")
* @return
*/
getBundleIdTapnpassControlAccess() {
return this.serviceCallRunner.execute(this.getBundleIdTapnpassControlAccessCall());
}
/**
*
*