Module miso

Module Methods

get_thread_priority()
The return values to expect are: EPriorityNull (-30, cannot be set by user code), EPriorityMuchLess (-20), EPriorityLess (-10), EPriorityNormal (0), EPriorityMore (10), EPriorityMuchMore (20), EPriorityRealTime (30), EPriorityAbsoluteVeryLow (100), EPriorityAbsoluteLow (200), EPriorityAbsoluteBackground (300), EPriorityAbsoluteForeground (400), EPriorityAbsoluteHigh (500, highest possible apart from the kernel).
set_thread_priority(integer priority)
get_process_priority()
The return values to expect are: EPriorityLow (150), EPriorityBackground (250), EPriorityForeground (350), EPriorityHigh (450), EPriorityWindowServer (650), EPriorityFileServer (750), EPriorityRealTimeServer (850), EPrioritySupervisor (950).
set_process_priority(integer priority)
num_alloc_heap_cells()
Returns the total number of cells allocated on the calling thread's heap.
num_free_heap_cells()
Returns the total number of free cells on the calling thread's heap.
alloc_heap_cells_size()
Returns the total size of the cells allocated on the calling thread's heap.
heap_biggest_avail()
Returns the space available in the largest free block an the calling thread's heap.
heap_total_avail()
Returns the total free space available on the calling thread's heap.
check_heap()
Checks the validity of the calling threads heap, raising a panic if any corruption is found.
heap_base_address()
Returns the base address of the heap of the running thread as an integer.
alloc_heap_cell(integer size)
Allocates a cell of at least the specified size from the current thread's heap.
free_heap_cell(integer address)
Frees the heap cell at the specified address. Passing an invalid address will result in a panic.
disk_total_avail(integer drive_num)
Returns the amount of free space on the specified disk. 0 == “A:”, 1 == “B:”, etc.
get_subst_path(integer drive_num)
Returns the path assigned to the specified substed drive.
create_drive_subst(integer drive_num, unicode path)
Assigns a path to a drive letter. To clear an existing substitution, specify an empty string as the path.
local_bt_name()
Returns the local Bluetooth name.
local_bt_address()
Returns the local Bluetooth address.
imei_code()
set_hal_attr(integer attr, integer value)
Sets the specified HAL attribute to the specified value.
get_hal_attr(integer attr)
Gets the value of the specified HAL attribute.
tick_count()
reset_inactivity_time()
Resets all inactivity timers. May be used to keep the backlight on, for instance.
take_photo([(integer, integer) size] [, integer format] [, integer quality] [, integer samplescheme])

Takes a photo using the number 0 camera of the device, if any, and returns it as a JPEG. The operation can fail for a number of reasons, such as the camera being in use by another application. Any failure results in an exception being thrown.

The function supports the following named arguments: size which is a tuple of integers, format which is a EFormatConstant, quality which specifies the JPEG quality and samplescheme which is a TJpegImageData constant.

Only available on Symbian OS 7.0s and higher.

Supported values for the keyword parameters are as follows:

vibrate(integer duration, integer intensity)

Runs the vibra motor for the specified duration of time at the specified intensity. The duration is specified in milliseconds, and must be greater than zero. The intensity is a value between -100 and 100 (inclusive), and it specifies percentage of full rotation speed. Positive and negative values cause rotation in opposite directions; a zero value indicates no rotation, and thus it makes little sense to call this function with 0 intensity argument.

Vibration will not work unless enabled in the profile. Only supported on Series 60 2nd Ed FP2 and higher.

FsNotifyChange()
Constructs an instance of FsNotifyChange. After finishing using a instance, you should call close() on it to free the associated resources.

Class FsNotifyChange

notify_change(integer type, callable callback [, unicode pathname])

Asynchronously requests notification of changes either anywhere in the filesystem, or only in locations matching the optionally specified pathname (which may contain wildcards).

The type parameter indicates the kind of change that should result in notification—its value should be one of: ENotifyEntry=0x00 (directory addition or deletion, or change of disk in a drive), ENotifyAll=0x01 (any change), ENotifyFile=0x04 (file creation, rename, or deletion), ENotifyDir=0x08 (directory creation, rename, or deletion), ENotifyAttributes=0x10 (attribute change), ENotifyWrite=0x20 (change resulting from a write to a file), ENotifyDisk=0x40 (change resulting from a raw write to a disk).

If the registration to observe for changes fails, this method throws an exception, and no change notification will be delivered. Otherwise a change notification request will remain pending until either delivered, or cancel or close is called, in which case the request gets cancelled without notification.

Change notification is delivered by calling the callable object provided as a parameter. It should accept a single integer argument, which will be passed as 0 to indicate that a filesystem change has taken place. If change observation fails, the callback will be called with a negative argument, which is a Symbian error code that should give some indication of the cause of the failure. The callback is not allowed to throw an exception; if it does, the calling thread will be panicked.

Only one request per FsNotifyChange object may be outstanding at any one time, and it is an error to call this method when there is an outstanding request. Once a request completes, it is necessary to make a new request to observe for subsequent changes—it is okay to call this method from within the callback.

cancel()
Cancels any outstanding request.
close()
Frees the resources associated with the object instance. The object may no longer be used after this method has been called. It is okay to call this method more than once, though.