FileSystemService¶
Method | LwM2M request | Description |
---|---|---|
selectFile | post /1032//1 alias: /file-system/select-file |
select file |
unselectFile | post /1032//2 alias: /file-system/unselect-file |
unselect file |
writeSelectedFile | post /1032//3 alias: /file-system/write-selected-file |
write data to file |
setSelectedFileBundleId | post /1032//10 alias: /file-system/selected-file-bundle-id |
write bundle id to file |
setSelectedFileUserId | post /1032//11 alias: /file-system/selected-file-user-id |
write user id to file |
readSelectedFile | get /1032//4 alias: /file-system/read-selected-file |
read data from the selected file |
deleteSelectedFile | post /1032//6 alias: /file-system/delete-selected-file |
delete file |
clearAllFiles | post /1032//7 alias: /file-system/clear-all-files |
clear all files |
getSelectedFileSize | get /1032//5 alias: /file-system/selected-file-size |
get size of the selected file |
listFiles | post /1032//9 alias: /file-system/list-files |
list files |
selectFile¶
Minimal Tap Firmware version: 2.13
select file
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
fileName | string | name of the file to select. file name format = DOS : 8.3 (namemax8.ext) ... | optional |
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const fileName = {
"filename": "myfile.txt"
};
const response = await tap.service.filesystem.selectFile(fileName);
const value = response.body();
console.log(`selectFile: ${value}`);
unselectFile¶
Minimal Tap Firmware version: 2.13
unselect file
Parameters¶
This endpoint does not need any parameter.
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const response = await tap.service.filesystem.unselectFile();
const value = response.body();
console.log(`unselectFile: ${value}`);
writeSelectedFile¶
Minimal Tap Firmware version: 2.13
write data to file
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
data | Uint8Array | data to write in the file. binary. | optional |
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const data = ...;
const response = await tap.service.filesystem.writeSelectedFile(data);
const value = response.body();
console.log(`writeSelectedFile: ${value}`);
setSelectedFileBundleId¶
Minimal Tap Firmware version: 2.13
write bundle id to file
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
bundleId | number | bundle id for the file being written. binary. | optional |
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const bundleId = ...;
const response = await tap.service.filesystem.setSelectedFileBundleId(bundleId);
const value = response.body();
console.log(`setSelectedFileBundleId: ${value}`);
setSelectedFileUserId¶
Minimal Tap Firmware version: 2.13
write user id to file
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
userId | number | user id for the file being written. binary. | optional |
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const userId = ...;
const response = await tap.service.filesystem.setSelectedFileUserId(userId);
const value = response.body();
console.log(`setSelectedFileUserId: ${value}`);
readSelectedFile¶
Minimal Tap Firmware version: 2.13
read data from the selected file
Parameters¶
Name | Type | Description | Notes |
---|---|---|---|
options | ReadSelectedFileParams | optional |
Returns¶
Uint8Array
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const options = ...;
const response = await tap.service.filesystem.readSelectedFile(options);
const value = response.body();
console.log(`readSelectedFile: ${value}`);
deleteSelectedFile¶
Minimal Tap Firmware version: 2.13
delete file
Parameters¶
This endpoint does not need any parameter.
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const response = await tap.service.filesystem.deleteSelectedFile();
const value = response.body();
console.log(`deleteSelectedFile: ${value}`);
clearAllFiles¶
Minimal Tap Firmware version: 2.13
clear all files
Parameters¶
This endpoint does not need any parameter.
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const response = await tap.service.filesystem.clearAllFiles();
const value = response.body();
console.log(`clearAllFiles: ${value}`);
getSelectedFileSize¶
Minimal Tap Firmware version: 2.13
get size of the selected file
Parameters¶
This endpoint does not need any parameter.
Returns¶
number (uint32)
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const response = await tap.service.filesystem.getSelectedFileSize();
const value = response.body();
console.log(`getSelectedFileSize: ${value}`);
listFiles¶
Minimal Tap Firmware version: 2.13
list files
Parameters¶
This endpoint does not need any parameter.
Returns¶
Nothing
Example¶
import { Tap } from "@iotize/tap";
const tap: Tap = ...;
const response = await tap.service.filesystem.listFiles();
const value = response.body();
console.log(`listFiles: ${value}`);