SD Card
Цей контент ще не доступний вашою мовою.
List Files and Directories
Section titled “List Files and Directories”Returns a list of files and subdirectories.
POST /api/card/dir/
Request Parameters:
| Field | Type | Required | Description |
|---|---|---|---|
path | string | Yes | Absolute path to directory. |
fromIdx | integer | No | Start index (default 0). |
toIdx | integer | No | End index. |
Example Request:
{ "path": "/logs", "fromIdx": 0}Response:
| Field | Type | Description |
|---|---|---|
fromIdx | integer / null | Index of first returned element. |
toIdx | integer / null | Index of last returned element. |
total | integer | Total items in directory. |
items | array | Array of file/directory objects. |
Each item in items contains:
| Field | Type | Description |
|---|---|---|
name | string | File or directory name. |
attrib | string | Attributes: d (dir), r (read), w (write). |
size | integer | File size in bytes. |
datetime | string | Last modification time (ISO 8601). |
Example Response:
{ "fromIdx": 0, "toIdx": 0, "total": 1, "items": [ { "name": "ATM.LOG", "attrib": "-rw", "size": 5768906, "datetime": "2025-04-16T16:07:38" } ]}Get File Info
Section titled “Get File Info”Returns metadata about a file.
POST /api/card/file/info/
Request Parameters:
| Parameter | Type | Description |
|---|---|---|
path | string | Absolute path to file. |
Example Request:
{ "path": "/sgs.bin"}Response:
| Field | Type | Description |
|---|---|---|
name | string | File name. |
attrib | string | File attributes in POSIX format (drw). |
size | integer | File size in bytes. |
datetime | string | Last modification date (ISO 8601 format). |
Example Response:
{ "name": "SGS.BIN", "attrib": "-rw", "size": 860, "datetime": "2025-04-16T15:12:52"}Read File
Section titled “Read File”Returns file data block in base64 encoding.
POST /api/card/file/read/
Request Parameters:
| Field | Type | Description |
|---|---|---|
path | string | Absolute path to file. |
blockIdx | integer | Block number (starting from 0). |
Example Request:
{ "path": "/sgs.bin", "blockIdx": 0}Response:
| Field | Type | Description |
|---|---|---|
blockIdx | integer | Current block number. |
blockCount | integer | Total number of blocks in the file. |
data | string | Base64 encoded data of the current block (1024 bytes). |
Example Response:
{ "blockIdx": 0, "blockCount": 2, "data": "63sM/2R3ki8uAC4AAQBMA9AHCAQBAAEBAAEAAAEBAW8FAQELAw8DPFAAWAJuZf//9gGXiHgAyADoAxQABQAAAFoAAACAJQAAgIwo2MCoAHP///8AwKgAAQgICAgICAQE2IA5aQ5tZ2FwAAAAAAAAAAAAZ2FwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4TADs5AAACbnRwLnRpbWUuaW4udWEAAAAAAAAAAG50cDIuc3RyYXR1bTEucnUAAAAAAAABGAEMAwoHAgoKBwIAABMAKjExMSMAAAAAAAAAAAAAAMCoAHD2AegDFAAAAAAAAf8AAAAAAAAAAAAAAADAqABx9gHoAxQAAAAAAAH/AAAAAAAAAAAAAAAAwKgAcvYB6AMUAAAAAAAB/wAAAAAAAAAAAAAAAMCoAHP2AegDFAAAAAAAAf8AAAAAAAAAAAAAAADAqAB09gE="}Write File
Section titled “Write File”Uploads file data to SD card.
POST /api/card/file/write/
Request Parameters:
| Field | Type | Description |
|---|---|---|
path | string | Absolute path to file (e.g., /file.bin). |
blockIdx | integer | Block number to write (starting from 0). |
blockCount | integer | Total number of blocks to write. |
data | string | Base64 encoded data to write (1024 bytes per block). |
Note: Data in blocks must be strictly 1024 bytes, except for the last block.
Example Request:
{ "path": "/file.bin", "blockIdx": 0, "blockCount": 2, "data": "63sM/2R3ki8uAC4AAQBMA9AHCAQBAAEBAAEAAAEBAW8FAQELAw8DPFAAWAJuZf//9gGXiHgAyADoAxQABQAAAFoAAACAJQAAgIwo2MCoAHP///8AwKgAAQgICAgICAQE2IA5aQ5tZ2FwAAAAAAAAAAAAZ2FwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAKAAH/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB4TADs5AAACbnRwLnRpbWUuaW4udWEAAAAAAAAAAG50cDIuc3RyYXR1bTEucnUAAAAAAAABGAEMAwoHAgoKBwIAABMAKjExMSMAAAAAAAAAAAAAAMCoAHD2AegDFAAAAAAAAf8AAAAAAAAAAAAAAADAqABx9gHoAxQAAAAAAAH/AAAAAAAAAAAAAAAAwKgAcvYB6AMUAAAAAAAB/wAAAAAAAAAAAAAAAMCoAHP2AegDFAAAAAAAAf8AAAAAAAAAAAAAAADAqAB09gE="}Response:
Empty JSON on success.
{}Remove File
Section titled “Remove File”Removes a file from the SD card.
POST /api/card/remove/
Request Parameters:
| Field | Type | Description |
|---|---|---|
path | string | Absolute path to file. |
Example Request:
{ "path": "/1.pdf"}Response:
Empty JSON on success.
{}Eject SD Card
Section titled “Eject SD Card”Prepares SD card for safe removal.
POST /api/cmd/memory/card_eject/
Example Request:
{}Response:
Empty JSON on success.
{}