Hello again.
I have one little thing that is puzzling me... I'm still programming my GPRS modem, and it already works, but one more thing is missing... It sometimes opens, set options and start the bearer, and sometimes does not... I'll paste some of the debug and the code...
DEBUG: (not starting correctly)
+WIND: 13
+T2RST
No APN defined. Using "airtelnet.es" (Login: VODAFONE, Password: VODAFONE) for this session.
forcedIP: 0
MyIP: 0.0.0.0
SIM DETECTED. Starting TCP services.
+WIND: 1
PIN OK
+WIND: 16
ADL_SIM_EVENT_FULL_INIT detected.
+T2RSIM
wip_netInit ( ) returns: -24
+WIND: 4
+WIND: 10,"SM",0,"FD",0,"ON",0,"SN",1,"EN",0
+WIND: 11,,,,"966B57D8B06881FC361DBF5E8B842DE1","9E281DB9C906A7B9D8F48E29189F610
2",
+WIND: 7
+WIND: 15,1,"vodafone ES",2,"vodafone E",3,"+08",4,"07/09/04,07:53:09+08"
DEBUG: (starting correctly)
+WIND: 13
+T2RST
No APN defined. Using "airtelnet.es" (Login: VODAFONE, Password: VODAFONE) for t
his session.
forcedIP: 0
MyIP: 0.0.0.0
SIM DETECTED. Starting TCP services.
+WIND: 1
PIN OK
+WIND: 16
ADL_SIM_EVENT_FULL_INIT detected.
+T2RSIM
wip_netInit ( ) returns: -24
+WIND: 4
+WIND: 10,"SM",0,"FD",0,"ON",0,"SN",1,"EN",0
+WIND: 11,,,,"966B57D8B06881FC361DBF5E8B842DE1","D3187F6166F65892919646E969784EB
D",
+WIND: 7
Inside T2R_InitGPRSbearer. wip_bearerOpen returns: 0
Inside T2R_InitGPRSbearer. wip_bearerSetOpts returns: 0
Inside T2R_InitGPRSbearer. wip_bearerStart returns: -27
+T2RBE
+WIND: 15,1,"vodafone ES",2,"vodafone E",3,"+08",4,"07/09/04,07:56:03+08"
+T2RIP: 212.166.171.52
+TR2TCP
And here is some of my code:
void adl_main (...){
...
adl_simSubscribe ( Hdlr_SubscripcionSim, MyPIN );
...
}
static void Hdlr_SubscripcionSim ( u8 event ) {
...
case ADL_SIM_EVENT_FULL_INIT:
TRACE ( ( 1, "Hdlr_SubscripcionSim: ADL_SIM_EVENT_FULL_INIT" ) );
adl_atCmdCreate ( "AT+CGATT=1", TRUE, (adl_atRspHandler_t) Hdlr_GPRSAttach, "*", NULL );
TRACE ( ( 1, "Hdlr_SubscripcionSim: Send AT+CGATT=1 command" ) );
//Debug
wm_sprintf ( rspStr, "\r\nADL_SIM_EVENT_FULL_INIT detected.\r\n");
adl_atSendResponse ( ADL_AT_RSP, rspStr );
//
adl_atSendResponsePort ( ADL_AT_UNS, ADL_PORT_UART1, "+T2RSIM" );
debug = wip_netInit ( );
wm_sprintf ( rspStr, "\r\nwip_netInit ( ) devuelve: %d", debug );
adl_atSendResponse ( ADL_AT_RSP, rspStr );
...
}
bool T2R_InitGPRSBearer ( ) {
...
s8GPRSreturn = wip_bearerOpen ( &t2r_Bearer, "GPRS", Hdlr_GPRS_Bearer,NULL );
...
if ( s8GPRSreturn == 0 || forcedIP == 0 ) { //Everything OK
TRACE ( ( 1, "T2R_InitGPRSBearer: Bearer Open correctly" ) );
s8GPRSreturn = wip_bearerSetOpts ( t2r_Bearer, WIP_BOPT_GPRS_APN, MyAPN,
WIP_BOPT_LOGIN, MyLogin, WIP_BOPT_PASSWORD, MyPassword,
WIP_BOPT_END );
//Debugging
wm_sprintf ( rspStr, "\r\nInside T2R_InitGPRSbearer. wip_bearerSetOpts returns: %d\r\n", s8GPRSreturn );
adl_atSendResponse ( ADL_AT_RSP, rspStr );
//
s8GPRSreturn = wip_bearerStart ( t2r_Bearer );
//Debugging
wm_sprintf ( rspStr, "\r\nInside T2R_InitGPRSbearer. wip_bearerStart returns: %d\r\n", s8GPRSreturn );
adl_atSendResponse ( ADL_AT_RSP, rspStr );
}
Well, I think that’s too much code, but I’ve been dancing with this for a few days, and it’s something I can’t solve. Any idea will be welcomed . Thanks in advance.