You Are Here:

Community: Developer Discussion Boards

#1 Old firmware module : getting phone model - 2006-03-06, 19:20

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

I put Korakot snippet (Looking up phone model using firmware code http://www.bigbold.com/snippets/posts/show/1641) into an useful module.

You need miso module http://pdis.hiit.fi/pdis/download/miso!

Code:
#
# Firmware.py : version 01 http://homepage.mac.com/alvinmok/nokia/firmware.html
#

'''
firmware.prefix_name 
firmware.suffix_name 
firmware.phone_model
firmware.phone_cpu_speed
'''
import sysinfo
import miso

ECPUSpeed = 0x0B

mapping_firmware_model={
  'RM-51': '3230',
  'RM-38': '3250',
  'NHM-10': '3600',
  'NHM-10X': '3620',
  'NHL-8': '3650',
  'NHL-8X': '3660',
  'RM-25': '6260',
  'RM-29': '6260b',
  'NHL-10': '6600',
  'NHL-12': '6620',
  'NHL-12X': '6620',
  'RM-1': '6630',
  'RH-67': '6670',
  'RH-68': '6670b',
  'RM-36': '6680',
  'RM-57': '6681',
  'RM-58': '6682',
  'RH-51': '7610',
  'RH-52': '7610b',
  'NHL-2NA': '7650',
  'RM-49': 'E60-1',
  'RM-89': 'E61-1',
  'RM-10': 'E70-1',
  'RM-24': 'E70-?',
  'NEM-4': 'N-Gage',
  'RH-29': 'N-Gage QD (asia/europe)',
  'RH-47': 'N-Gage QD (americas)',
  'RM-84': 'N70-1',
  'RM-99': 'N70-5',
  'RM-67': 'N71-1',
  'RM-112': 'N71-5',
  'RM-91': 'N80-3',
  'RM-92': 'N80-1',
  'RM-42': 'N90-1',
  'RM-43': 'N91-1',
  'RM-158': 'N91-5' }

mapping_prefix_description ={
 'N':'Mobile Phone',
 'R':'Computing Device',
 'T':'Terminal'}

mapping_suffix_description ={
    'B': 'GSM 900/1900',
    'C': 'DAMPS 800',
    'D': 'CDMA/AMPS 800',
    'E': 'GSM 900/1800',
    'F': 'NMT-450',
    'K': 'GSM 1800',
    'L': 'GSM 900/1800/1900 or GSM 850/1800/1900',
    'M': 'EGSM 900/1800 (may include WCDMA)',
    'N': 'IEEE 802.11b',
    'P': 'CDMA 800',
    'W': 'AMPS/TDMA 800/1900',
    'X': 'ETACS/TACS'}

sw = sysinfo.sw_version()
sw_list = sw.split(' ')

firmware_version = sw_list[1]
firmware_date = sw_list[2]
firmware_code=sw_list[3]

temp = firmware_code.split('-')
firmware_prefix = temp[0][0]
firmware_suffix = temp[0][-1]

prefix_name = mapping_prefix_description[firmware_prefix]
suffix_name = mapping_suffix_description[firmware_suffix]
phone_model = mapping_firmware_model[firmware_code] 
phone_cpu_speed = miso.get_hal_attr(ECPUSpeed) # CPU speed in Hz

>>>import firmware
>>>firmware.phone_model
>>>'6600'
>>>firmware.phone_cpu_speed
>>>'104000'
Reply With Quote

#2 Old Re: firmware module : getting phone model - 2006-03-07, 15:45

Join Date: Jan 2005
Posts: 148
Location: Bangkok, Thailand
Send a message via MSN to korakotc
korakotc's Avatar
korakotc
Offline
Regular Contributor
Thank you, Cyke64.

Can you help me understand how to use miso.get_hal_attr?
Where do you take this information from?
Quote:
ECPUSpeed = 0x0B
update
======
Ok, I just find it in Epoc32\include\hal_data.h
Code:
class HALData
	{
public:
	enum TAttribute
		{
		EManufacturer,
		EManufacturerHardwareRev,
		EManufacturerSoftwareRev,
		EManufacturerSoftwareBuild,
		EModel,
		EMachineUid,
		EDeviceFamily,
		EDeviceFamilyRev,
		ECPU,
		ECPUArch,
		ECPUABI,
		ECPUSpeed,
		ESystemStartupReason,
		ESystemException,
		ESystemTickPeriod,
		EMemoryRAM,
		EMemoryRAMFree,
		....
It's number 11 so == 0x0B.
Last edited by korakotc : 2006-03-07 at 15:55.
Reply With Quote

#3 Old Re: firmware module : getting phone model - 2006-03-07, 17:10

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Yes ! You found it !
In miso module there are many undocumented functions ...
get_hal_attr is one of them.
I don't know what is HAL but after googling I found this link http://www.symbian.com/developer/tec...#%3a%3aHALData and this link http://homepage.ntlworld.com/thouky/...psifs/sis.html (sis file format + hal_data meanings)

I think that a hal_data.py module containing constants (like keycodes.py) will be interesting.

Code:
#
# hal_data.py from Symbian OS 8.1 :  revision 01
#

EManufacturer = 0x00
EManufacturerHardwareRev = 0x01
EManufacturerSoftwareRev = 0x02
EManufacturerSoftwareBuild = 0x03
EModel = 0x04
EMachineUID = 0x05
EDeviceFamily = 0x06
EDeviceFamilyRev = 0x07
ECPU = 0x08
ECPUArch = 0x09
ECPUABI = 0x0A
ECPUSpeed=0x0B
ESystemStartupReason = 0x0C
ESystemException = 0x0D
ESystemTickPeriod = 0x0E
EMemoryRAM = 0x0F
EMemoryRAMFree = 0x10
EMemoryROM = 0x11
EMemoryPageSize = 0x12
EPowerGood = 0x13
EPowerBatteryStatus = 0x14
EPowerBackup = 0x15
EPowerBackup = 0x16
EPowerExternal = 0x17
EKeyboard = 0x18
EKeyboardDeviceKeys = 0x19
EKeyboardAppKeys = 0x1A
EKeyboardClick = 0x1B
EKeyboardClickState = 0x1C
EKeyboardClickVolume = 0x1D
EKeyboardClickVolumeMax = 0x1E
EDisplayXPixels = 0x1F
EDisplayYPixels = 0x20
EDisplayXTwips = 0x21
EDisplayYTwips = 0x22
EDisplayColors = 0x23
EDisplayState = 0x24
EDisplayContrast = 0x25
EDisplayContrastMax = 0x26
EBacklight  = 0x27
EBacklightState  = 0x28
EPen = 0x29
EPenX = 0x2A
EPenY = 0x2B
EPenDisplayOn = 0x2C
EPenClick = 0x2D
EPenClickState = 0x2E
EPenClickVolume = 0x2F
EPenClickVolumeMax = 0x30
EMouse = 0x31
EMouseX = 0x32
EMouseY = 0x33
EMouseState = 0x34
EMouseSpeed = 0x35
EMouseAcceleration = 0x36
EMouseButtons = 0x37
EMouseButtonState = 0x38
ECaseState = 0x39
ECaseSwitch = 0x3A
ECaseSwitchDisplayOn = 0x3B
ECaseSwitchDisplayOff = 0x3C
ELEDs = 0x3D
ELEDmask = 0x3E
EIntegratedPhone = 0x3F
EDisplayBrightness = 0x40
EDisplayBrightnessMax = 0x41
EKeyboardBacklightState = 0x42
EAccessoryPower = 0x43
ELanguageIndex = 0x44
EKeyboardIndex = 0x45
EMaxRAMDriveSize = 0x46
EKeyboardState = 0x47
ESystemDrive = 0x48
EPenState = 0x49
EDisplayIsMono = 0x4A
EDisplayIsPalettized = 0x4B
EDisplayBitsPerPixel = 0x4C
EDisplayNumModes = 0x4D
EDisplayMemoryAddress = 0x4E
EDisplayOffSetToFirstPixel = 0x4F
EDisplayOffsetBetweenLines = 0x50
EDisplayPaletteEntry = 0x51
EDisplayIsPixelOrderRGB = 0x52
EDisplayIsPixelOrderLandscape = 0x53
EDisplayMode = 0x54
ESwitches = 0x55
EDebugPort = 0x56
ELocaleLoaded = 0x57
ENumHalAttributes = 0x58 # ???
ENumHalAttributes = 0x59 # ???

try:
  miso.get_hal_attr(EMemoryRAM) # same value returning with sysinfo.total_ram()
except:
  pass

Attention use try: except: before calling get_hal_attr because some values are not available for all phones !


Do you know what is the purpose of miso.set_hal_attr ?
Reply With Quote

#4 Old Re: firmware module : getting phone model - 2006-03-08, 08:15

Join Date: Jan 2005
Posts: 148
Location: Bangkok, Thailand
Send a message via MSN to korakotc
korakotc's Avatar
korakotc
Offline
Regular Contributor
I guess that some hal_attr can be set. (Duh!)

For example, the screen contrast or brightness.
Never test it myself, though.
Reply With Quote

#5 Old Re: firmware module : getting phone model - 2006-09-24, 17:31

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Here's a new version(02) updated with new phones

You can find it to my site http://cyke64.googlepages.com/firmware.py

You don't need miso module now ...


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#6 Old Re: firmware module : getting phone model - 2006-12-08, 19:14

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Here's a new version(03) updated with new phones N75 and N95

firmware.py


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#7 Old Re: firmware module : getting phone model - 2007-02-28, 18:34

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Here's a new version(04) updated with new phones

Version History :
28 February 2007 version 04
+ E90 , E65 , E61i , N76 , N77 , N93i , 6110
? don't work with N80 cfr FNCTL sysutil API don't work with N80
? Only Nokia phones

link :
firmware.py 04


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#8 Old Re: firmware module : getting phone model - 2007-07-27, 19:03

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Here's a new version(05) updated with new phones

version history :
27 July 2007 version 05

+ 6631 , N76-5, N77-5 , N92-2 , N95 8GB , 6120 , 6120c-1 , 6120c-5 , 6121c
+ 5700 , 5700b , 6290 , 6290b
? don't work with N80 cfr FNCTL
? Only Nokia phones

link : firmware.py 05

Hey it's my 700th post

Cyke64


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#9 Old Re: firmware module : getting phone model - 2007-08-21, 15:55

Join Date: Nov 2006
Posts: 343
patrickfrei
Offline
Regular Contributor
The N80 has some problems with the SysUtil-API on some FW versions. That's why the app doesn't work... See:
http://www.forum.nokia.com/document/..._Nokia_N80.htm
http://www.patrickfrei.ch/phonetinfo/rb120/README (chapter 3)
Reply With Quote

#10 Old Thumbs up Re: firmware module : getting phone model - 2007-08-30, 15:55

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
Hello everybody ,

Here's a new version with interesting info about phone CPU !
CPU speed given by miso.get_hal_attr(0x0b) is not correct with some phone model like N93,N95 ... I didn't find any application giving the good info about it !
to patrick.frei: PhonetInfo give false info too !
So I add it to firmware module ...

Code:
import firmware

print firmware.phone_model
print firmware.main_cpu_type
print firmware.main_cpu_arm
print firmware.main_cpu_speed

# result given with N95
# N95-1
# TI OMAP 2420
# ARM-11
# 330000
Version history :
30 August 2007 version 06
+ add info about CPU without miso dependency
main_cpu_type , main_cpu , main_cpu_speed
main_cpu_speed give exact info not as miso.get_hal_attr(0x0B)
ie : N93 (330000) not 206000 !
? don't work with N80
cfr http://www.forum.nokia.com/document/..._Nokia_N80.htm
? Only Nokia phones
? no info on some models about CPU !


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#11 Old Re: firmware module : getting phone model - 2007-08-31, 11:31

Join Date: Nov 2006
Posts: 343
patrickfrei
Offline
Regular Contributor
Hello

All new Nokia phones (with FP1, as e.g. N95, etc...) are affected by the "CPU speed"-bug. Also the "CPU type" is shown incorrectly.

In PhoNetInfo I solved the last problem by hard-coding the CPU-type (ARM-11) for these phones. But the CPU-speed still remains wrong. Even on the emulator on my PC the CPU speed is being shown correctly... so why does the according HAL function return a wrong CPU-speed e.g. on my N95??? I really don't know why... the only solution at the moment seems to hard-code the CPU-speed, too...

@cyke64
What kind of firmware module did you mention? Can that be used with Python only or also with Symbian C++?
Reply With Quote

#12 Old Re: firmware module : getting phone model - 2007-10-03, 16:43

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Here's a new version(07) updated with new phones

version history :
3 October 2007 version 07

+ 3230b , 3250b , 3610 , 5500 (missing) , 6610n-1 , 6110n-5
+ E51-1 , N77-2 , N80-2 , N81-1 , N81-3 , N81-5 , N95-3
? don't work with N80 cfr FNCTL or Patrick Frei's post
? Only Nokia phones


link : firmware.py 07


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote

#13 Old Exclamation Re: firmware module : getting phone model - 2007-10-20, 16:21

Join Date: Feb 2005
Posts: 1,353
Location: Belgium (Europe)
cyke64's Avatar
cyke64
Offline
Super Contributor
hello ,

Here's a new version(08) corrected because the older doesn't work with some 3rd phones

But no one point it me
Is anyone using this module ?

Now it works !

version history :
20 October 2007 version 07

+ correct bug with info given by 3rd phone. Now it works !
? don't work with N80 cfr FNCTL or Patrick Frei's post
? Only Nokia phones


link : firmware.py 08


pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 !

pys60 extension modules on http://cyke64.googlepages.com/
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
How to detect the phone model? ernestkok General Browsing 17 2007-09-07 23:12
How can I know the cell phone model? nikng General Discussion 4 2005-12-17 12:41
7610 Contacts - Formatted Phone Numbers padlon General Discussion 2 2004-11-12 19:02
Finding firmware version of my phone? felix1717 General Discussion 1 2003-06-24 19:46
Can I access phone number and model from Java MIDP? systemcode Mobile Java General 1 1970-01-01 02:00

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia