S60 Platform: Thread and Active Objects Example v1.2
-------------------------------------------------------------------------------
This example demonstrates how to create an active scheduler and how to use active
objects inside a new thread. Inside the main thread (main program) the framework
creates the active scheduler automatically, but inside a new thread the active
scheduler must be created by the developer. One active object is a Bluetooth device
discoverer that searches Bluetooth devices in the vicinity and refreshes the "found devices" listbox. By default, the list is refreshed every 20 seconds.
The example has been tested to be compatible with S60 5th Edition and Touch UI.
PREREQUISITES
-------------------------------------------------------------------------------
- Active objects
- Multitasking
- Symbian OS key concepts
IMPORTANT FILES/CLASSES
-------------------------------------------------------------------------------
Btnotifier.h (Bluetooth notifier API): Used to provide a confirmation query to switch Bluetooth on.
e32std.h RThread: Used to implement threading functionality.
es_sock.h RSocketServer: Socket connections when discovering bt devices.
TOUCH UI SUPPORT
-------------------------------------------------------------------------------
No changes needed for Touch UI.
KNOWN ISSUES
-------------------------------------------------------------------------------
None.
RUNNING THE EXAMPLE
-------------------------------------------------------------------------------
1. Select "Start discovering devices" from the Options menu.
After that, every found new Bluetooth device is displayed in the listbox.
All Bluetooth devices are searched again after the refresh time has passed, cache
is not used. Refresh loop (active object) runs continuously.
If Bluetooth is not initially on, a confirmation query to switch Bluetooth on is
shown to the user.
2. (optional)
Set a new refresh time by selecting "Set refresh time" from the Options menu.
(Note that the refresh time cannot be less than 5 seconds due to slow Bluetooth
device discovery). The refresh time is 20 seconds if not set.
3. Select a Bluetooth device using arrow UP or arrow DOWN. Press the select key. An information
note displays the Bluetooth address of the selected device as hexadecimal.
4. In order to stop searching, press Exit.
INSTALLATION INSTRUCTIONS
-------------------------------------------------------------------------------
MOBILE DEVICE:
S60 3rd Edition:
go to /ThreadAndActiveObjectsEx/group
bldmake bldfiles
abld build [armv5 | gcce] urel
go to /ThreadAndActiveObjectsEx/sis
makesis [threadao_armv5.pkg | threadao_gcce.pkg]
Sign the SIS package with the signsis utility
- See the SDK Help for information about self-signed .sis packages, or
www.symbiansigned.com for information about Developer Certificates.
install the signed .sis file to your device
EMULATOR:
go to /ThreadAndActiveObjectsEx/group
bldmake bldfiles
abld build wins udeb (Visual Studio)
or
abld build winscw udeb (CodeWarrior)
start the emulator
COMPATIBILITY
-------------------------------------------------------------------------------
S60 5th Edition
S60 3rd Edition, Feature Pack 2
S60 3rd Edition, Feature Pack 1
S60 3rd Edition
Tested with Nokia 5800 XpressMusic, Nokia E90 Communicator, and Nokia N95.
VERSION HISTORY
-------------------------------------------------------------------------------
1.2 S60 5th Edition and Touch UI support ensured. S60 2nd Edition support removed.
Bluetooth notifier support added.
1.1 Support for S60 3rd Edition added.
1.0 Original example.
RELATED DOCUMENTATION
-------------------------------------------------------------------------------
For more information, see threadAndActiveObjectsEx\docs\S60_Platform_Thread_And_Active_Objects_Example_v1_1_en.pdf in the example application package.
EVALUATE THIS RESOURCE
-------------------------------------------------------------------------------
Please spare a moment to help us improve documentation quality and recognize the resources you find most valuable, by rating this resource.
.