   CTE MODE DOCUMENTATION   2.5
---------------- (C) r00t 2002 ---

USE FIXED SIZE FONT FOR THIS FILE FOR BETTER READING (LIKE TERMINAL)

Versions:
13.02.2003      New commands
18.01.2003      New command: LCDPATTERN
28.10.2002      New commands
01.09.2002      New command: SLDEFAULT
24.08.2002      Some TI functions and audiopath added
08.08.2002      First release
10.08.2002      Added Keypad scancodes
18.08.2002      Added some commands and TI functions

1. In default state, you can use these commands:

  KP
  KEYPRESS
  GETMAP
  PW
  SWITCHTODATACABLE
  V
  VER
  WAPVER

2. To enable all commands, you need WAPLOCK (unlock) code
   and enter:

   PW (waplock code)
                        For example: PW 57062933

   after restart, you can work with all commands.


   -OR-

   This way is tested for J5 & J6. If it works on other phones,
   please send me a e-mail.

   Start CTE terminal and after connect enter this command:
   (case sensitive, without "")

   "adctscoz HxRep"

   and press enter.
   Now restart the phone and you have full CTE mode.

3. If commands have parameters, You can append it after command,
   separated by space. No brackets or comma.

   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   !!!                                              !!!
   !!!   PARAMETERS ARE ONLY SEPARATED BY SPACES    !!!
   !!!                                              !!!
   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

   I use different syntax in this doc because I need to show difference
   between needed and optional parameters. Needed params are in "()"
   brackets but optional parameters are in "[]" brackets.

   Parameters can be in any form like:

   16 = 0x10 = 10h = 20o (octal)

   Strings: with no space: texttexttext
            with space   : "text text text"

   Section Number (SecNum): in HEX: 0x1004 = sec 16-04
                                    0x0103 = sec 01-03
        For example:


4. Syntax:

   FNNAME (needed parameter[,optional parameter])     (def: X) - default value of param.




 V                              Show current firmware version
 Ver                            Same as before
 WapVer                         Show wap browser version
 PW (WAPLOCK)                   Enable all CTE commands using WAP UNLOCK code
 SwitchToDataCable              Return to normal modem mode

 MemR8 (adr[,num])              Like MemR, but 1 byte
 MemW8 (adr,val[,val,..])       Like MemW, but 1 byte
 MemR (adr[,num])               Read from memory ADR,number of bytes NUM (def: 1)
 MemW (adr,val[,val,..])        Write to memory adress ADR values (max. 16)
 MemR16 (adr[,num])             Like MemR (2 bytes)
 MemW16 (adr,val[,val,..])      Like MemW (2 bytes)
 MemR32 (adr[,num])             Like MemR, but 4 bytes
 MemW32 (adr,val[,val,..])      Like MemW, but 4 bytes

 Call adr[,R0,R1,R2,R3]         Call mem adr using BX (and use regs R0-R3)
 HC (string)                    Compute HASH for this string

 NVMRead (secNum,numToRead)     Read data from section
 NVMWrite (SecNum,??,??)        Write data to section (?)
 NVMPut (SecNum,??,??)          Put data to section (?)
 NVMClear (SecNum)              Clear section
 NVMDelete (SecNum)             Delete section
 NVMBackup [SecNum]             Backup section (default backup: 00-01 - 00-05
                                                                00-08 - 00-12, 01-01 )
 NVMRestore                     Restore backed-up sections
 NVMFlush                       Write sections in RAM to Flash memory
 NVMNextFileID (SecNum)         Check for next used section

 SLDefault                      Clear all SIMLOCKs

 OmegaR (page,register)         Read from Omega chip, page:0-1, register:0-0x1f
 OmegaW (page,register,value)   Read to Omega chip, page:0-1, register:0-0x1f

 Watch                          Watch processes
 WatchLoop (time)               Measure CPU MIPS

 ReadWAP [1-8]                  Read MME settings (from profile 1-8)
 WriteWAP (profile,parameter,value)  Write MME settings

 ReadProd (ofs[,numbytes])      Read Prod data
 WriteProd (ofs,value)          Write Prod data
 ReadProdFlash (ofs[,numbytes]) Read Prod (secondary)
 WriteProdFlash (ofs,value)     Write Prod (secondary)

 WriteHWConfig (value)          Update HW id?

 ReadHWVersion                  Read HW version
 WriteHWVersion (value)         Write HW version

 ReadIMEI                       Display phone IMEI
 WriteIMEI (0x12,0x34,0x56,0x78,0x90,0x12,0x34,0x5) - set new phone IMEI (123456789012345)
 ReadIMSI                       Display SIM card IMSI
 SN                             Phone ser. number

 FactoryReset                   Factory reset

 GetNWStatus                    GSM Network status

 Dump                           Read ASSERT info + clear it (use debug window in CTE term)

 fsOpen (secNum,mode)           Open section, mode: 1-Read 2-Write or create
                                                You get handle number in dec.
 fsClose (handle)               Close section
 fsRead (handle,numToRead)      Read from section
 fsWrite (handle,data)          Write data to section
 fsDelete (secNum)              Erase section
 fsSeek (secAdr,pos,pos1)       Seek in section: new position=pos+pos1*20
 fsAttr (handle[,newAttr])      View or modify section attributes

 WriteRinger (num)              Set current ringer
 ReadRinger                     Get current ringer

 Tone [??[,??,??]]              Produce tone (?)
 Beep [??,??,??,??]             Produce beep (?)
 AudioPath (in_dev,out_dev)     Select INPUT and OUTPUT audio device
                                out_dev: 1-Back speaker  2-Front speaker 4-???
                                in_dev: ???
 SideTone (0-250)               Play sidetone 0-25 (*10)
 EchoCancel (??,??,??)          Control GSM codec
 Volume (0-255)                 Set speaker volume
 MicLevel (0-24)                Set mic level
 EnableAUXamp (0-1)             Switch ON/OFF speaker AMP

 ReadFIR (0-1)                  Read FIR filter memory 0 or 1 parameters
 WriteFIR (0-1,32bytes)         Write FIR filter 0 or 1 parameters

 Vibrate (??,??[,??])           Vibrate (?)
 MultiTone (??)                 Produce multi-channel tones
 SqWave (frq,ctrl)              Produce Square-wave signal
 Sine (frq,ctrl)                Produce Sine-wave signal

 VM (1-5 params)                Call voice function (?)
 SR (1-2 params)                Call SR function (?)

 Ring (freq,ctrl)               Like SINE
 Melody (??,??)                 Play melody (?)
 Sound (??,??)                  Play sound (?)

 MelodyStop                     Stop synth music
 SoundStop                      Stop wave music

 EnableShutDown (0-1,0-1)       Watchdog control ? (def: 1,1)
 BatteryVolts                   Read battery voltage
 ChargerConnected               Show charger connection state
 ChargerVolts                   Read charger voltage
 ChargerCurrent                 Read charger current
 ChargerEnable (0-1)            Force charging
 ChargerStatus                  Display charger status

 ReadTemp                       Read TEMP information
 AccDetect                      Read ACC information
 AdcRAW                         Read raw ADC
 AdcCOMP                        Read comp ADC
 ReadHW                         Read HW

 RTCReadID                      Display RTC ID (use Debug Window in CTE terminal)
 RTCReadClk                     Read RTC counter (use Debug Window in CTE terminal)
 RTCTest                        Start RTC test mode
 RTCSetClk (??,??,??,??,??)     Set RTC counter (?)

 LCDpattern (num[,grd[,lin]])   Draw display testing pattern #num, with grid size grd, height lin lines
 LCDgrey [l0,l1,l2,l3]          Get and set display grey levels
 LCDcont [l0,l1]                Get and set display contrast
 LCDpower (0-1)                 Switch display ON/OFF
 LCDread (reg[,numbytes])       Read from LCD chip register
 LCDwrite (reg,value)           Write to LCD chip register
 LCDmemr (Y,X[,numbytes])       Read from VideoMemory
 GetMap [X,Y[,numread]]         Take videomemory snapshot and read from it like LCDmemr
 Light (0-100)                  Set display and keypad LEDs light level

 KP ( scancode(s) )             Simulate pressing keys
 KeyPress ( scancode [up/down]) Like KP, but only one scan-code with up/down state
 RPTKey (0-1)                   Disable keypad and show scancodes in debug window
 JogComp (0-255)                ???

 PowerOFF                       Quick power-off
 TestSIMLines (??,??,??)        Test SIM card pins (?)

 UARTcts (0-1)                  Set UART CTS line
 UARTrts                        Get UART RTS line
 UARTgenioR                     Get UART GEN_IO state
 UARTgenioW (0-1)               Set UART GEN_IO state
 UARTgenioMode                  Get mode of GEN_IO (input/output)

 TestMode                       Disable all running processes in phone
 Monitor (??)                   Monitor (?)
 TI (tiFnName[,params,...])     Run TI function
 Cal32k [0-1]                   Read 32k counter [switch it ON/OFF]

 TXpwrLev (??,??,??,??)         Set PWR-out level
 TXramp (12xbyte)               TX power ramp
 RxFreqCal (??,??)              RX Frequency calibration
 RXagcCal (??,??,??)            RX AGC Calibration

 WritePWRSaving (1-0)           Start/Stop 32K counter
 ReadPWRSaving                  Read 32K counter status

 BerTest (??,??,??)             Bit Error Rate Test - Need special equipment
 AllCXeq                        Recalibrate DCS TX

 Sleep                          ??? (needs some special mode)


KEYPAD SCAN CODES
-----------------
0 - 9           digits 0-9
11              Green call button
12              Red end call button
13              #
14              *
16              Jog push (click)
17              side switch UP (select profile)
18              Jog UP
19              T9 and wap button (between green and red button)
20              Jog DOWN
22              side switch DOWN (keylock)
25              HF button


TI FUNCTIONS
------------
Use CTE command TI:  TI functionName [param1] [param2] [param3]

TMS (0-1)       Set TEST MODE - Like CTE testMode command
VG (verId)      Show I/O version  verId: 00-Board 10-Chipset 20-DSP 30-Analog 80-Layer1 E0-GGT
RCE (0-0x80)    CUST_RX_CAL_CHAN_READ_MASK
APG             Initial APG and Psi stats
RATR            Read AGC table
RCLR (0-2)      CUST_RX_CAL_LEVEL_READ
RCLW (0-2,val)  CUST_RX_CAL_LEVEL_WRITE
RCCR (0-3)      CUST_RX_CAL_CHAN_READ
RCCW (??,0-3)   CUST_RX_CAL_CHAN_WRITE
RCTR (0-2)      RX Temperature Compensation Table
TLTR (0..23d)   PA levels & templates
TCCR (0-2)      TX CHANNEL COMPENSATION TABLE
AGPR (0-2)      Read IL2AGC MAX and MIN info & parameters
TPR             Display phone info
CF (fn,0,0)     FN values:
                        0x01 - GSM_SHAPE for interpolation algorithm
                        0x02 - DCS_SHAPE for interpolation algorithm
                        0x03 - measured SB_GSM for interpolation algorithm
                        0x04 - measured SB_DCS for interpolation algorithm
                        0x05 - measured PL_GSM for interpolation algorithm
                        0x06 - measured PL_DCS for interpolation algorithm
                        0x11 - All current parameter for Temp. Comp.
                        0x12 - DCS&GSM Temp Comp.table for AUXDAC
                        0x22 - Counters info
                !! Don't try other values - You may damage your phone !!

