I open the bearer, WIP_BEV_IP_CONNECTED event occurs, I detach the GSM antenna, WIP_BEV_ME_UNREG (Mobile equipment unregistered) event occurs, I try to close bearer with wip_bearerClose, returns BAD_HDL error (bad handle) so I think it must have closed itself, but wip_bearerStart returns “Device already in use”.
So I can neither close or start the bearer, is a reset (AT+CFUN=1) my only option?
The unit will not close the bearer on its own and certainly not without generating a callback event of some description, there are no other events that are generated after this is received i.e. WIP_BEV_IP_DISCONNECTED? The unit will not shut the bearer down because technically it can survive outages.
Thank you mlw, I will keep what you said in mind.
I discovered there is also an adl_gprs API, should I be using this instead of the wip_bearer API? Are they complementary, or is the adl_gprs a higher level API?
The GPRS library deals with GPRS at a much lower level creating and closing the PDP context ovr which IP data is transmitted, this is managed automatically at a higher level by the WIP library, to keep things simple and clean I would stick with this. One thing you could do is to subscribe to the unsolicitied +CREG (basic 2G circuit switched attach) and +CGREG (GPRS packet switched attach) responses, if the CGREG changes to anything other than 1 (home network) or 5 (roaming) it is the same as the WIP_BEV_ME_UNREG event occurring (and should happen at the same time) but it will give you a bit more information and enable you to make more informed decisions in your firmware.