# wip\_bearerStart() return -26

**URL:** <https://forum.sierrawireless.com/t/wip-bearerstart-return-26/3044>\
**Category:** Open AT\
**Created:** [March 13, 2009, 10:14pm UTC](https://forum.sierrawireless.com/t/wip-bearerstart-return-26/3044 "2009-03-13T22:14:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![NikolaKirov](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@NikolaKirov](https://forum.sierrawireless.com/u/NikolaKirov)\
**Post date:** [March 13, 2009, 10:14pm UTC](https://forum.sierrawireless.com/t/wip-bearerstart-return-26/3044/1 "2009-03-13T22:14:13Z")

</div>

Hi.  
I try to use WIPLib 310 and OS6.57g on Q24Plus modem. I cannot initialize gprs bearer in Rte. Function wip\_bearerStart() return value is -26. Any idea for this problem?

```auto
typedef struct 
{
	const ascii * gprs_apn;
	const ascii * gprs_user;
	const ascii * gprs_password;
}gprs_config_t;

/ *************************************************************************** /
/* Function : gprs_config */
/*-------------------------------------------------------------------------*/
/* Object : Open and start the GPRS bearer. Normally, the bearer will */
/* answer IN_PROGRESS, and the initialization will be finished */
/* by the callback evh_bearer(). */
/ *************************************************************************** /
void gprs_config ( gprs_config_t *gprs_cfg_info,void (*callback_f)(int) )
{
	int r;
	ascii *p;
	GPRS_DEBUG_SEND_DBG_INFO("gprs_config()",0);

	/* Initialize the stack */
	r = wip_netInitOpts( 
		WIP_NET_OPT_DEBUG_PORT, WIP_NET_DEBUG_PORT_UART1, /* WIP traces on UART1 */
		//WIP_NET_OPT_DEBUG_PORT, WIP_NET_DEBUG_PORT_UART2,
		//WIP_NET_OPT_DEBUG_PORT, WIP_NET_DEBUG_PORT_TRACE,
      WIP_NET_OPT_END);

	_callback_f = callback_f;
	r = wip_bearerOpen( &gprs_bearer, "GPRS", evh_bearer, NULL);

	GPRS_CFG_ASSERT(r==0);
	
	r = wip_bearerSetOpts( gprs_bearer, 
		WIP_BOPT_GPRS_APN, gprs_cfg_info->gprs_apn,
		WIP_BOPT_LOGIN, gprs_cfg_info->gprs_user,
		WIP_BOPT_PASSWORD, gprs_cfg_info->gprs_password,
		WIP_BOPT_END);

	GPRS_CFG_ASSERT(r==0);

	r = wip_bearerStart( gprs_bearer );

	switch ( r )
	{
	case 0:								
	case WIP_BERR_OK_INPROGRESS: // OK.
	return;

	case WIP_BERR_BAD_HDL:
		p = "Invalid handle";
	break;
	case WIP_BERR_BAD_STATE:
		p = "The bearer is not stopped";
	break;
	case WIP_BERR_DEV:
		p = "Error from link layer initialization";
	break;
	default:
		GPRS_CFG_ASSERT(0);
	}
		// Error on open bearer
	wcu_send_error_m(r,"GPRS CFG","wip_bearerStart()",p,NULL);
	_callback_f( GPRS_CONFIG_BEARER_NOT_OPEN );
}
```

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [March 13, 2009, 11:17pm UTC](https://forum.sierrawireless.com/t/wip-bearerstart-return-26/3044/2 "2009-03-13T23:17:13Z")

</div>

> [@NikolaKirov](#):
>
> wip\_bearerStart() return value is -26. Any idea for this problem?

For a start, have you looked-up the meaning of -26 as a return value from wip\_bearerStart ❓

---

<div class="post-metadata">

**Author:** ![NikolaKirov](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@NikolaKirov](https://forum.sierrawireless.com/u/NikolaKirov)\
**Post date:** [March 13, 2009, 11:31pm UTC](https://forum.sierrawireless.com/t/wip-bearerstart-return-26/3044/3 "2009-03-13T23:31:55Z")

</div>

I see in documentation. Possible return values is

WIP\_BERR\_OK\_INPROGRESS -27  
WIP\_BERR\_BAD\_HDL -24  
WIP\_BERR\_BAD\_STATE -28  
WIP\_BERR\_DEV -29

-26 is a bug

---

<div class="post-metadata">

**Author:** ![davidc](https://avatars.discourse-cdn.com/v4/letter/d/a183cd/32.png) [@davidc](https://forum.sierrawireless.com/u/davidc)\
**Post date:** [March 14, 2009, 12:31am UTC](https://forum.sierrawireless.com/t/wip-bearerstart-return-26/3044/4 "2009-03-14T00:31:06Z")

</div>

Hiya,

You are better off looking through the header files for the return values, as sometimes the documentation lags the code.

-26 is WIP\_BERR\_PARAM - i.e. one of the parameters in your call to wip\_bearerStart() is wrong. Which parameter and why is anybody’s guess…

Try running your application again (i.e. AT+CFUN=1, AT+WOPEN=1 etc) and see if the problem goes away.

I’ve got an outstanding problem logged (since early December) with my distributor (and upstream to Wavecom) about this issue.

Using the default wavecom WIP http\_get sample, I can reliably reproduce this feature using the following steps:

1. Create new project based on WIP http\_get sample application
2. Change the GPRS logon and APN details to those required by your ISP and compile application in Target mode
3. Reflash module firmware (or erase application) using DWLWin
4. Download compiled application to modem and start with AT+WOPEN=1
5. First time the application runs, wip\_bearerStart will return -26
6. Reboot module using AT+CFUN=1
7. Second (and further) time the application runs, all is OK.

I can reliably reproduce this on all modules I have (Q2686G & H, Fastrack Supremes). My distributor can reproduce this on their modules. Wavecom tech support don’t seem to be able to reproduce this…

See also [viewtopic.php?f=16&t=2947&p=10768#p10768](http://www.wavecom.com/modules/movie/scenes/forums/viewtopic.php?f=16&t=2947&p=10768#p10768) for an earlier post on this topic and some responses.

ciao, Dave

---

<div class="post-metadata">

**Author:** ![awneil](https://avatars.discourse-cdn.com/v4/letter/a/49beb7/32.png) [@awneil](https://forum.sierrawireless.com/u/awneil)\
**Post date:** [March 14, 2009, 7:50am UTC](https://forum.sierrawireless.com/t/wip-bearerstart-return-26/3044/5 "2009-03-14T07:50:50Z")

</div>

> [@davidc](#):
>
> You are better off looking through the header files for the return values, as sometimes the documentation lags the code.

Unfortunately, this is all too often true - but, in this case, it is documented in the PDFs that I have:

[attachment=0]berr\_codes.gif[/attachment]

> [@](#):
>
> -26 is WIP\_BERR\_PARAM - i.e. one of the parameters in your call to wip\_bearerStart() is wrong.

Yes

> [@](#):
>
> Which parameter and why is anybody’s guess…

Yes 😠

---

<div class="post-metadata">

**Author:** ![NikolaKirov](https://avatars.discourse-cdn.com/v4/letter/n/bbe5ce/32.png) [@NikolaKirov](https://forum.sierrawireless.com/u/NikolaKirov)\
**Post date:** [March 14, 2009, 9:03pm UTC](https://forum.sierrawireless.com/t/wip-bearerstart-return-26/3044/6 "2009-03-14T21:03:29Z")

</div>

My code work on older version of OS and WIPSoft. In new version return this wrong code.

wip\_bearerStart() have only one parameter. This is brear parameter. It is not worng.

In documnetation for this function,i see in section “Return Value”,there is only 4 possible values:

WIP\_BERR\_OK\_INPROGRESS -27  
WIP\_BERR\_BAD\_HDL -24  
WIP\_BERR\_BAD\_STATE -28  
WIP\_BERR\_DEV -29

I debug my aplication on RTE. I not test in target mode.
