How do I destroy my RTCS connection?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I destroy my RTCS connection?

795 Views
winmaxi
Contributor I

How do I destroy my RTCS connection?

I want to bind the microcontroller to another IP while it has already binded to the current IP.

I tried to bind it to another IP without destroy the bind between the microcontroller and the current IP.

It gave me error telling me that the connection failed.

Anybody know how to destroy the connection?

Thank you.

Labels (1)
Tags (1)
0 Kudos
2 Replies

387 Views
slaroche
Contributor II

I am trying to do the same using Wi-Fi connection (RedPine module with K60n512).  I use the "ipcfg_unbind" function to disconnect from the current connected network, which looks to work fine.  When I reconnect, I use the same functions used for the first connection, except for the "RTCS_create" (I figured that since it is already created, I still can use it).

 

My problem is when I call "iwcfg_set_scan" on the second connection, the call hangs and nothing happens.  If I don't make the call to "iwcfg_set_scan" on the second connection, it will connect, but it won't update the available Wi-Fi connections (the previous list is used).

 

If someone has information or hints, that would be great.

0 Kudos

387 Views
Jarpba
Contributor II

I have digged into rs2101 sources and noticed that they have used something like lw_event_wait_for function which never returns in some cases (for example if network of specified ssid is not found (ssid set before set_scan)).

 

I changed those wait functions to lw_event_wait_for_ticks so that they will return after a certain timeout. That does not solve the problem but somehow i managed to get list of networks. It seems, however, that the first time it scans for new networks it remembers the old networks but is unable to join them. The second time it scans for the networks it founds new networks and joins them successfully. There seems to be code related to network scan in both iwcfg and rs2101 sources. Apparently iwcfg part somehow caches wifi networks from last scan or does not empty its buffers after wifi has gone down.

 

There must be more people having the same problems so maybe there is a way to rejoin a network after it has been disconnected.