Initial commit: adacam-api v1.0.0
Clean Python Flask replacement for odc-api (434k lines Node.js → ~350 lines Python)
- GET /api/1/landmarks/last/{N} - last N detections from SQLite
- POST /api/1/landmarks - ingest detections + forward to AdaMaps
- GET /api/1/gnssConcise/latestValid - GPS fix from Redis
- GET /api/1/status - device status
- GET /api/1/deviceinfo - device identity
- GET /api/1/recording/frames/latest - latest frame path
No /api/1/cmd - that's the CVE, it's gone.
Includes:
- SQLite for local storage + offline queue
- Background thread for AdaMaps retry
- systemd service unit
- install.sh for device deployment
This commit is contained in:
parent
5dd91b0b15
commit
7acc5ab088
17 changed files with 507 additions and 1 deletions
22
adacam_api/routes/frames.py
Normal file
22
adacam_api/routes/frames.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
"""Recording frame endpoints."""
|
||||
import os
|
||||
import glob
|
||||
from flask import Blueprint, jsonify
|
||||
|
||||
bp = Blueprint("frames", __name__, url_prefix="/api/1/recording")
|
||||
|
||||
FRAMES_DIR = "/tmp/recording/pics"
|
||||
|
||||
|
||||
@bp.route("/frames/latest", methods=["GET"])
|
||||
def latest_frame():
|
||||
"""Get path to most recent frame file."""
|
||||
if not os.path.isdir(FRAMES_DIR):
|
||||
return jsonify({"error": "No frames directory"}), 404
|
||||
|
||||
files = glob.glob(os.path.join(FRAMES_DIR, "*"))
|
||||
if not files:
|
||||
return jsonify({"error": "No frames available"}), 404
|
||||
|
||||
latest = max(files, key=os.path.getmtime)
|
||||
return jsonify({"path": latest})
|
||||
Loading…
Add table
Add a link
Reference in a new issue