29 Commits

Author SHA1 Message Date
leongross 848f5def03 nit: increase verbosity of espat NetNotify error (#684)
espat: increase verbosity of espat NetNotify error
2024-06-14 17:36:07 +02:00
Scott Feldman 8642886f73 correct netdever Accept() prototype
According to man page accept(2), accept returns new client sockfd and
remote peer ip:port.  This patch corrects the Accept() prototype in the
netdever interface to not take in an ip:port arg, but rather return an
ip:port for remote peer.

Tested with examples/net/tcpecho on wioterminal and nano-rp2040.  Here's
a run with wioterminal:

SERVER
============
sfeldma@nuc:~/work/drivers$ tinygo flash -monitor -target wioterminal -size short -stack-size=8kb ./examples/net/tcpecho
code    data     bss |   flash     ram
110876    2552   11212 |  113428   13764
Connected to /dev/ttyACM2. Press Ctrl-C to exit.

Realtek rtl8720dn Wifi network device driver (rtl8720dn)

Driver version           : 0.0.1
RTL8720 firmware version : 2.1.2
MAC address              : 2c:f7:f1:1c:9b:2f

Connecting to Wifi SSID 'test'...CONNECTED

DHCP-assigned IP         : 10.0.0.140
DHCP-assigned subnet     : 255.255.255.0
DHCP-assigned gateway    : 10.0.0.1

Starting TCP server listening on :8080
Client 10.0.0.190:50000 connected
Client 10.0.0.190:50000 closed

CLIENT
=============
nc -p 50000 10.0.0.140 8080
2023-12-19 09:33:54 +01:00
Scott Feldman d6ae0b0d8b store Bind laddr in netip.AddrPort 2023-12-06 20:09:39 +01:00
Scott Feldman 7a7235f83b move netdev interface to use net/netip for IP addr/ports 2023-12-06 20:09:39 +01:00
Scott Feldman 3089bf8b1b net: updates/cleanup/docs for net, netdev, and netlink 2023-12-06 20:09:39 +01:00
Scott Feldman 8238f96319 move netdev and netlink into their own packages and out of drivers
This moves the netdev/netlink namespace out of drivers and into their
own packages.  Also, defines netdev and netlink as L3/L4 and L2 OSI
layers, respectively.  Move some L3 functionality from netlink to
netdev (GetIPAddr).

For netlink, add ConnectParams for NetConnect to pass in L2 connection
parameters (ssid, pass, auth_type, etc).  Also adds connection mode
(STA, AP, etc).

For netlink, add SendEth and RecvEthFunc funcs to handle L2 send/recv of
Ethernet pkts.
2023-12-06 20:09:39 +01:00
Scott Feldman 276feecc20 Add network device driver model, netdev 2023-12-06 20:09:39 +01:00
deadprogram 1bb1b621c6 all: correct go fmt
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-09-25 13:23:16 +02:00
Arsen6331 2a2e897261 Trim quotes from IP returned by espat's GetDNS() 2022-08-19 18:55:09 +02:00
Kuiki f2f470973d fix esp8266 ConnectToAccessPoint timeout args 2022-04-21 10:23:21 +02:00
deadprogram 941c1c9057 wifi/espat, rtl8720dn, wifinina, net: modify to use Adapter interface
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-01-24 13:24:39 +01:00
deadprogram d8c813d515 wifi/espat, rtl8720dn, wifinina: move towards standard common interface for wifi adaptors
Signed-off-by: deadprogram <ron@hybridgroup.com>
2022-01-24 13:24:39 +01:00
Ayke van Laethem e77e9249cd all: use interfaces for UART objects
This makes it possible to replace UART objects with dummy
implementations, for example. Or allows changing the `machine.UART` type
to `*machine.UART` without breaking compatibility.
2021-04-02 17:31:28 +02:00
BCG cc5ecafacf Decoupled net package from espat 2019-12-17 22:09:23 +01:00
Ron Evans 7dcbfbecc6 espat: implement MQTT subscribe functionality via blocking select/channels.
also refactor response processing for greater speed and efficiency.

Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-11-25 15:56:09 +01:00
Ron Evans 3fca96e0ef docs: complete missing GoDocs for main and sub-packages
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-10-17 11:50:03 +02:00
Ayke van Laethem 8453611d1f espat: update README with how to install dependencies 2019-07-24 15:48:19 -07:00
Ron Evans e4b80d8e0e espat: add firmware install info for Arduino Nano33 IoT NINA-W102 chip
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-16 12:12:53 -07:00
Ron Evans 50633f3e86 espat: refactor net and tls interface compatible code into separate sub-packages
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans 7e78e2c998 espat: add built-in support for MQTT publish using the Paho library packets, alongside some modifications needed for the AT protocol.
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans 40d9287ac4 espat: add README with information on how to flash ESP32 or ESP8266 with AT command set firmware.
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans 59aece351a espat: change Response() method to use a passed-in timeout value instead of fixed pauses.
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans 1b81b992c2 espat: add DialTLS and Dial methods, update MQTT example to allow both MQTT and MQTTS connections
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans 9c88d1fab4 espat: add ResolveUDPAddr and ResolveTCPAddr implementations using AT command for DNS lookup
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans a267fdb8ce espat: improve error handling for key TCP functions
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans 500f3d9813 espat: implement TCPConn using AT command set
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans fe58e9b762 espat: use only AT commands that work on both ESP8266 and ESP32
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-07-15 17:54:26 +02:00
Ron Evans c09f0a8075 all: switch to using custom domain for all drivers
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-05-29 13:33:50 +02:00
Ron Evans 0c2924cd77 espat: add support for esp8266/esp32 Wifi adaptor AT command set with net-compatible UDP support
Signed-off-by: Ron Evans <ron@hybridgroup.com>
2019-02-24 12:54:11 +01:00