;
;                   LG Information & Communications, Ltd.
;                   Mobile Communications Research Lab.
;                   R&D Center
;                   MAKE BY LEE, CHANG JAE
;
;
; NV-items are programmed using the nv_write command:
;
;   nv_write itemname { [nam index,] val1, val2, ..., valn }
;
; Only NAM 0 has meaningful values.  Values for NAMs 1-3 are
; zeroed out or set to default values.
;
; Some items require a nam index (0-3). The curly braces
; are required and they surround the values to be written.
; You must supply every value the item expects. Hex values
; you supply need the 0x prefix.
;
; Semi-colons introduce comments. Whole line and
; to-end-of-line comments are possible.
;
; THE FOLLOWING PARAMETERS SHOULD BE SET FOR EACH PHONE:
; ------------------------------------------------------
;
;   1. CDMA preferred serving system (System A or System B)
;   2. Analog preferred serving system (System A or System B)
;   3. Analog Home SID (the SID of the preferred serving system)
;   4. Analog first paging channel (for system A or system B)
;   5. CDMA primary and seconday channels (including PCN, if in
;      use)
;   6. CDMA SID/NID pairs (the SID of the preferred serving system)
;   7. MIN1 and MIN2 parameters.
;   8. Default settings for MISELL (LGIC)
;===================================================================

print "LG-C260     "
print "ÅëÇÕ±Ô°Ý ½Ãºñ½º ÇÁ·Î±×·¥"

print "Start Service Programming"
; Enter the Service Programming Code (factory defaulted to 000000)
; If you don't have version 116 or later, this command will fail.
; This allows access to the SP items (both reading _and_ writing)

spc "000000"

;hs_lock l                       ; HS UNLOCK!

; Put the DMSS in offline analog mode
mode offline-d

; Display the ESN and permanent physical station
; configuration parameters
nv_read esn
nv_read verno_maj
nv_read verno_min
nv_read scm
nv_read slot_cycle_index
nv_read mob_cai_rev
nv_read mob_firm_rev
nv_read mob_model
print "Hit any key to continue"

;pause
wait 1

nv_write slot_cycle_index {2}

print "Programming CDMA Preferred Server"
nv_write pref_mode   {0, "digital only"}
nv_write pref_mode   {1, "digital only"}

print "Programming SYSTEM_PREF "
nv_write system_pref   {0, "standard"}
nv_write system_pref   {1, "standard"}

print "Programming CDMA SID Lock List"
nv_write cdma_sid_lock {0,     0,     0,     0,     0,     0,     0}
nv_write cdma_sid_lock {1,     0,     0,     0,     0,     0,     0}

print "Programming CDMA SID Acq List"
nv_write cdma_sid_acq {0,  0,  0,  0,  0,  0,  0}
nv_write cdma_sid_acq {1,  0,  0,  0,  0,  0,  0}

; CDMA channels are NOT allowed to be 0 anymore
print "Programming Primary CDMA Channel"
nv_write pcdmach {0, 283, 384} ; A and B primary CDMA channels of ShinSaeKi
nv_write pcdmach {1, 283, 384}

print "Programming Secondary CDMA Channel"
nv_write scdmach {0, 691, 777} ; set only if secondary channels offered
nv_write scdmach {1, 691, 777}

; NAM Checksums must all be 0xffff
print "Programming NAM Checksums"
nv_write nam_chksum {0, 0xffff}
nv_write nam_chksum {1, 0xffff}

; CDMA SID/NID pairs
; SID/NIDs come in pairs, 4 pairs for each NAM/MIN
; combination. The first parameter in the braces is
; NAM, the second is the MIN, the rest are SID, NID
; pairs. All non-zero SIDs have to have the same
; even/odd parity.
;
; Only the CDMA (MIN=1) sid_nid is programmed.
; The analog one has no meaning.

; MIN checksum
print "Programming MIN checksums"
nv_write min_chksum {0, 0xffff, 0xffff}
nv_write min_chksum {1, 0xffff, 0xffff}

nv_write curr_nam {0}

err_clr 0xff                             ; error clear

nv_write lock_code {"0000"}             ; Lock_code
nv_write sec_code {"000000"}            ; Security code
nv_write fsc {"159753"};                ; Field Security code
nv_write name_nam {0,"ÁªÍ¨ÐÂÊ±¿Õ"}    ; NAM0~5 Name
nv_write name_nam {1,"ÁªÍ¨ÐÂÊ±¿Õ"}

nv_write prl_enabled {0, 1}  ; PRL enabled  {NAM, "true" or "false"} 00 12 13 ÀÌÇü±Ù
nv_write prl_enabled {1, 1}  ; PRL enabled  {NAM, "true" or "false"} 2001. 6. 27 ¹ÚÂù¿ë

nv_write voice_priv {0}

print "Programming RF config"
nv_write rf_config {6}

;print "Programming MRU table clear"
nv_write mru2_table {0, "mru00.dat"}

;print "Programming Voice Service Option"
nv_write pref_voice_so {0,  1, 0x0003, 0x0003, 0x0003}

;print "Mobile Termination"
nv_wirte mob_term_home {0, true, true}
nv_wirte mob_term_for_sid {0, true, true}
nv_wirte mob_term_for_nid {0, true, true}

print "Programming defaults value for Features"
nv_write hw_config {0}          ; Hardware Config       == Nothing Special
nv_write auto_redial {1,3}      ; Auto redial           == enable!(every 2secs)
nv_write auto_answer {0,0}      ; Auto answer           == disable!
nv_write onetouch_dial {1}      ; One touch dial        == enable!
nv_write cont_key_dtmf {on}     ; Prssed key tone       == Normal
nv_write auto_hyphen {on}       ; Auto hyphen           == enable!
nv_write auto_nam {false}       ; Auto nam              == off
nv_write call_fade_alert {off}  ; Alert/Fade            == off
nv_write call_beep {off}        ; Alert/Minute          == off
nv_write svc_area_alert {off}   ; Alert/Service         == off

nv_write call_timer_g {0x00}    ; Last time             == clear(00:00)
nv_write life_timer_g {0x00}    ; All calls time        == clear(00:00)
nv_write life_cnt {0x00}        ; All calls counter     == clear(00)

;print "charging mode & mru table enable"
nv_write spare_1 {0x2}           ; charging
nv_write spare_2 {0x1}           ; MRU Table enable

print "End of Service Programming"
mode reset
