]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_core/commitdiff
nwfnet-go: don't hard depend on mDNS
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 23 Jan 2017 01:03:10 +0000 (20:03 -0500)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Mon, 23 Jan 2017 01:03:10 +0000 (20:03 -0500)
Some examples don't need it, so work even if it's not present

net/nwfnet-go.lua

index 628813f68509f9e2eca38368ef27da6572c299fb..a98e9b869ec4f30461b0260967e4170504052fca 100644 (file)
@@ -1,7 +1,7 @@
 -- DEPENDS: cjson, file, mdns, net, rtctime, sntp, wifi; nwfnet, nwfnet-sntp
 wifi.eventmon.register(wifi.eventmon.STA_GOT_IP, function(t)
   (require "nwfnet"):runnet("wstagoip",t)
-  mdns.register(wifi.sta.gethostname())
+  if mdns then mdns.register(wifi.sta.gethostname()) end
   dofile("nwfnet-sntp.lc").dosntp(nil)
 end)
 wifi.eventmon.register(wifi.eventmon.STA_DHCP_TIMEOUT, function(_) (require "nwfnet"):runnet("wstadtmo") end)