Adds a per-node secondary_sdr_mode config field (none|adsb|ais|op25_2), applied the same way as hardware_preset/ppm_override so it survives system reassignment. op25-container gets a GET /devices endpoint that counts connected SDRs via lsusb; the edge-node checkin now reports sdr_count and secondary_sdr_mode up to the server, the first node-initiated hardware report (everything else was C2 pushing config down). Tracked as node-26#9. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
60 lines
1.6 KiB
Python
60 lines
1.6 KiB
Python
from pydantic import BaseModel
|
|
from typing import Optional, Dict, Any
|
|
from enum import Enum
|
|
from datetime import datetime
|
|
|
|
|
|
class NodeStatus(str, Enum):
|
|
ONLINE = "online"
|
|
OFFLINE = "offline"
|
|
RECORDING = "recording"
|
|
UNCONFIGURED = "unconfigured"
|
|
|
|
|
|
class CallStatus(str, Enum):
|
|
ACTIVE = "active"
|
|
ENDED = "ended"
|
|
|
|
|
|
class SystemConfig(BaseModel):
|
|
system_id: str
|
|
name: str
|
|
type: str # P25, DMR, NBFM
|
|
config: Dict[str, Any] # OP25-compatible config blob passed through to op25-container
|
|
|
|
|
|
class NodeConfig(BaseModel):
|
|
node_id: str
|
|
node_name: str
|
|
lat: float
|
|
lon: float
|
|
assigned_system_id: Optional[str] = None
|
|
system_config: Optional[SystemConfig] = None
|
|
configured: bool = False
|
|
hardware_preset: str = "rtl-sdr-v3"
|
|
ppm_override: Optional[float] = None
|
|
node_type: str = "fixed" # fixed or portable
|
|
secondary_sdr_mode: str = "none" # none | adsb | ais | op25_2 — requires a second physical SDR
|
|
enforce_override_timeout: bool = True
|
|
override_system_id: Optional[str] = None
|
|
override_config: Optional[SystemConfig] = None
|
|
offline_call_buffer_size: int = 35 # max call_end events to buffer while MQTT is offline
|
|
|
|
|
|
class CallEvent(BaseModel):
|
|
call_id: str
|
|
node_id: str
|
|
system_id: Optional[str] = None
|
|
talkgroup_id: Optional[int] = None
|
|
talkgroup_name: Optional[str] = None
|
|
started_at: datetime
|
|
ended_at: Optional[datetime] = None
|
|
audio_url: Optional[str] = None
|
|
status: CallStatus = CallStatus.ACTIVE
|
|
|
|
|
|
class DiscordCommand(BaseModel):
|
|
action: str # "join" or "leave"
|
|
guild_id: Optional[str] = None
|
|
channel_id: Optional[str] = None
|