VariableService¶
Method | LWM2M request | Description |
---|---|---|
create | POST /1029/{variableId}/65535 alias: /variable/{variableId}/create |
Write variable bundle id |
getAddress | GET /1029/{variableId}/0 alias: /variable/{variableId}/address |
Get variable address |
getBundleId | GET /1029/{variableId}/6 alias: /variable/{variableId}/bundle/id |
Get variable bundle id |
getBundleValues | GET /1029/{variableId}/7 alias: /variable/{variableId}/bundle/values |
Get variable bundle values (formated as a TLV) |
getCurrentAccess | GET /1029/{variableId}/3 alias: /variable/{variableId}/current-access |
Get access rights for the variable |
getFormat | GET /1029/{variableId}/1 alias: /variable/{variableId}/format |
Get data format for variable |
getName | GET /1029/{variableId}/8 alias: /variable/{variableId}/name |
Get variable name |
getNumberOfElements | GET /1029/{variableId}/2 alias: /variable/{variableId}/number-of-elements |
Get variable array size |
getType | GET /1029/{variableId}/1 alias: /variable/{variableId}/type |
Get data type for variable |
getUnit | GET /1029/{variableId}/9 alias: /variable/{variableId}/unit |
Get variable unit |
getValue | GET /1029/{variableId}/4 alias: /variable/{variableId}/value |
Get variable value |
putAddress | PUT /1029/{variableId}/0 alias: /variable/{variableId}/address |
Write variable address |
putBundleId | PUT /1029/{variableId}/6 alias: /variable/{variableId}/bundle/id |
Write variable bundle id |
putFormat | PUT /1029/{variableId}/1 alias: /variable/{variableId}/format |
Set data format of the variable |
putName | PUT /1029/{variableId}/8 alias: /variable/{variableId}/name |
Write variable name |
putNumberOfElements | PUT /1029/{variableId}/2 alias: /variable/{variableId}/number-of-elements |
Write variable array size |
putUnit | PUT /1029/{variableId}/9 alias: /variable/{variableId}/unit |
Write variable unit |
putValue | PUT /1029/{variableId}/4 alias: /variable/{variableId}/value |
Set variable value |
readProfile | GET /1029//4 alias: /variable/read-profile |
Get all variable values for the current profile |
setValue | POST /1029/{variableId}/5 alias: /variable/{variableId}/set-value |
Set variable value |
create¶
Minimal Tap Firmware version: >= 1.0
Write variable bundle id
Create a variable
Example¶
let myService = new VariableService();
let variableId = 56; // Integer |
let extraSize = 56; // Integer | extra data size in bytes
try {
let call = myService.create(variableId, extraSize);
let value = (await call).body();
console.log(`create: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer |
Integer extraSize = 56; // Integer | extra data size in bytes
try {
Call<Void> call = myService.create(variableId, extraSize);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#create");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.create(variableId, extraSize);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ||
extraSize | Integer | extra data size in bytes | [optional] |
Return type¶
null (empty response body)
Authorization¶
No authorization required
getAddress¶
Minimal Tap Firmware version: >= 1.0
Get variable address
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
try {
let call = myService.getAddress(variableId);
let value = (await call).body();
console.log(`getAddress: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
try {
Call<Integer> call = myService.getAddress(variableId);
Response<Integer> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getAddress");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Integer> = try tap.service.variable.getAddress(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable |
Return type¶
Authorization¶
No authorization required
getBundleId¶
Minimal Tap Firmware version: >= 1.0
Get variable bundle id
ID du bundle qui contient la variable
Example¶
let myService = new VariableService();
let variableId = 56; // Integer |
try {
let call = myService.getBundleId(variableId);
let value = (await call).body();
console.log(`getBundleId: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer |
try {
Call<Integer> call = myService.getBundleId(variableId);
Response<Integer> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getBundleId");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Integer> = try tap.service.variable.getBundleId(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer |
Return type¶
Authorization¶
No authorization required
getBundleValues¶
Minimal Tap Firmware version: >= 1.0
Get variable bundle values (formated as a TLV)
Example¶
let myService = new VariableService();
let variableId = 56; // Integer |
try {
let call = myService.getBundleValues(variableId);
let value = (await call).body();
console.log(`getBundleValues: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer |
try {
Call<Bytes> call = myService.getBundleValues(variableId);
Response<Bytes> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getBundleValues");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Bytes> = try tap.service.variable.getBundleValues(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer |
Return type¶
Authorization¶
No authorization required
getCurrentAccess¶
Minimal Tap Firmware version: >= 1.0
Get access rights for the variable
Get access rights for the variable (read and write)
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
try {
let call = myService.getCurrentAccess(variableId);
let value = (await call).body();
console.log(`getCurrentAccess: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
try {
Call<ReadWriteRights> call = myService.getCurrentAccess(variableId);
Response<ReadWriteRights> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getCurrentAccess");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<ReadWriteRights> = try tap.service.variable.getCurrentAccess(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable |
Return type¶
Authorization¶
No authorization required
getFormat¶
Minimal Tap Firmware version: >= 1.0
Get data format for variable
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
try {
let call = myService.getFormat(variableId);
let value = (await call).body();
console.log(`getFormat: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
try {
Call<VariableFormat> call = myService.getFormat(variableId);
Response<VariableFormat> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getFormat");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<VariableFormat> = try tap.service.variable.getFormat(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable |
Return type¶
Authorization¶
No authorization required
getName¶
Minimal Tap Firmware version: >= 1.60 Maximal Tap Firmware version: 1.71
Get variable name
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
try {
let call = myService.getName(variableId);
let value = (await call).body();
console.log(`getName: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
try {
Call<String> call = myService.getName(variableId);
Response<String> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getName");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<String> = try tap.service.variable.getName(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable |
Return type¶
Authorization¶
No authorization required
getNumberOfElements¶
Minimal Tap Firmware version: >= 1.0
Get variable array size
Get the number of element of the variable
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
try {
let call = myService.getNumberOfElements(variableId);
let value = (await call).body();
console.log(`getNumberOfElements: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
try {
Call<Integer> call = myService.getNumberOfElements(variableId);
Response<Integer> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getNumberOfElements");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Integer> = try tap.service.variable.getNumberOfElements(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable |
Return type¶
Authorization¶
No authorization required
getType¶
Minimal Tap Firmware version: >= 1.0
Get data type for variable
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
try {
let call = myService.getType(variableId);
let value = (await call).body();
console.log(`getType: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
try {
Call<VariableType> call = myService.getType(variableId);
Response<VariableType> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getType");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<VariableType> = try tap.service.variable.getType(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable |
Return type¶
Authorization¶
No authorization required
getUnit¶
Minimal Tap Firmware version: >= 1.60 Maximal Tap Firmware version: 1.71
Get variable unit
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | Variable id
try {
let call = myService.getUnit(variableId);
let value = (await call).body();
console.log(`getUnit: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | Variable id
try {
Call<String> call = myService.getUnit(variableId);
Response<String> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getUnit");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<String> = try tap.service.variable.getUnit(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | Variable id |
Return type¶
Authorization¶
No authorization required
getValue¶
Minimal Tap Firmware version: >= 1.0
Get variable value
Value of array of values. The size depends of variable format
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
try {
let call = myService.getValue(variableId);
let value = (await call).body();
console.log(`getValue: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
try {
Call<Bytes> call = myService.getValue(variableId);
Response<Bytes> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#getValue");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Bytes> = try tap.service.variable.getValue(variableId);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable |
Return type¶
Authorization¶
No authorization required
putAddress¶
Minimal Tap Firmware version: >= 1.0
Write variable address
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
let address = 56; // Integer | New address of the variable
try {
let call = myService.putAddress(variableId, address);
let value = (await call).body();
console.log(`putAddress: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
Integer address = 56; // Integer | New address of the variable
try {
Call<Void> call = myService.putAddress(variableId, address);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#putAddress");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.putAddress(variableId, address);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable | |
address | Integer | New address of the variable |
Return type¶
null (empty response body)
Authorization¶
No authorization required
putBundleId¶
Minimal Tap Firmware version: >= 1.0
Write variable bundle id
Example¶
let myService = new VariableService();
let variableId = 56; // Integer |
let value = 56; // Integer |
try {
let call = myService.putBundleId(variableId, value);
let value = (await call).body();
console.log(`putBundleId: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer |
Integer value = 56; // Integer |
try {
Call<Void> call = myService.putBundleId(variableId, value);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#putBundleId");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.putBundleId(variableId, value);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ||
value | Integer |
Return type¶
null (empty response body)
Authorization¶
No authorization required
putFormat¶
Minimal Tap Firmware version: >= 1.0
Set data format of the variable
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
let value = ; // VariableFormat | New format of the variable
try{
let call = myService.putFormat(variableId, value);
let value = (await call).body();
console.log(`putFormat: ${value}`);
}
catch (ex){
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
VariableFormat value = ; // VariableFormat | New format of the variable
try {
Call<Void> call = myService.putFormat(variableId, value);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#putFormat");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.putFormat(variableId, value);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable | |
value | VariableFormatVariableFormat | New format of the variable |
Return type¶
null (empty response body)
Authorization¶
No authorization required
putName¶
Minimal Tap Firmware version: >= 1.60 Maximal Tap Firmware version: 1.71
Write variable name
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
let address = address_example; // String | Variable name
try {
let call = myService.putName(variableId, address);
let value = (await call).body();
console.log(`putName: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
String address = address_example; // String | Variable name
try {
Call<Void> call = myService.putName(variableId, address);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#putName");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.putName(variableId, address);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable | |
address | String | Variable name |
Return type¶
null (empty response body)
Authorization¶
No authorization required
putNumberOfElements¶
Minimal Tap Firmware version: >= 1.0
Write variable array size
Set the number of element of the variable
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
let value = 56; // Integer | New number of element for this variable
try {
let call = myService.putNumberOfElements(variableId, value);
let value = (await call).body();
console.log(`putNumberOfElements: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
Integer value = 56; // Integer | New number of element for this variable
try {
Call<Void> call = myService.putNumberOfElements(variableId, value);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#putNumberOfElements");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.putNumberOfElements(variableId, value);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable | |
value | Integer | New number of element for this variable |
Return type¶
null (empty response body)
Authorization¶
No authorization required
putUnit¶
Minimal Tap Firmware version: >= 1.60 Maximal Tap Firmware version: 1.71
Write variable unit
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
let address = address_example; // String | Variable unit
try {
let call = myService.putUnit(variableId, address);
let value = (await call).body();
console.log(`putUnit: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
String address = address_example; // String | Variable unit
try {
Call<Void> call = myService.putUnit(variableId, address);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#putUnit");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.putUnit(variableId, address);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable | |
address | String | Variable unit |
Return type¶
null (empty response body)
Authorization¶
No authorization required
putValue¶
Minimal Tap Firmware version: >= 1.0
Set variable value
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
let value = BINARY_DATA_HERE; // Bytes |
try {
let call = myService.putValue(variableId, value);
let value = (await call).body();
console.log(`putValue: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
Bytes value = BINARY_DATA_HERE; // Bytes |
try {
Call<Void> call = myService.putValue(variableId, value);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#putValue");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.putValue(variableId, value);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable | |
value | BytesBytes |
Return type¶
null (empty response body)
Authorization¶
No authorization required
readProfile¶
Minimal Tap Firmware version: >= 1.0
Get all variable values for the current profile
Example¶
let myService = new VariableService();
try {
let call = myService.readProfile();
let value = (await call).body();
console.log(`readProfile: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
try {
Call<Bytes> call = myService.readProfile();
Response<Bytes> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#readProfile");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Bytes> = try tap.service.variable.readProfile();
print("Response:" + response.body())
Parameters¶
This endpoint does not need any parameter.
Return type¶
Authorization¶
No authorization required
setValue¶
Minimal Tap Firmware version: >= 1.0
Set variable value
Difference with put ?
Example¶
let myService = new VariableService();
let variableId = 56; // Integer | ID of the variable
let value = BINARY_DATA_HERE; // Bytes |
try {
let call = myService.setValue(variableId, value);
let value = (await call).body();
console.log(`setValue: ${value}`);
} catch (ex) {
// No response from device / response error (ie: device is not connected or request timeout)
console.error(ex);
}
import .VariableService;
ServiceFactory serviceFactory = ...;
VariableService myService = serviceFactory.create(VariableService.class);
Integer variableId = 56; // Integer | ID of the variable
Bytes value = BINARY_DATA_HERE; // Bytes |
try {
Call<Void> call = myService.setValue(variableId, value);
Response<Void> response = call.execute();
if (response.isSuccessful()){
System.out.println(response.body());
}
else{
System.out.println(DeviceResponseError.createErrorMessage(response));
}
} catch (ApiException e) {
System.err.println("Exception when calling VariableService#setValue");
e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...
let ApiResponse<Any> = try tap.service.variable.setValue(variableId, value);
print("Response:" + response.body())
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
variableId | Integer | ID of the variable | |
value | BytesBytes |
Return type¶
null (empty response body)
Authorization¶
No authorization required