From c409e8f3cf1b8da64c3ae291b66ee37160d369fc Mon Sep 17 00:00:00 2001 From: deadprogram Date: Tue, 6 Sep 2022 11:19:10 +0200 Subject: [PATCH] examples/rtl8720dn: add call to optional debug setting Signed-off-by: deadprogram --- examples/rtl8720dn/mqttsub/main.go | 1 + examples/rtl8720dn/ntpclient/main.go | 1 + examples/rtl8720dn/tcpclient/main.go | 1 + examples/rtl8720dn/tlsclient/main.go | 2 +- examples/rtl8720dn/udpstation/main.go | 1 + examples/rtl8720dn/version/main.go | 1 + examples/rtl8720dn/webclient-tinyterm/main.go | 2 ++ examples/rtl8720dn/webclient/main.go | 2 ++ examples/rtl8720dn/webserver/main.go | 1 + 9 files changed, 11 insertions(+), 1 deletion(-) diff --git a/examples/rtl8720dn/mqttsub/main.go b/examples/rtl8720dn/mqttsub/main.go index 46841f5..46fdcb1 100644 --- a/examples/rtl8720dn/mqttsub/main.go +++ b/examples/rtl8720dn/mqttsub/main.go @@ -71,6 +71,7 @@ func subHandler(client mqtt.Client, msg mqtt.Message) { func run() error { // change the UART and pins as needed for platforms other than the WioTerminal. adaptor = rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second) diff --git a/examples/rtl8720dn/ntpclient/main.go b/examples/rtl8720dn/ntpclient/main.go index 0c9eee2..1e5f186 100644 --- a/examples/rtl8720dn/ntpclient/main.go +++ b/examples/rtl8720dn/ntpclient/main.go @@ -45,6 +45,7 @@ func main() { func run() error { adaptor := rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second) diff --git a/examples/rtl8720dn/tcpclient/main.go b/examples/rtl8720dn/tcpclient/main.go index a493e62..c8dd593 100644 --- a/examples/rtl8720dn/tcpclient/main.go +++ b/examples/rtl8720dn/tcpclient/main.go @@ -44,6 +44,7 @@ func main() { func run() error { adaptor := rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second) diff --git a/examples/rtl8720dn/tlsclient/main.go b/examples/rtl8720dn/tlsclient/main.go index 21a8987..fafdc23 100644 --- a/examples/rtl8720dn/tlsclient/main.go +++ b/examples/rtl8720dn/tlsclient/main.go @@ -59,7 +59,6 @@ var buf [0x1000]byte var lastRequestTime time.Time var conn net.Conn -var adaptor *rtl8720dn.RTL8720DN func main() { err := run() @@ -71,6 +70,7 @@ func main() { func run() error { adaptor := rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() adaptor.SetRootCA(&test_root_ca) diff --git a/examples/rtl8720dn/udpstation/main.go b/examples/rtl8720dn/udpstation/main.go index 35742b9..f4367ee 100644 --- a/examples/rtl8720dn/udpstation/main.go +++ b/examples/rtl8720dn/udpstation/main.go @@ -40,6 +40,7 @@ func main() { func run() error { adaptor := rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() http.SetBuf(buf[:]) diff --git a/examples/rtl8720dn/version/main.go b/examples/rtl8720dn/version/main.go index 0737822..7a02e2f 100644 --- a/examples/rtl8720dn/version/main.go +++ b/examples/rtl8720dn/version/main.go @@ -23,6 +23,7 @@ func main() { func run() error { adaptor := rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() ver, err := adaptor.Version() diff --git a/examples/rtl8720dn/webclient-tinyterm/main.go b/examples/rtl8720dn/webclient-tinyterm/main.go index e46ffaf..f705968 100644 --- a/examples/rtl8720dn/webclient-tinyterm/main.go +++ b/examples/rtl8720dn/webclient-tinyterm/main.go @@ -81,8 +81,10 @@ func run() error { } adaptor := rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() + http.UseDriver(adaptor) http.SetBuf(buf[:]) fmt.Fprintf(terminal, "ConnectToAP()\r\n") diff --git a/examples/rtl8720dn/webclient/main.go b/examples/rtl8720dn/webclient/main.go index cb1b78d..7d877dd 100644 --- a/examples/rtl8720dn/webclient/main.go +++ b/examples/rtl8720dn/webclient/main.go @@ -39,8 +39,10 @@ func main() { func run() error { adaptor := rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() + http.UseDriver(adaptor) http.SetBuf(buf[:]) err := adaptor.ConnectToAccessPoint(ssid, password, 10*time.Second) diff --git a/examples/rtl8720dn/webserver/main.go b/examples/rtl8720dn/webserver/main.go index c6701c0..4d9a145 100644 --- a/examples/rtl8720dn/webserver/main.go +++ b/examples/rtl8720dn/webserver/main.go @@ -39,6 +39,7 @@ func main() { func run() error { adaptor := rtl8720dn.New(machine.UART3, machine.PB24, machine.PC24, machine.RTL8720D_CHIP_PU) + adaptor.Debug(debug) adaptor.Configure() http.UseDriver(adaptor)