aes67_webui.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * SPDX-FileCopyrightText: 2026 DatanoiseTV
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /*
  7. * AES67 Web UI - HTTP server and WebSocket backend.
  8. *
  9. * Serves an embedded SPA, exposes REST endpoints for device status
  10. * and stream management, and pushes real-time status updates over
  11. * a WebSocket connection at 2Hz.
  12. */
  13. #pragma once
  14. #include <stdint.h>
  15. #include "esp_err.h"
  16. #include "aes67.h"
  17. #ifdef __cplusplus
  18. extern "C" {
  19. #endif
  20. /* Opaque Web UI context */
  21. typedef struct aes67_webui *aes67_webui_handle_t;
  22. /**
  23. * Initialize the Web UI server. Does not start listening yet.
  24. *
  25. * @param node Running AES67 node instance
  26. * @param port HTTP port (e.g. 80)
  27. * @param handle Output handle for the created context
  28. * @return ESP_OK on success
  29. */
  30. esp_err_t aes67_webui_init(aes67_node_handle_t node, uint16_t port,
  31. aes67_webui_handle_t *handle);
  32. /**
  33. * Start the HTTP server and begin accepting connections.
  34. */
  35. esp_err_t aes67_webui_start(aes67_webui_handle_t handle);
  36. /**
  37. * Stop the HTTP server and tear down the WebSocket push task.
  38. */
  39. esp_err_t aes67_webui_stop(aes67_webui_handle_t handle);
  40. #ifdef __cplusplus
  41. }
  42. #endif