VariableService¶
Method | LwM2M request | Description |
---|---|---|
getVariableAddress | get /1029/{variableId}/0 alias: /variable/{variableId}/variable-address |
Get variable address |
putVariableAddress | put /1029/{variableId}/0 alias: /variable/{variableId}/variable-address |
Write variable address |
putModbusVariableAddress | put /1029/{variableId}/0 alias: /variable/{variableId}/modbus-variable-address |
Write modbus variable address |
getType | get /1029/{variableId}/1 alias: /variable/{variableId}/type |
Get data type for variable |
putType | put /1029/{variableId}/1 alias: /variable/{variableId}/type |
Get data type for variable |
getRawMeta | get /1029/{variableId}/8 alias: /variable/{variableId}/raw-meta |
Get variable meta |
putRawMeta | put /1029/{variableId}/8 alias: /variable/{variableId}/raw-meta |
Write variable meta |
getMeta | get /1029/{variableId}/8 alias: /variable/{variableId}/meta |
Get variable meta |
putMeta | put /1029/{variableId}/8 alias: /variable/{variableId}/meta |
Write variable meta |
getUnit | get /1029/{variableId}/9 alias: /variable/{variableId}/unit |
Get variable unit |
putUnit | put /1029/{variableId}/9 alias: /variable/{variableId}/unit |
Write variable unit |
getNumberOfElements | get /1029/{variableId}/2 alias: /variable/{variableId}/number-of-elements |
Get variable array size |
putNumberOfElements | put /1029/{variableId}/2 alias: /variable/{variableId}/number-of-elements |
Write variable array size |
getCurrentAccess | get /1029/{variableId}/3 alias: /variable/{variableId}/current-access |
Get access rights for the variable |
readProfile | get /1029//4 alias: /variable/read-profile |
Get values of all variable for the current profile |
getValue | get /1029/{variableId}/4 alias: /variable/{variableId}/value |
Get variable value |
setValue | post /1029/{variableId}/5 alias: /variable/{variableId}/value |
Set variable value |
putValue | put /1029/{variableId}/4 alias: /variable/{variableId}/value |
Set variable value |
getBundleId | get /1029/{variableId}/6 alias: /variable/{variableId}/bundle/id |
Get variable bundle id |
putBundleId | put /1029/{variableId}/6 alias: /variable/{variableId}/bundle/id |
Write variable bundle id |
getBundleValues | get /1029/{variableId}/7 alias: /variable/{variableId}/bundle/values |
Get variable bundle values (formated as a TLV) |
create | post /1029/{variableId}/65535 alias: /variable/{variableId}/create |
Create a variable |
getVariableAddress¶
Minimal Tap Firmware version: 1.0
Get variable address
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable |
Returns¶
number (uint32)
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getVariableAddress(variableId);
const value = response.body();
console.log(`getVariableAddress: ${value}`);
putVariableAddress¶
Minimal Tap Firmware version: 1.0
Write variable address
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
address | number | New address of the variable |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const address = ...;
const response = await tap.service.variable.putVariableAddress(variableId, address);
const value = response.body();
console.log(`putVariableAddress: ${value}`);
putModbusVariableAddress¶
Minimal Tap Firmware version: 1.0
Write modbus variable address
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
address | ModbusVariableAddress | New address of the variable |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const address = ...;
const response = await tap.service.variable.putModbusVariableAddress(variableId, address);
const value = response.body();
console.log(`putModbusVariableAddress: ${value}`);
getType¶
Minimal Tap Firmware version: 1.0
Get data type for variable
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable |
Returns¶
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getType(variableId);
const value = response.body();
console.log(`getType: ${value}`);
putType¶
Minimal Tap Firmware version: 1.0
Get data type for variable
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
type | VariableType | variable type |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const type = ...;
const response = await tap.service.variable.putType(variableId, type);
const value = response.body();
console.log(`putType: ${value}`);
getRawMeta¶
Minimal Tap Firmware version: 1.73
Get variable meta
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable |
Returns¶
Uint8Array
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getRawMeta(variableId);
const value = response.body();
console.log(`getRawMeta: ${value}`);
putRawMeta¶
Minimal Tap Firmware version: 1.73
Write variable meta
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
meta | Uint8Array | Variable meta |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const meta = ...;
const response = await tap.service.variable.putRawMeta(variableId, meta);
const value = response.body();
console.log(`putRawMeta: ${value}`);
getMeta¶
Minimal Tap Firmware version: 1.73
Get variable meta
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable |
Returns¶
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getMeta(variableId);
const value = response.body();
console.log(`getMeta: ${value}`);
putMeta¶
Minimal Tap Firmware version: 1.73
Write variable meta
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
meta | VariableMeta | Variable meta |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const meta = ...;
const response = await tap.service.variable.putMeta(variableId, meta);
const value = response.body();
console.log(`putMeta: ${value}`);
getUnit¶
Minimal Tap Firmware version: 1.60
Maximal Tap Firmware version: 1.71
Get variable unit
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | Variable id |
Returns¶
string
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getUnit(variableId);
const value = response.body();
console.log(`getUnit: ${value}`);
putUnit¶
Minimal Tap Firmware version: 1.60
Maximal Tap Firmware version: 1.71
Write variable unit
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
address | string | Variable unit |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const address = ...;
const response = await tap.service.variable.putUnit(variableId, address);
const value = response.body();
console.log(`putUnit: ${value}`);
getNumberOfElements¶
Minimal Tap Firmware version: 1.0
Get variable array size
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable |
Returns¶
number (uint8)
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getNumberOfElements(variableId);
const value = response.body();
console.log(`getNumberOfElements: ${value}`);
putNumberOfElements¶
Minimal Tap Firmware version: 1.0
Write variable array size
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
value | number | New number of element for this variable |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const value = ...;
const response = await tap.service.variable.putNumberOfElements(variableId, value);
const value = response.body();
console.log(`putNumberOfElements: ${value}`);
getCurrentAccess¶
Minimal Tap Firmware version: 1.0
Get access rights for the variable
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable |
Returns¶
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getCurrentAccess(variableId);
const value = response.body();
console.log(`getCurrentAccess: ${value}`);
readProfile¶
Minimal Tap Firmware version: 1.0
Get values of all variable for the current profile
Parameters¶
This endpoint does not need any parameter.
Returns¶
Uint8Array
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const response = await tap.service.variable.readProfile();
const value = response.body();
console.log(`readProfile: ${value}`);
getValue¶
Minimal Tap Firmware version: 1.0
Get variable value
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable |
Returns¶
Uint8Array
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getValue(variableId);
const value = response.body();
console.log(`getValue: ${value}`);
setValue¶
Minimal Tap Firmware version: 1.0
Set variable value
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
value | Uint8Array |
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const value = ...;
const response = await tap.service.variable.setValue(variableId, value);
const value = response.body();
console.log(`setValue: ${value}`);
putValue¶
Minimal Tap Firmware version: 1.0
Set variable value
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ID of the variable | |
value | Uint8Array |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const value = ...;
const response = await tap.service.variable.putValue(variableId, value);
const value = response.body();
console.log(`putValue: ${value}`);
getBundleId¶
Minimal Tap Firmware version: 1.0
Get variable bundle id
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) |
Returns¶
number (uint16)
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getBundleId(variableId);
const value = response.body();
console.log(`getBundleId: ${value}`);
putBundleId¶
Minimal Tap Firmware version: 1.0
Write variable bundle id
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ||
value | number |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const value = ...;
const response = await tap.service.variable.putBundleId(variableId, value);
const value = response.body();
console.log(`putBundleId: ${value}`);
getBundleValues¶
Minimal Tap Firmware version: 1.0
Get variable bundle values (formated as a TLV)
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) |
Returns¶
Uint8Array
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const variableId = ...;
const response = await tap.service.variable.getBundleValues(variableId);
const value = response.body();
console.log(`getBundleValues: ${value}`);
create¶
Minimal Tap Firmware version: 1.0
Create a variable
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | number (uint16) | ||
extraSize | number | extra data size in bytes | optional |
Returns¶
Nothing
Authorization¶
- Configuration mode is required to perform this request.
Example¶
import { Tap } from "@iotize/tap";
import '@iotize/tap/ext/configurator';
const tap: Tap = ...;
await tap.configurator.setupConfigMode();
const variableId = ...;
const extraSize = ...;
const response = await tap.service.variable.create(variableId, extraSize);
const value = response.body();
console.log(`create: ${value}`);