gs2200m: Retry indefinately on GS2200M_IOC_ASSOC failure
Author: Alan Carvalho de Assis <engenharia03@siam.ind.br> Run nxstyle again gs2200m_main.c file and fix issues Author: YAMAMOTO Takashi <yamamoto@midokura.com> gs2200m: Retry indefinately on GS2200M_IOC_ASSOC failure The ioctl doesn't return why it failed. It might or might not be a transient failure. In my environment, gs2200m often returns the following for AT+WA. It usually works after a few retries. [ 12.110000] _parse_pkt_in_s1: +++++ 0:(msize=19, msg=WLAN CONNECT ERROR|) [ 12.110000] _parse_pkt_in_s1: +++++ 1:(msize=6, msg=ERROR|)
This commit is contained in:
parent
e738fbedba
commit
2f4b309b1b
@ -376,6 +376,7 @@ read_req(int fd, FAR const struct usrsock_request_common_s *com_hdr,
|
|||||||
{
|
{
|
||||||
return -errno;
|
return -errno;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rlen + sizeof(*com_hdr) != reqsize)
|
if (rlen + sizeof(*com_hdr) != reqsize)
|
||||||
{
|
{
|
||||||
return -EMSGSIZE;
|
return -EMSGSIZE;
|
||||||
@ -1350,12 +1351,16 @@ static int gs2200m_loop(FAR struct gs2200m_s *priv)
|
|||||||
amsg.key = priv->key;
|
amsg.key = priv->key;
|
||||||
amsg.mode = priv->mode;
|
amsg.mode = priv->mode;
|
||||||
amsg.ch = priv->ch;
|
amsg.ch = priv->ch;
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
ret = ioctl(priv->gsfd, GS2200M_IOC_ASSOC, (unsigned long)&amsg);
|
ret = ioctl(priv->gsfd, GS2200M_IOC_ASSOC, (unsigned long)&amsg);
|
||||||
|
|
||||||
if (0 != ret)
|
if (0 == ret)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "association failed : invalid ssid or key \n");
|
break;
|
||||||
goto errout;
|
}
|
||||||
|
|
||||||
|
fprintf(stderr, "association failed : retrying\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
|
Loading…
Reference in New Issue
Block a user