tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
608 stars 192 forks source link

rtl8720dn: add handling when connect fails #497

Closed sago35 closed 5 months ago

sago35 commented 1 year ago

This PR adds handling when rtl8720dn fails to connect to a specific TCP destination.

-1 represents many rpc failures, but details are unknown. In fact, rtl8720dn returns -1 when a connection fails.

scottfeldman commented 8 months ago

Note in drivers:dev branch, this is fixed as:

result := r.rpc_lwip_connect(int32(sock), name, uint32(len(name)))
if result == -1 {
        return fmt.Errorf("Connect to %s failed", ip)
}
deadprogram commented 5 months ago

@sago35 is this PR still relevant?

sago35 commented 5 months ago

No, it's already been updated to the following code, so the issue is resolved. I'll close this PR.

https://github.com/tinygo-org/drivers/blob/v0.27.0/rtl8720dn/rtl8720dn.go#L501-L505