UNPKG

@iotize/device-client.js

Version:

IoTize Device client for Javascript

156 lines (155 loc) 6.59 kB
"use strict"; /** * This file has been generated * DO NOT EDIT, IT MAY BE OVERWRITTEN */ var __extends = (this && this.__extends) || (function () { var extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var abstract_service_1 = require("../abstract-service"); var SinglePacketService = /** @class */ (function (_super) { __extends(SinglePacketService, _super); function SinglePacketService(client, apiConfig) { var _this = _super.call(this, client, apiConfig) || this; _this.resources = { 'bspe': { path: "/single-packet/bspe", methodType: "POST", bodyEncoder: "integer_uint32" }, 'getInfo': { path: "/single-packet-store/info", methodType: "GET", returnTypeConverter: "SinglePacketStoreInfo" }, 'writePartialSinglePacket': { path: "/single-packet/part", methodType: "POST", bodyEncoder: "SinglePacketPart" }, 'writeSmallSinglePacket': { path: "/single-packet/write", methodType: "POST", returnTypeConverter: "Bytes", bodyEncoder: "Bytes" }, }; return _this; } /** * Execute (after validation) a big Single Packet previously sent to the TAP using BSPP. * Execute (after validation) a big Single Packet previously sent to the TAP using BSPP. Stored packet is erased after packet is executed. (even if failed to execute) This command contains some control information (size, hash, CRC, salt, etc.) TBD * LWM2M path: /1024//83 * Body converter id: "integer_uint32" * @tapVersion(">=1.13") * @param data input * @return void api call */ SinglePacketService.prototype.bspe = function (data) { var callOptions = this.bspeCall(data); return this._call(callOptions); }; /** * Execute (after validation) a big Single Packet previously sent to the TAP using BSPP. * Execute (after validation) a big Single Packet previously sent to the TAP using BSPP. Stored packet is erased after packet is executed. (even if failed to execute) This command contains some control information (size, hash, CRC, salt, etc.) TBD * LWM2M path: /1024//83 * Body converter id: "integer_uint32" * @tapVersion(">=1.13") * @param data input * @return call options */ SinglePacketService.prototype.bspeCall = function (data) { var callOptions = this.resources.bspe; callOptions.body = data; callOptions.pathParameters = {}; return callOptions; }; /** * Get information concerning Single Packet Store Status * Get information concerning Single Packet Store Status : Does this TAP provide the Single Packet Store ? (SPS) Is the store empty, full or halfway ? Details about the the execution of the last executes SP ? * LWM2M path: /1024//81 * @tapVersion(">=1.13") * @return SinglePacketStoreInfo api call */ SinglePacketService.prototype.getInfo = function () { var callOptions = this.getInfoCall(); return this._call(callOptions); }; /** * Get information concerning Single Packet Store Status * Get information concerning Single Packet Store Status : Does this TAP provide the Single Packet Store ? (SPS) Is the store empty, full or halfway ? Details about the the execution of the last executes SP ? * LWM2M path: /1024//81 * @tapVersion(">=1.13") * @return call options */ SinglePacketService.prototype.getInfoCall = function () { var callOptions = this.resources.getInfo; return callOptions; }; /** * Send a partial Single Packet to the TAP. * Size of the packet = 130 bytes : 2 bytes offset, 128 bytes packet part. Stored packet is erased when packet part 0 is received. * LWM2M path: /1024//82 * Body converter id: "SinglePacketPart" * @tapVersion(">=1.13") * @param data input * @return void api call */ SinglePacketService.prototype.writePartialSinglePacket = function (data) { var callOptions = this.writePartialSinglePacketCall(data); return this._call(callOptions); }; /** * Send a partial Single Packet to the TAP. * Size of the packet = 130 bytes : 2 bytes offset, 128 bytes packet part. Stored packet is erased when packet part 0 is received. * LWM2M path: /1024//82 * Body converter id: "SinglePacketPart" * @tapVersion(">=1.13") * @param data input * @return call options */ SinglePacketService.prototype.writePartialSinglePacketCall = function (data) { var callOptions = this.resources.writePartialSinglePacket; callOptions.body = data; callOptions.pathParameters = {}; return callOptions; }; /** * Send a complete Small Single Packet to the TAP. Size of the packet < 120 bytes * * LWM2M path: /1024//80 * Body converter id: "Bytes" * @tapVersion(">=1.13") * @param data input * @return Uint8Array api call */ SinglePacketService.prototype.writeSmallSinglePacket = function (data) { var callOptions = this.writeSmallSinglePacketCall(data); return this._call(callOptions); }; /** * Send a complete Small Single Packet to the TAP. Size of the packet < 120 bytes * * LWM2M path: /1024//80 * Body converter id: "Bytes" * @tapVersion(">=1.13") * @param data input * @return call options */ SinglePacketService.prototype.writeSmallSinglePacketCall = function (data) { var callOptions = this.resources.writeSmallSinglePacket; callOptions.body = data; callOptions.pathParameters = {}; return callOptions; }; return SinglePacketService; }(abstract_service_1.AbstractService)); exports.SinglePacketService = SinglePacketService;