You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

107 lines
2.4 KiB
Markdown

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# JSON Examples
Ниже даны практические шаблоны JSON для интеграции.
## 1) Входной payload от ресивера (рекомендуемый компактный формат)
```json
{
"receiver_id": "r0",
"timestamp_unix": 1767354000.125,
"samples": [
{ "f_mhz": 433.92, "rssi": -61.5 },
{ "f_mhz": 868.10, "rssi": -67.2 }
]
}
```
## 2) Входной payload (совместимый legacy-формат)
```json
{
"receiver_id": "r0",
"measurements": [
{ "frequency_hz": 433920000, "rssi_dbm": -61.5 },
{ "frequency_hz": 868100000, "rssi_dbm": -67.2 }
]
}
```
Также поддерживаются:
- корневой массив измерений без обертки,
- ключи массивов: `samples`, `measurements`, `data`, `m`,
- частота: `frequency_hz`, `freq_hz`, `f_hz`, `frequency_mhz`, `freq_mhz`, `f_mhz`, `frequency`, `freq`, `f`,
- RSSI: `amplitude_dbm`, `rssi_dbm`, `dbm`, `amplitude`, `rssi`.
## 3) Выходной payload (отправляется на конечный сервер)
Сервис отправляет минимальный JSON:
```json
{
"x": 1.2,
"y": 2.3,
"z": 0.4
}
```
Только эти поля:
- `x`
- `y`
- `z`
## 4) Шаблон блока `runtime.output_servers`
```json
{
"runtime": {
"output_servers": [
{
"name": "sink-a",
"ip": "10.0.0.50"
},
{
"name": "sink-b",
"ip": "10.0.0.51"
}
]
}
}
```
## 5) Шаблон входных ресиверов с общим фильтром
```json
{
"input": {
"default_input_filter": {
"enabled": true,
"min_frequency_mhz": 430.0,
"max_frequency_mhz": 900.0,
"min_rssi_dbm": -90.0,
"max_rssi_dbm": -20.0
},
"receivers": [
{
"receiver_id": "r0",
"center": { "x": 0.0, "y": 0.0, "z": 0.0 },
"frequencies_mhz": [433.92, 868.1],
"access": { "url": "http://10.0.0.11:9000/measurements" }
},
{
"receiver_id": "r1",
"center": { "x": 10.0, "y": 0.0, "z": 0.0 },
"frequencies_mhz": [433.92, 868.1],
"access": { "url": "http://10.0.0.12:9000/measurements" }
},
{
"receiver_id": "r2",
"center": { "x": 0.0, "y": 8.0, "z": 0.0 },
"frequencies_mhz": [433.92, 868.1],
"access": { "url": "http://10.0.0.13:9000/measurements" }
}
]
}
}
```