Sniffer: /sniffer HTTP handler and data contract

Aperta
#34 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp
Ambito
api, backend, testing

Direzione di ricerca

Read the linked Device/page contract and Configuration sections in .specs/sniffer.md, then inspect the sniffer component's web_server_base setup and store. Implement the /sniffer/data delta response and queued scan controls to meet acceptance criteria 7 and 8; verify the JSON writer, sequence selection, and configuration error with the host GoogleTest and config tests described here.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Spec: Device/page contract, Configuration

  • AsyncWebHandler on web_server_base (init() + add_handler()), only with web_page: true. Config error without web_server_base; consume_sockets(2).
  • GET /sniffer/data?since=S: delta by seq, full on since=0, the JSON shape including boot, mac, dropped, scan.
  • Idempotent POST /sniffer/scan/start|stop, queued to the main loop; they move the switch too.
  • Mutex on the store; binary record copy under the lock, then JSON in ~256 B chunks with httpd_resp_send_chunk. \u00XX escaping for control and non-ASCII bytes.
  • GET /sniffer can serve a placeholder page until the page issue lands.

Done: acceptance criteria 7 and 8.

Tests (harness from #39): host GoogleTest for the JSON writer (\u00XX escaping round-trip, null fields, ms conversion) and the delta selection by seq. Config test for web_page: true without web_server_base.

Lingua principale
C++
Stelle
8
Fork
4
Merge medio
15h 58m
PR unite (30g)
5

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di distante/esphome-components

Tutte le issue di distante/esphome-components

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.