I’ve written an application which is sending a file to a FTP-server every three minutes. If the application receives an incoming call, it stops the GPRS-Connection with ‘ed_DialupConnectionStop(DialupCallback);’. After the Function ‘DialupCallback()’ is called with the response code ‘ED_OK_ON_HOOK’, the incoming call will be answered. When the call has ended, the application restarts the GPRS connection with ‘ed_DialupConnectionStart(DialupCallback)’ two seconds later. Normally this works fine, but sometimes the function DialupCallback() isn’t called with the response code ‘ED_OK_GPRS_SESSION_SET’ after the GPRS handler got the event ‘ADL_GPRS_EVENT_SETUP_OK’. So the next FTP transfers failed.
How can I solve this problem without reseting my application? I’m using a Q2406B with Firmware v6.55 and OpenAT 3.10
ADL_GPRS_EVENT_ME_DETACH response is normal, you must retry AT+CGATT=1 every 2 seconds e.g. until response is OK and it will works. I use that to reboot the gprs ans it works perfectly.
Best regards,
gdt
From the wavecom samples :
void SetupHandler(u8 ID)
{
TRACE( ( 2, "Inside SetupHandler" ) );
adl_atCmdCreate("AT+CGATT=1",FALSE,AttRspHandler,"*",NULL);
}
bool AttRspHandler(adl_atResponse_t *params)
{
TRACE( ( 2, "Inside AttRspHandler" ) );
//if an OK is received as response to AT+CGATT=1 command then set GPRS settings.
if( !wm_strncmp( params->StrData, "\r\nOK", 4 ) )
{
//Ready
TRACE( ( 2, "Received OK" ) );
adl_tmrSubscribe(FALSE,20,ADL_TMR_TYPE_100MS,GPRSWait);//Give modem time to process CGATT=1
}
//if an OK is not received then create AT+CGATT=1 again.
else
{
adl_atCmdCreate( "AT+CGATT=1", FALSE, AttRspHandler, "*", NULL );
}
return FALSE;
}
Which sample do you mean? I took a look to the samples which are shipped with OpenAT v3.10 but I found no sample which contains a function called GPRSwait. Which task does this function perform?
Do you actually need to shutdown GPRS? I thought you may do voice calls while still attached? I thought GPRS data transfer just gets suspended… Haven’t tried it yet… Is that not so?
Normally not. But I need a workaround if the reconnection started with ‘ed_DialupConnectionStart(DialupCallback)’ fails. And it seems that a detach/attach cycle is better than a restart of the whole application. If there is an other way to reestablish the GPRS-connection so let me know.
I found that in the OpenAT 4.0 sample for the Q2686.
These functions try to reattach GPRS every 2 seconds until it succeeded.
You can ask the full sample to your distributor. I think the name of the sample is pingGPRS.