We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f3e53cf + 9cbe486 commit ac2004bCopy full SHA for ac2004b
erlang/wifi/src/wifi.erl
@@ -45,10 +45,14 @@ start_network() ->
45
{disconnected, fun disconnected/0}
46
| maps:get(sta, config:get())
47
]},
48
- {sntp, [{host, "pool.ntp.org"}]}
+ {sntp, [
49
+ {host, "time-d-b.nist.gov"},
50
+ {synchronized, fun sntp_synchronized/1}
51
+ ]}
52
],
53
case network:start(Config) of
54
{ok, _Pid} ->
55
+ io:format("Network started.~n"),
56
timer:sleep(infinity);
57
Error ->
58
Error
@@ -76,6 +80,9 @@ got_ip(IpInfo) ->
76
80
disconnected() ->
77
81
io:format("STA disconnected.~n").
78
82
83
+sntp_synchronized({TVSec, TVUsec}) ->
84
+ io:format("Synchronized time with SNTP server. TVSec=~p TVUsec=~p~n", [TVSec, TVUsec]).
85
+
79
86
verify_platform(esp32) ->
87
ok;
88
verify_platform(Platform) ->
0 commit comments