I’ve tried to make automatic reconnection when bearer is disconnected by any reason.
I’ve added this in the evh_bearer function:
else if(WIP_BEV_IP_DISCONNECTED == event)
result = wip_bearerStop(b);
else if(WIP_BEV_STOPPED == event)
{
result = wip_bearerClose(b);
wip_debug("[GPRS]: Bearer Disconnected, trying to reconnect\r\n");
poll_creg( 0); //try to reconnect
}
this works well ,but the problem is when the GPRS fails when I’m trying to reconnect. the wip_bearerStart() function returns -27 (which is WIP_BERR_OK_INPROGRESS) then this progress fails without throwing any events in the evh_bearer function!
how could I konw that the bearer failed to start?
Is there any way to konw that? because the only way I have now is to reset the module manually.
Please help!