Skip to content

mongoose-os-libs/dns-sd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DNS-SD/Bonjour protocol support library

By default, advertises the HTTP server (if enabled).

Additional instances can be added by the user's application, example (for Apple HAP):

const struct mgos_dns_sd_txt_entry gizmo_txt[] = {
    {.key = "c#", .value = MG_MK_STR("1")},
    {.key = "ff", .value = MG_MK_STR("0")},
    {.key = "pv", .value = MG_MK_STR("1.0")},
    {.key = "id", .value = MG_MK_STR("11:22:33:44:55:66")},
    {.key = "md", .value = MG_MK_STR("Fancy Gizmo 9000")},
    {.key = "s#", .value = MG_MK_STR("1")},
    {.key = "sf", .value = MG_MK_STR("1")},
    {.key = "ci", .value = MG_MK_STR("8")},  // Switch
    {.key = NULL},
};
mgos_dns_sd_add_service_instance("gizmo9000", "_hap._tcp", 8080, gizmo_txt);