Hi there,
we have a problem with “wip_bearerStart”. I write down the code here for better understanding…
/* bearer events handler */
void myHandler( wip_bearer_t br, s8 event, void context)
{
TRACE( (1, “myHandler()” ) );
switch( event)
{
case WIP_BEV_IP_CONNECTED:
/IP connectivity we can start IP application from here/
break;
case WIP_BEV_IP_DISCONNECTED:
/stop IP application/
break;
/ other events: /
default:
/cannot start bearer: report error to higher levels/
break;
}
}
/ bearer handle /
wip_bearer_t myBearer;
/ initialize and start GPRS bearer /
bool myConnectToGPRS( void)
{
TRACE( (1, “myConnectToGPRS()” ) );
/ open bearer and install our event handler /
if( wip_bearerOpen( &myBearer, “GPRS”, myHandler, NULL) != 0)
{
TRACE( (1, “wip_bearerOpen() : Fail” ) );
/ cannot open bearer /
return FALSE;
}
/ configure GPRS interface /
if( wip_bearerSetOpts ( myBearer, WIP_BOPT_GPRS_APN, “internet”, WIP_BOPT_LOGIN, “”, WIP_BOPT_PASSWORD, “”, WIP_BOPT_GPRS_HEADERCOMP, FALSE, WIP_BOPT_GPRS_DATACOMP, FALSE, WIP_BOPT_END) != 0)
{
TRACE( (1, “wip_bearerSetOpts() : Fail” ) );
/ cannot configure bearer /
wip_bearerClose( myBearer);
return FALSE;
}
/ start connection /
int x = wip_bearerStart( myBearer);
if( x != 0)
{
TRACE( (1, “wip_bearerStart() : Fail” ) );
/ cannot start bearer */
TRACE( (1, "WIP_BERR_BASE: %d", WIP_BERR_BASE ) );
TRACE( (1, "ERROR CODE: %d", x ) );
wip_bearerClose( myBearer);
return FALSE;
}
/* connection status will be reported to the event handler */
return TRUE;
}
void adl_main ( adl_InitType_e InitType )
{
TRACE( (1, “adl_main()” ) );
if(wip_netInit() != 0)
{
TRACE( (1, "wip_netInit() : Fail" ) );
return;
}
else
{
TRACE( (1, "wip_netInit() : Success" ) );
}
if(!myConnectToGPRS())
{
TRACE( (1, "myConnectToGPRS() : Fail" ) );
}
else
{
TRACE( (1, "myConnectToGPRS() : Success" ) );
startClient();
}
}
and the trace screen is(when the program is running)
Trace IP 1 adl_main()
Trace IP 1 [GPRS]: initialized.
Trace IP 1 [GSM]: initialized.
Trace IP 1 [UART1]: initialized.
Trace IP 1 [UART2]: initialized.
Trace IP 1 []: initialized.
Trace IP 1 wip_netInit() : Success
Trace IP 1 myConnectToGPRS()
Trace IP 1 [GPRS]: open: -> DISCONNECTED
Trace IP 1 [GPRS]: start: GPRS setup failed: -9
Trace IP 1 wip_bearerStart() : Fail
Trace IP 1 WIP_BERR_BASE: -20
Trace IP 1 ERROR CODE: -35
Trace IP 1 [GPRS]: close: -> CLOSED
Trace IP 1 myConnectToGPRS() : Fail
Error code is -35…What’s it?Do you have any idea? We can connect the Q2687 to the gprs network via hyperterminal with the at commands. But we couldn’t connect it via code…
Could you please help?
Thank you,