mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-14 20:03:40 +00:00
rtl8720dn: add examples/rtl8720dn/tcpclient
This commit is contained in:
@@ -32,9 +32,13 @@ func (r *RTL8720DN) ConnectTCPSocket(addr, port string) error {
|
||||
}
|
||||
|
||||
ipaddr := make([]byte, 4)
|
||||
_, err := r.Rpc_netconn_gethostbyname(addr, &ipaddr)
|
||||
if err != nil {
|
||||
return err
|
||||
if len(addr) == 4 {
|
||||
copy(ipaddr, addr)
|
||||
} else {
|
||||
_, err := r.Rpc_netconn_gethostbyname(addr, &ipaddr)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
portNum, err := strconv.ParseUint(port, 0, 0)
|
||||
|
||||
Reference in New Issue
Block a user