Skip to content

FirmwareService

Method LWM2M request Description
getState GET /5//3
alias: /firmware/state
Get state
getUpdateResult GET /5//5
alias: /firmware/update-result
Get firmware update result
postCrcCheck POST /5//6
alias: /firmware/crc-check
Check CRC
postPackage POST /5//0
alias: /firmware/package
Firmware package 
postUpdate POST /5//2
alias: /firmware/update
Update

getState

Minimal Tap Firmware version: >= 1.0

Get state

Example

let myService = new FirmwareService();

try{
    let call = myService.getState();
    let value = (await call).body();
    console.log(`getState: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import .FirmwareService;

ServiceFactory serviceFactory = ...;
FirmwareService myService = serviceFactory.create(FirmwareService.class);


try {
    Call<FirmwareState> call = myService.getState();
    Response<FirmwareState> 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 FirmwareService#getState");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<FirmwareState> = try tap.service.firmware.getState();
print("Response:" + response.body())

Parameters

This endpoint does not need any parameter.

Return type

FirmwareState

Authorization

No authorization required

getUpdateResult

Minimal Tap Firmware version: >= 1.0

Get firmware update result

Example

let myService = new FirmwareService();

try{
    let call = myService.getUpdateResult();
    let value = (await call).body();
    console.log(`getUpdateResult: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import .FirmwareService;

ServiceFactory serviceFactory = ...;
FirmwareService myService = serviceFactory.create(FirmwareService.class);


try {
    Call<FirmwareUpdateResult> call = myService.getUpdateResult();
    Response<FirmwareUpdateResult> 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 FirmwareService#getUpdateResult");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<FirmwareUpdateResult> = try tap.service.firmware.getUpdateResult();
print("Response:" + response.body())

Parameters

This endpoint does not need any parameter.

Return type

FirmwareUpdateResult

Authorization

No authorization required

postCrcCheck

Minimal Tap Firmware version: >= 1.0

Check CRC

Compare le CRC attendu au CRC de la zone référencée. Modifie le Update Result (resource /5//5) à 1 si OK ou 5 si NG.

Example

let myService = new FirmwareService();
let data = ; // CrcCheckBody | 

try{
    let call = myService.postCrcCheck(data);
    let value = (await call).body();
    console.log(`postCrcCheck: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import .FirmwareService;

ServiceFactory serviceFactory = ...;
FirmwareService myService = serviceFactory.create(FirmwareService.class);


CrcCheckBody data = ; // CrcCheckBody | 
try {
    Call<Bytes> call = myService.postCrcCheck(data);
    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 FirmwareService#postCrcCheck");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Bytes> = try tap.service.firmware.postCrcCheck(data);
print("Response:" + response.body())

Parameters

Name Type Description Notes
data CrcCheckBodyCrcCheckBody

Return type

Bytes

Authorization

No authorization required

postPackage

Minimal Tap Firmware version: >= 1.0

Firmware package 

Firmware package : actif uniquement en mode update. Permet de transférer les données à programmer en flash pour l'update firmware.

Example

let myService = new FirmwareService();

try{
    let call = myService.postPackage();
    let value = (await call).body();
    console.log(`postPackage: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import .FirmwareService;

ServiceFactory serviceFactory = ...;
FirmwareService myService = serviceFactory.create(FirmwareService.class);


try {
    Call<Void> call = myService.postPackage();
    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 FirmwareService#postPackage");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Any> = try tap.service.firmware.postPackage();
print("Response:" + response.body())

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

No authorization required

postUpdate

Minimal Tap Firmware version: >= 1.0

Update

Contrôle de l'update: passage en mode update/updater/normal. Param: état futur souhaité. Actif uniquement si loggé en admin. (plus autres contraintes à définir: CRC check fait, etc.) Peut nécessiter un Reset du module

Example

let myService = new FirmwareService();

try{
    let call = myService.postUpdate();
    let value = (await call).body();
    console.log(`postUpdate: ${value}`);
}
catch (ex){
    // No response from device / response error (ie: device is not connected or request timeout)
    console.error(ex);
}
import .FirmwareService;

ServiceFactory serviceFactory = ...;
FirmwareService myService = serviceFactory.create(FirmwareService.class);


try {
    Call<Void> call = myService.postUpdate();
    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 FirmwareService#postUpdate");
    e.printStackTrace();
}
import TapDeviceClient
let tap: TapDevice = // ...

let ApiResponse<Any> = try tap.service.firmware.postUpdate();
print("Response:" + response.body())

Parameters

This endpoint does not need any parameter.

Return type

null (empty response body)

Authorization

No authorization required