/* * SPDX-FileCopyrightText: 2026 Benjamin Harris * SPDX-License-Identifier: Apache-2.0 * * Shared Dante device identity — clean-room, from docs/dante-protocol-notes.md. * * A Dante device is identified on the wire by a friendly hostname, an 8-byte * factory device id (real hardware uses its MAC padded to 8 bytes), a process * id (distinguishes multiple instances on one IP), and the set of UDP control * ports it listens on. The advertiser and the control-protocol servers all * work from one of these. */ #pragma once #include #include "esp_err.h" #ifdef __cplusplus extern "C" { #endif #define DANTE_DEVICE_ID_LEN 8 /* Standard Dante UDP control ports (as seen on hardware). */ #define DANTE_PORT_ARC 4440 /* control / routing */ #define DANTE_PORT_CMC 8800 /* device announce */ #define DANTE_PORT_FLOWS 4455 /* flow setup (dbcp) */ #define DANTE_PORT_INFO 8700 /* info / multicast */ typedef struct { char hostname[64]; /* friendly hostname: DNS-SD instance + SRV target (single DNS label, no spaces) */ uint8_t device_id[DANTE_DEVICE_ID_LEN]; /* factory device id (MAC padded with zeros) */ uint16_t process_id; /* unique per instance on a given IP */ uint32_t ipv4; /* device IPv4, host byte order */ uint16_t arc_port; uint16_t cmc_port; uint16_t flows_port; uint16_t info_port; char manufacturer[32]; /* mDNS "mf" */ char model[32]; /* mDNS "model" */ char board_name[48]; /* mDNS "router_info" */ uint32_t sample_rate; /* Hz */ uint8_t bits_per_sample; /* 16 / 24 / 32 */ } dante_identity_t; /* * Populate an identity with sensible Dante defaults: * - standard control ports, * - device_id = the 6 MAC bytes followed by two zero bytes, * - a hostname derived from the last three MAC bytes, * - manufacturer/model/board placeholders, 48 kHz / 24-bit. * The caller may override any field afterward (e.g. a nicer hostname). * `mac` is the 6-byte Ethernet MAC; `ipv4` is host byte order. */ void dante_identity_init_default(dante_identity_t *id, uint32_t ipv4, const uint8_t mac[6]); #ifdef __cplusplus } #endif