Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Getting phone model

I put Korakot snippet (Looking up phone model using firmware code) into an useful module.

You need miso module.
All info can be found at this site

#
# Firmware.py  infos found at 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


usage:
>>>import firmware
>>>firmware.phone_model
>>>'6600'
>>>firmware.phone_cpu_speed
>>>104000

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS