diff --git a/examples/net/http-get/rtl8720dn.go b/examples/net/http-get/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/http-get/rtl8720dn.go +++ b/examples/net/http-get/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/http-get/wifinina.go b/examples/net/http-get/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/http-get/wifinina.go +++ b/examples/net/http-get/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/http-head/rtl8720dn.go b/examples/net/http-head/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/http-head/rtl8720dn.go +++ b/examples/net/http-head/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/http-head/wifinina.go b/examples/net/http-head/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/http-head/wifinina.go +++ b/examples/net/http-head/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/http-post/rtl8720dn.go b/examples/net/http-post/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/http-post/rtl8720dn.go +++ b/examples/net/http-post/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/http-post/wifinina.go b/examples/net/http-post/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/http-post/wifinina.go +++ b/examples/net/http-post/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/http-postform/rtl8720dn.go b/examples/net/http-postform/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/http-postform/rtl8720dn.go +++ b/examples/net/http-postform/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/http-postform/wifinina.go b/examples/net/http-postform/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/http-postform/wifinina.go +++ b/examples/net/http-postform/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/mqttclient/rtl8720dn.go b/examples/net/mqttclient/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/mqttclient/rtl8720dn.go +++ b/examples/net/mqttclient/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/mqttclient/wifinina.go b/examples/net/mqttclient/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/mqttclient/wifinina.go +++ b/examples/net/mqttclient/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/ntpclient/rtl8720dn.go b/examples/net/ntpclient/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/ntpclient/rtl8720dn.go +++ b/examples/net/ntpclient/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/ntpclient/wifinina.go b/examples/net/ntpclient/wifinina.go index bcb524a..59d3c5d 100644 --- a/examples/net/ntpclient/wifinina.go +++ b/examples/net/ntpclient/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/socket/rtl8720dn.go b/examples/net/socket/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/socket/rtl8720dn.go +++ b/examples/net/socket/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/socket/wifinina.go b/examples/net/socket/wifinina.go index bcb524a..59d3c5d 100644 --- a/examples/net/socket/wifinina.go +++ b/examples/net/socket/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/tcpclient/rtl8720dn.go b/examples/net/tcpclient/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/tcpclient/rtl8720dn.go +++ b/examples/net/tcpclient/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/tcpclient/wifinina.go b/examples/net/tcpclient/wifinina.go index bcb524a..59d3c5d 100644 --- a/examples/net/tcpclient/wifinina.go +++ b/examples/net/tcpclient/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/tcpecho/rtl8720dn.go b/examples/net/tcpecho/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/tcpecho/rtl8720dn.go +++ b/examples/net/tcpecho/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/tcpecho/wifinina.go b/examples/net/tcpecho/wifinina.go index bcb524a..59d3c5d 100644 --- a/examples/net/tcpecho/wifinina.go +++ b/examples/net/tcpecho/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/tlsclient/rtl8720dn.go b/examples/net/tlsclient/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/tlsclient/rtl8720dn.go +++ b/examples/net/tlsclient/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/tlsclient/wifinina.go b/examples/net/tlsclient/wifinina.go index bcb524a..59d3c5d 100644 --- a/examples/net/tlsclient/wifinina.go +++ b/examples/net/tlsclient/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/webclient/rtl8720dn.go b/examples/net/webclient/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/webclient/rtl8720dn.go +++ b/examples/net/webclient/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/webclient/wifinina.go b/examples/net/webclient/wifinina.go index bcb524a..59d3c5d 100644 --- a/examples/net/webclient/wifinina.go +++ b/examples/net/webclient/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/webserver/rtl8720dn.go b/examples/net/webserver/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/webserver/rtl8720dn.go +++ b/examples/net/webserver/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/webserver/wifinina.go b/examples/net/webserver/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/webserver/wifinina.go +++ b/examples/net/webserver/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/websocket/dial/rtl8720dn.go b/examples/net/websocket/dial/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/websocket/dial/rtl8720dn.go +++ b/examples/net/websocket/dial/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/websocket/dial/wifinina.go b/examples/net/websocket/dial/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/websocket/dial/wifinina.go +++ b/examples/net/websocket/dial/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/websocket/handler/rtl8720dn.go b/examples/net/websocket/handler/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/websocket/handler/rtl8720dn.go +++ b/examples/net/websocket/handler/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/websocket/handler/wifinina.go b/examples/net/websocket/handler/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/websocket/handler/wifinina.go +++ b/examples/net/websocket/handler/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/examples/net/webstatic/rtl8720dn.go b/examples/net/webstatic/rtl8720dn.go index df94a8e..94d5277 100644 --- a/examples/net/webstatic/rtl8720dn.go +++ b/examples/net/webstatic/rtl8720dn.go @@ -23,7 +23,7 @@ var cfg = rtl8720dn.Config{ Rx: machine.PC24, Baudrate: 614400, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = rtl8720dn.New(&cfg) diff --git a/examples/net/webstatic/wifinina.go b/examples/net/webstatic/wifinina.go index fd8b291..a135548 100644 --- a/examples/net/webstatic/wifinina.go +++ b/examples/net/webstatic/wifinina.go @@ -27,7 +27,7 @@ var cfg = wifinina.Config{ Gpio0: machine.NINA_GPIO0, Resetn: machine.NINA_RESETN, // Watchdog (set to 0 to disable) - WatchdogTimeo: time.Duration(20 * time.Second), + WatchdogTimeout: time.Duration(20 * time.Second), } var netdev = wifinina.New(&cfg) diff --git a/rtl8720dn/rtl8720dn.go b/rtl8720dn/rtl8720dn.go index 8b522a5..c2641d8 100644 --- a/rtl8720dn/rtl8720dn.go +++ b/rtl8720dn/rtl8720dn.go @@ -63,7 +63,7 @@ type Config struct { // downed connection and try to recover the connection. Default is // 0secs, which means no watchdog. Set to non-zero to enable // watchodog. - WatchdogTimeo time.Duration + WatchdogTimeout time.Duration } type rtl8720dn struct { @@ -226,7 +226,7 @@ func (r *rtl8720dn) networkDown() bool { } func (r *rtl8720dn) watchdog() { - ticker := time.NewTicker(r.cfg.WatchdogTimeo) + ticker := time.NewTicker(r.cfg.WatchdogTimeout) for { select { case <-r.killWatchdog: @@ -290,7 +290,7 @@ func (r *rtl8720dn) NetConnect() error { r.netConnected = true - if r.cfg.WatchdogTimeo != 0 { + if r.cfg.WatchdogTimeout != 0 { go r.watchdog() } @@ -310,7 +310,7 @@ func (r *rtl8720dn) NetDisconnect() { return } - if r.cfg.WatchdogTimeo != 0 { + if r.cfg.WatchdogTimeout != 0 { r.killWatchdog <- true } r.netDisconnect() diff --git a/wifinina/wifinina.go b/wifinina/wifinina.go index 11d8d15..ceeb658 100644 --- a/wifinina/wifinina.go +++ b/wifinina/wifinina.go @@ -195,13 +195,13 @@ type Config struct { Retries int // Timeout duration for each connection attempt. Default is 10sec. - ConnectTimeo time.Duration + ConnectTimeout time.Duration // Watchdog ticker duration. On tick, the watchdog will check for // downed connection or hardware fault and try to recover the // connection. Default is 0secs, which means no watchdog. Set to // non-zero to enable watchodog. - WatchdogTimeo time.Duration + WatchdogTimeout time.Duration } type wifinina struct { @@ -244,8 +244,8 @@ func New(cfg *Config) *wifinina { resetn: cfg.Resetn, } - if w.cfg.ConnectTimeo == 0 { - w.cfg.ConnectTimeo = 10 * time.Second + if w.cfg.ConnectTimeout == 0 { + w.cfg.ConnectTimeout = 10 * time.Second } drivers.UseNetdev(&w) @@ -404,7 +404,7 @@ func (w *wifinina) networkDown() bool { } func (w *wifinina) watchdog() { - ticker := time.NewTicker(w.cfg.WatchdogTimeo) + ticker := time.NewTicker(w.cfg.WatchdogTimeout) for { select { case <-w.killWatchdog: @@ -439,7 +439,7 @@ func (w *wifinina) netConnect(reset bool) error { w.showDevice() for i := 0; w.cfg.Retries == 0 || i < w.cfg.Retries; i++ { - if err := w.connectToAP(w.cfg.ConnectTimeo); err != nil { + if err := w.connectToAP(w.cfg.ConnectTimeout); err != nil { switch err { case drivers.ErrConnectTimeout, drivers.ErrConnectFailed: continue @@ -475,7 +475,7 @@ func (w *wifinina) NetConnect() error { w.netConnected = true - if w.cfg.WatchdogTimeo != 0 { + if w.cfg.WatchdogTimeout != 0 { go w.watchdog() } @@ -491,7 +491,7 @@ func (w *wifinina) NetDisconnect() { return } - if w.cfg.WatchdogTimeo != 0 { + if w.cfg.WatchdogTimeout != 0 { w.killWatchdog <- true }