Rework radar system
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
"""Shared ring layout; keep in sync with common_cpp/ipc/src/shm_ring.cpp."""
|
||||
|
||||
from pathlib import Path
|
||||
import struct
|
||||
|
||||
MAGIC = b"RDRRING2"
|
||||
VERSION = 1
|
||||
HEADER = struct.Struct("<8sIIIIQQQ16x")
|
||||
SLOT_HEADER_SIZE = 16
|
||||
|
||||
|
||||
def ring_path(name: str) -> Path:
|
||||
if not name.startswith("/") or len(name) < 2 or "/" in name[1:] or "\x00" in name:
|
||||
raise ValueError("ring_name must be '/' followed by a single nonempty filename")
|
||||
return Path("/dev/shm") / name[1:]
|
||||
Reference in New Issue
Block a user