Thank you very much, jan. I think a have to improve my c knowledge…
I have another question, I hope the last question.
My problem is that when I execute the program the first thing (after de ed_Init()) is call simSubscribe.
adl_simSubscribe((adl_simHdlr_f)SimHandler,"2587");
void SimHandler (u8 Event)
{
switch ( Event )
{
case ADL_SIM_EVENT_PIN_OK :
{ TRACE (( 1, "*****ADL_SIM_EVENT_PIN_OK" ));}
break;
case ADL_SIM_EVENT_REMOVED :
{TRACE (( 1, "******ADL_SIM_EVENT_REMOVED" ));}
break;
case ADL_SIM_EVENT_INSERTED :
{TRACE (( 1, "****ADL_SIM_EVENT_INSERTED" ));}
break;
case ADL_SIM_EVENT_FULL_INIT :
{TRACE (( 1, "****ADL_SIM_EVENT_FULL_INIT" ));}
break;
case ADL_SIM_EVENT_PIN_ERROR :
{TRACE (( 1, "****ADL_SIM_EVENT_PIN_ERROR" ));}
break;
case ADL_SIM_EVENT_PIN_NO_ATTEMPT :
{TRACE (( 1, "****ADL_SIM_EVENT_PIN_NO_ATTEMPT" ));}
break;
case ADL_SIM_EVENT_PIN_WAIT :
{TRACE (( 1, "****ADL_SIM_EVENT_PIN_WAIT" ));}
break;
default :
{ TRACE (( 1, "****raro PIN" ));}
break;
}
}
It work fine.
After that I do:
adl_atCmdCreate( "at+wgprs=0,0",FALSE,(adl_atRspHandler_t)wgprs_response_handler,"*",NULL);
bool wgprs_response_handler ( adl_atResponse_t *pars)
{
if (pars->StrData==OK)
{TRACE ((1,"GPRS connectat"));}
else {TRACE ((1,"GPRS NO CONNECTAT"));}
}
The problem is that I don’t know how to do that adl_atCmdCreate waits the end of adl_simSubscribe.
adl_atCmdCreate start before recieve ADL_SIM_EVENT_FULL_INIT from adl_simSubscribe.
Moreover I have
warning C4716: 'wgprs_response_handler' : must return a value
that I haven’t know if it’s important.
If you can help me another time…
Thank you very much another time!