As I'm no longer working at the LIP6 NPA team, this website will be deleted in the next few months. Please look at my personal webpage, all this content is mirrored there.
My personal website

You can find here some modules for PyS60, a S60 version of the Python interpreted language. Please note that you will have to sign these packages before sending them to your phone, refer to Symbian Signed to get help.
The source code is available through a Mercurial SCM.

Wlan Scanning module

List WLAN (WiFi) networks in Python from your phone

>>> import wlantools
>>> wlantools.scan()
[{'Capability': 1073, 'BeaconInterval': 100, 'SecurityMode': 'Wep', 'SSID': u'MESHDV_CLIENT', 'BSSID': u'00:20:A6:58:0F:9E', 'ConnectionMode': 'Infrastructure', 'InformationElements': {32: u'00', 42: u'00', 221: u'00037F010100240000', 50: u'3048606C', 7: u'4E4149010B1B'}, 'SupportedRates': u'82848B0C12961824', 'Channel': 8, 'RxLevel': -48}]
>>>
>>> # To ignore Information Elements present in beacon frame use:
>>> wlantools.scan(False)
[{'Capability': 1073, 'BeaconInterval': 100, 'SecurityMode': 'Wep', 'SSID': u'LIP6-guest', 'BSSID': u'00:19:A9:FE:09:A0', 'ConnectionMode': 'Infrastructure', 'RxLevel': -63, 'SupportedRates': u'82848B0C12961824', 'Channel': 1}]
>>>

Some help about the data returned:

  • Capability: Capability field of the IEEE802.11 beacon frame, please read IEEE 802.11 Standard
  • SupportedRates: Supported Rates Information Element of the IEEE802.11 beacon frame, please look at IEEE 802.11 Standard: 7.3.2 Information elements
  • Channel: DS Information Element of the IEEE802.11 beacon frame. It represents the channel (1-14) on which access point operates. Please look at IEEE 802.11 Standard: 7.3.2 Information elements
  • BeaconInterval: Interval in miliseconds between two beacon frames
  • SecurityMode: Open, Wep, 802.1x, Wpa, WpaPsk or Unidentified
  • ConnectionMode: AdHoc, Infrastructure, SecureInfra, Unknown
  • SSID: ESSID of the access point
  • BSSID: MAC address of the access point
  • RxLevel: Reception level in dBm
  • InformationElements: If True or nothing passed to the scan() function, this field contains a dictionary. key is the Element ID and value is the hexadecimal payload.

Extended GSM location module

Location module from PyS60 does not give enough informations about the CelId the phone is locked on, here is an improvement to get more informations (Technology used, Name of the operator...)

This modules needs to be signed with, at least, the capabilities: ReadUserData, ReadDeviceData, Location.

>>> #Phone in GSM mode
>>> elocation.extended_gsm_location()
{'NetworkId': u'10', 'NetworkAccessTechnology': 'GSM', 'NetworkStatus': 'Current', 'NetworkMode': 'GSM/GPRS or DCS1800 network', 'CountryCode': u'208', 'AreaCode': 4101, 'ShortName': u'', 'LongName': u'F SFR', 'CellId': 15742, 'DisplayTag': u'SFR'}
>>> #Phone in UMTS (3G) mode
>>> elocation.extended_gsm_location()
{'NetworkId': u'10', 'NetworkAccessTechnology': 'UMTS', 'NetworkStatus': 'Current', 'NetworkMode': 'WCDMA', 'CountryCode': u'208', 'AreaCode': 5400, 'ShortName': u'', 'LongName': u'F SFR', 'CellId': 7547952, 'DisplayTag': u'SFR'}
>>>

Some help about the data returned:

  • NetworkStatus: Indicative (you cannot acces other networks seen by the phone currently, the network seen is the onne you are locked on)
    • Unknown: Status is unknown
    • Available: A network that the mobile device is allowed to register to
    • Current: Currently registered network
    • Forbidden: A network that the ME is not allowed to register to
  • Network Mode: CTelephony::TNetworkMode
    • Unregistered: Mobile device is not registered
    • GSM/GPRS: GSM/GPRS or DCS1800 network
    • AMPS: AMPS network
    • IS-95: CDMA (IS-95) network
    • CDMA2000: CDMA (cdma2000) network
    • WCDMA: WCDMA (UTRA Frequency Division Duplex (FDD)) network
    • TD-CDMA: TD-CDMA (UTRA Time Division Duplex (TDD)) network
    • Unknown: Network mode is unknown
  • NetworkId: Identification number of the network operator (The network identity, NID in CDMA and MNC in GSM)
    • Example: in France, SFR is 10, Orange is 1
  • CountryCode: Identification number of the country (network MCC)
  • AreaCode: Location area code, (can be different for each operator in the same area)
  • DisplayTag: The alpha-tag of the network operator
  • For GSM/WCDMA Networks:
    • Network Access Technology: CTelephony::TNetworkAccess
      • GSM: The access technology is GSM
      • GSM COMPACT: The access technology is GSM COMPACT. However GSM COMPACT systems which use GSM frequency bands but with the CBPCCH broadcast channel are considered as a separate access technology from GSM
      • UMTS: The access technology is UTRAN (UMTS Network)
      • Unknown: This is used when there is no network activity and therefore no RAT active
    • CellId: The cell identity code
    • ShortName: The short name (up to 8 characters) of the network operator
    • LongName: The long name (up to 16 characters) of the network operator
  • For (Td)CDMA Networks:
    • BandInfo: Mobile phone network band information. Example: 800MHz Band C
  • For AMPS and (Td)CDMA Networks:
    • CdmaSID: On CDMA networks, the system identity (SID) of the CDMA or AMPS network

GPS module

Easy way to get data from an internal GPS on Nokia platforms (S60)

This modules needs to be signed with, at least, the capabilities: Location.

Note: This module is deprecated since Nokia released an official positioning module. Please refer to the Forum Nokia discussion board for more details (Thread about location API).

Help: get and build the sources

Repository

  To checkout the code you will need to download mercurial (Windows version), then open a console (Start > Run > cmd) and simply type:
hg clone https://air.mosomuso.com/pubhg/pyext/

Getting the SDK and plug-ins

To build a module you need the Nokia S60 SDK fitting to your phone (please look here and PyS60 sources.  .
Moreover, if you want to build the wlan scanning module you will need to download the SDK API Plugin to get the headers of the Wlan Management API.

Building the sources

The next step is to move the modules sources into the PyS60 sources and build them using the example batch file given in the repository.
Feel free to contact me if you encounter any problem.

Contact


Christophe Berger

LIP6 - Équipe NPA
104 avenue du Président Kennedy
Bureau 720 Bureau 752
F-75016 Paris
France

Office +33 (0)144 277 277
Cellular +33 (0)698 006 978

christophe.berger@lip6.frsee personal webpage