wip_bearerOpen fails if not called in most priorized thread

wip_bearerOpen() returns WIP_BERR_BAD_STATE if not called in most priorized thread

Establishing a GPRS connection (calling wip_netInit, calling adl_simSubscribe and waiting for ADL_SIM_EVENT_FULL_INIT, calling wip_bearerOpen…) works, if this is done within the most priorized thread.

If there is another thread with higher priority (even if it does nothing), establishing a GPRS connection in the lower priorized thread ends at wip_bearerOpen, that is returning WIP_BERR_BAD_STATE.

Does anyone has an idea, how to fix this problem?
Oliver

I would suspect that this is the intended behaviour?

Hiya,

In the WIP API giude there is a section on using WIP in a multithreaded environment.

ciao, Dave

You are right. The document says:

“The Open AT® Plug-In WIP Lib also can be used in multitasking manner where different Open AT® Plug-In WIP Lib operation can be done from different task context. Note that the bearer management must be done in the main application task context as it is not possible to manage bearers outside the main application task. But socket/session related operations can be done from other tasks contexts too. Also the “wip_netinit” API has to be called from each task to reserve the associated execution context for each Open AT® Plug-In WIP Lib operation.”

I assume, the “main application task” (where the bearer management must be done) is the most priorized task.

Thanks for your answers!
Oliver.