src.nth.io/

summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-07-17 19:49:46 -0500
committerLuke Hoersten <[email protected]>2026-07-17 19:49:46 -0500
commit2a4b8296d71f25e5a29a07ea6cc9f3ac31676c48 (patch)
tree08393682ad3088ae1681e8cf3e5118d46561ef3a /main
parentc9f0297dc86eaee7ef222a066587f4eb737d0ea8 (diff)
main: advertise mac in mDNS TXT
Stable identity for the Scrypted plugin's discovery/auto-heal: the viewport name is user-editable and the IP can renumber, but the MAC is fixed. Discovery matches on it to relocate a device after a DHCP change.
Diffstat (limited to 'main')
-rw-r--r--main/mdns_service.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main/mdns_service.c b/main/mdns_service.c
index 05d8c23..e5b2b3a 100644
--- a/main/mdns_service.c
+++ b/main/mdns_service.c
@@ -23,12 +23,14 @@ static esp_err_t apply_state(bool include_hostname)
{
char hostname[80];
char name[64];
+ char mac[18];
const char *resolution, *orientation;
viewport_state_lock();
viewport_state_t *st = viewport_state_get();
snprintf(hostname, sizeof(hostname), "viewport-%s", st->viewport_name);
snprintf(name, sizeof(name), "%s", st->viewport_name);
+ snprintf(mac, sizeof(mac), "%s", st->mac_str);
resolution = viewport_state_resolution_str();
orientation = (st->orientation == VIEWPORT_ORIENTATION_PORTRAIT)
? "portrait" : "landscape";
@@ -42,6 +44,9 @@ static esp_err_t apply_state(bool include_hostname)
{ "resolution", resolution },
{ "orientation", orientation },
{ "name", name },
+ // Stable identity for the Scrypted plugin's discovery/auto-heal:
+ // names are user-editable, the MAC is not.
+ { "mac", mac },
};
return mdns_service_txt_set(SERVICE, PROTO, txt,
sizeof(txt) / sizeof(txt[0]));