dante_cmc.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * SPDX-FileCopyrightText: 2026 Benjamin Harris
  3. * SPDX-License-Identifier: Apache-2.0
  4. *
  5. * Dante CMC (device-announce) responder — clean-room, from
  6. * docs/dante-protocol-notes.md.
  7. *
  8. * Listens on the CMC UDP port (8800) and answers the "request device
  9. * advertisement" message with this device's identity (process id, 8-byte
  10. * factory device id, IP, info-request port). This is how a peer that found us
  11. * via mDNS bootstraps to our full identity.
  12. *
  13. * Uses the same 10-byte big-endian request/response header as ARC:
  14. * start_code(u16) total_length(u16) seqnum(u16) opcode1(u16) opcode2(u16)
  15. * A request has opcode2 == 0; the reply echoes start_code/seqnum/opcode1 and
  16. * sets opcode2 = 1 (OK), with the advertisement as the content.
  17. *
  18. * PROTOTYPE / UNTESTED against real hardware — verify against a capture.
  19. */
  20. #pragma once
  21. #include "dante_device.h"
  22. #include "esp_err.h"
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Start the CMC responder task. Binds UDP on id->cmc_port and answers
  27. * device-advertisement requests using `id` (copied internally). */
  28. esp_err_t dante_cmc_start(const dante_identity_t *id);
  29. /* Stop the CMC responder task and close its socket. */
  30. void dante_cmc_stop(void);
  31. #ifdef __cplusplus
  32. }
  33. #endif