Home --> Documentations --> PJLIB Reference

Data Structures | Functions

Data Structures

struct  pj_symbianos_params
 

Functions

pj_bool_t pj_symbianos_poll (int priority, int ms_timeout)
 
pj_status_t pj_symbianos_set_params (pj_symbianos_params *prm)
 
void pj_symbianos_set_connection_status (pj_bool_t up)
 

Detailed Description

Functionalities specific to Symbian OS.

Symbian OS strongly discourages the use of polling since this wastes CPU power, and instead provides Active Object and Active Scheduler pattern to allow application (in this case, PJLIB) to register asynchronous tasks. PJLIB port for Symbian complies to this recommended behavior. As the result, few things have been changed in PJLIB for Symbian:

Since timer heap and ioqueue polling are no longer necessary, Symbian application can now poll for all events by calling User::WaitForAnyRequest() and CActiveScheduler::RunIfReady(). PJLIB provides a thin wrapper which calls these two functions, called pj_symbianos_poll().

Function Documentation

pj_bool_t pj_symbianos_poll ( int  priority,
int  ms_timeout 
)

Wait the completion of any Symbian active objects. When the timeout value is not specified (the ms_timeout argument is -1), this function is a thin wrapper which calls User::WaitForAnyRequest() and CActiveScheduler::RunIfReady(). If the timeout value is specified, this function will schedule a timer entry to the timer heap (which is an Active Object), to limit the wait time for event occurences. Scheduling a timer entry is an expensive operation, therefore application should only specify a timeout value when it's really necessary (for example, when it's not sure there are other Active Objects currently running in the application).

Parameters
priorityThe minimum priority of the Active Objects to poll, which values are from CActive::TPriority constants. If -1 is given, CActive::EPriorityStandard. priority will be used.
ms_timeoutOptional timeout to wait. Application should specify -1 to let the function wait indefinitely for any events.
Returns
PJ_TRUE if there have been any events executed during the polling. This function will only return PJ_FALSE if ms_timeout argument is specified (i.e. the value is not -1) and there was no event executed when the timeout timer elapsed.
void pj_symbianos_set_connection_status ( pj_bool_t  up)

Notify PJLIB that the access point connection has been down or unusable and PJLIB should not try to access the Symbian socket API (especially ones that send packets). Sending packet when RConnection is reconnected to different access point may cause the WaitForRequest() for the function to block indefinitely.

Parameters
upIf set to PJ_FALSE it will cause PJLIB to not try to access socket API, and error will be returned immediately instead.
pj_status_t pj_symbianos_set_params ( pj_symbianos_params prm)

Specify Symbian OS parameters to be used by PJLIB. This function MUST be called before pj_init() is called.

Parameters
prmSymbian specific parameters.
Returns
PJ_SUCCESS if the parameters can be applied successfully.

 


PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.