being run in the context of the thread that is waiting in Ao lock. This must be considered when
designing the application logic.
signal()
Signals the lock. The waiter is released.
4.1.3 Ao timer Type
The rationale for the Ao timer type is that you cannot cancel a pending e32.ao sleep. This is
problematic if e.g. the user exits an application which is sleeping. In this case a panic would occur
since the sleep is not cancelled - this is the reason you should avoid using e32.ao sleep and instead
use the Ao timer with appropriate cancel calls if there is for example a possibility for the user to exit
the application during a sleep.
class Ao timer()
Creates an Ao timer instance. A Symbian active object based sleeping service. This can be used
in the main thread without blocking the handling of UI events. The application should not exit
while a thread has a pending after call in Ao timer. Only one after invocation can be pending
at time for each instance of this type.
Instances of Ao timer type have the following methods:
after(interval [,callback ])
Sleeps for the given interval without blocking the active scheduler. When the optional callback is
given, the call to after returns immediately and the callback gets called after interval.
cancel()
Cancels a pending after call.
4.2 sysinfo — Access to system information
The sysinfo module offers an API for checking the system information of a S60 mobile device.
Note: The method ring type is not available for S60 1st Edition.
The sysinfo module has the following functions:
active profile()
Returns the current active profile as a string, which can be one of the following: ’general’,
’silent’, ’meeting’, ’outdoor’, ’pager’, ’offline’, , ’drive’, or ’user <profile
value>’.
battery()
Returns the current battery level. On devices based on S60 2nd Edition Feature Pack 1 (S60 2.1)
or earlier the value ranges from 0 (empty) to 7 (full). On newer devices the value ranges from 0
(empty) to 100 (full). On the emulator the value is always 0.
Note: The returned value may be incorrect while the device is being charged.
display twips()
Returns the width and height of the display in twips. For a definition of a twip, see Chapter 10,
Terms and Abbreviations.
display pixels()
Returns the width and height of the display in pixels.
free drivespace()
Returns the amount of free space left on the drives in bytes, for example {u’C:’ 100}. The keys
in the dictionary are the drive letters followed by a colon (:).
imei()
Returns the IMEI code of the device as a Unicode string or, if running on the emulator, the
hardcoded string u’000000000000000’.
4.2. sysinfo — Access to system information 11