How do I destroy my RTCS connection?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How do I destroy my RTCS connection?

1,044 次查看
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.

标签 (1)
标记 (1)
0 项奖励
回复
2 回复数

636 次查看
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 项奖励
回复

636 次查看
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.