in difficult conditions it is possible that I can’t get a connection with:
wip_netInit ()
wip_bearerOpen ()
etc…
at the first try (using GPRS).
Second possibility is, that the connection is shut down during operation due to lost GPRS connection.
In those cases i try to disconnect correctly via:
wip_close ( io_channel );
wip_bearerStop ( &bearer );
On wip_bearerStop i get an error.
So the question is, how to shut down the GPRS wip connection correctly.
I have tried several other sequences including wip_close, wip_bearerStop, wip_bearerClose without any luck but several RTK errors.
You should also take care to look at the events that your event handler receives, for example when you lose GPRS.
If a bearer has been stopped due to disconnection you should have received an event to that effect and should know if you need to do wip_bearerStop or not.
I’m still fighting this.
I followed the tip for paired functions but I still get RTK errors.
Do i need to call wip_shutdown paired to wip_TCPClientCreate too?
If not, what else?
If i am correct, the bearerClose() function will stop the associated bearer and close as well but you will not get the WIP_BEV_STOPPED event in your bearer handle. If you only call the bearerStop() function it will stop the bearer but the recources will not be freed and you will get the WIP_BEV_STOPPED event.
Strange, because i don’t see the WIP_BERR_BAD_STATE return code in the documentation for the bearerClose() function (WIPlib 1.10). Which version do you use?
We use the newest of wavecom openat (4.11, IDE 1.02.03) and WipLib 1.10.02.
I always check for non documented result codes . Did they promise a complete documentation?
I tried to call bearerClose only, but this leads to a RTK error again.
Using wip_bearerStop only results in _OK_INPROGRESS, not showing WIP_BEV_STOPPED at all.
I have a bearerClose in the eventHandler for WIP_BEV_STOPPED that is never called.
For safety i think, i better stay with bearerStop AND bearerClose in the hope that _BAD_STATE is not realy true.
Hi,
I also have a RTK exception problem on wip_bearerStop function. It happens most of the time but not always… It looks like a wip librairy or OS bug… I’m working on a Q2686H under OS4.12, 6.61 and wip 1.10.03. Have you solve this issue since your last mail ? Thanks.
Tam
Hi all,
i already solved this problem.
The most important part is, not to close wip at all.
In my case i need a timer controlled start routine for wip and for the tcp connection, so that under rough conditions i can always reconnect.
With this code, i’m able to do several request to my server. When WIP_CEV_PEER_CLOSE event occured with a succesfully HTTP request :
HTTP result Code is 200
HTTP Channel close properly (wip_close())
bearerStop() properly too
WIP_BEV_STOPPED event occured and here i use bearerClose()
So, in this case all it’s right.
But, when WIP_CEV_ERROR event occured or WIP_CEV_PEER_CLOSE event with HTTP result Code return an error (for e.g. HTTP error 400)
HTTP Channel close properly (wip_close())
but bearerStop() will reset the module.
Why module reset ? it seems that when an error occured (HTTP error or WIP_CEV_ERROR), you shouldn’t close bearer at all. But why ? If bearer not closed after an error, how can i do a HTTP communication next times ???
Can someone help me or explain to me how bearerStop() / bearerClose() / wip_close() working ?!