mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-12 02:43:42 +00:00
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:
@@ -969,7 +969,9 @@ func (d *Device) sendParamBuf(p []byte, isLastParam bool) (l int) {
|
|||||||
func (d *Device) sendParamStr(p string, isLastParam bool) (l int) {
|
func (d *Device) sendParamStr(p string, isLastParam bool) (l int) {
|
||||||
l = len(p)
|
l = len(p)
|
||||||
d.SPI.Transfer(uint8(l))
|
d.SPI.Transfer(uint8(l))
|
||||||
d.SPI.Tx([]byte(p), nil)
|
if l > 0 {
|
||||||
|
d.SPI.Tx([]byte(p), nil)
|
||||||
|
}
|
||||||
if isLastParam {
|
if isLastParam {
|
||||||
d.SPI.Transfer(CmdEnd)
|
d.SPI.Transfer(CmdEnd)
|
||||||
l += 1
|
l += 1
|
||||||
|
|||||||
Reference in New Issue
Block a user