wifinina: correct sendParamStr to handle empty strings, such as when connecting to an unsecured access point.

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2022-01-24 21:07:53 +01:00
committed by Ron Evans
parent a15f2167cc
commit f7dce6ae22
+3 -1
View File
@@ -969,7 +969,9 @@ func (d *Device) sendParamBuf(p []byte, isLastParam bool) (l int) {
func (d *Device) sendParamStr(p string, isLastParam bool) (l int) {
l = len(p)
d.SPI.Transfer(uint8(l))
d.SPI.Tx([]byte(p), nil)
if l > 0 {
d.SPI.Tx([]byte(p), nil)
}
if isLastParam {
d.SPI.Transfer(CmdEnd)
l += 1