dante_advertise.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * SPDX-FileCopyrightText: 2026 Benjamin Harris
  3. * SPDX-License-Identifier: Apache-2.0
  4. *
  5. * Dante mDNS advertisement — clean-room, from docs/dante-protocol-notes.md.
  6. *
  7. * Publishes this device's presence over mDNS/DNS-SD so Dante Controller and
  8. * peer devices can see it. Advertises the device-level services:
  9. * _netaudio-arc._udp (control endpoint, ARC port)
  10. * _netaudio-cmc._udp (announce endpoint, CMC port)
  11. * and, per transmit channel, _netaudio-chan._udp.
  12. *
  13. * WARNING: advertising is only half the story. A device that appears in
  14. * discovery but cannot answer ARC/CMC queries is worse than an invisible one
  15. * (it shows up broken in Dante Controller). Only enable this once the CMC and
  16. * ARC responders are running. It is gated OFF by default in Kconfig.
  17. *
  18. * PROTOTYPE / UNTESTED: TXT version strings mimic values observed on real
  19. * Dante hardware and may need tuning against a specific Dante Controller
  20. * version. Verify against a capture.
  21. */
  22. #pragma once
  23. #include "dante_device.h"
  24. #include "esp_err.h"
  25. #ifdef __cplusplus
  26. extern "C" {
  27. #endif
  28. /*
  29. * Start advertising the device-level Dante services (_netaudio-arc and
  30. * _netaudio-cmc) from `id`. Sets the mDNS hostname/instance to id->hostname.
  31. * Shares the process-wide ESP-IDF mDNS instance (init is idempotent).
  32. * The identity is copied internally.
  33. */
  34. esp_err_t dante_advertise_start(const dante_identity_t *id);
  35. /*
  36. * Advertise a transmit channel as _netaudio-chan._udp. `index` is 0-based
  37. * (published as the 1-based Dante channel id); `name` is the channel name
  38. * (the DNS-SD instance becomes "<name>@<hostname>"). Call after
  39. * dante_advertise_start().
  40. */
  41. esp_err_t dante_advertise_tx_channel(uint8_t index, const char *name);
  42. /* Remove the Dante mDNS services advertised by this module. Does not touch
  43. * services owned by other components (e.g. the AES67 _ravenna records). */
  44. void dante_advertise_stop(void);
  45. #ifdef __cplusplus
  46. }
  47. #endif