Shad Ansari | 2f7f9be | 2017-06-07 13:34:53 -0700 | [diff] [blame] | 1 | # $language = "VBScript" |
| 2 | # $interface = "1.0" |
| 3 | |
| 4 | Sub SendApplicationCommand(shell_command) |
| 5 | crt.Screen.Send shell_command & VbCr & VbCr |
| 6 | crt.sleep 200 |
| 7 | End Sub |
| 8 | |
| 9 | Sub main |
| 10 | If crt.Arguments.Count>0 Then |
| 11 | sys_mode = crt.Arguments(0) |
| 12 | Else |
| 13 | sys_mode = inputbox("system mode: [0:XGPON 1:XGS 2:NGPON2]") |
| 14 | End If |
| 15 | |
| 16 | If crt.Arguments.Count>0 Then |
| 17 | pon_ni = crt.Arguments(0) |
| 18 | Else |
| 19 | If sys_mode=0 Then |
| 20 | pon_ni = inputbox("PON NI: [0-7]") |
| 21 | Else |
| 22 | pon_ni = inputbox("PON NI: [0-1]") ' used for XGS/NGPON2 |
| 23 | End If |
| 24 | End If |
| 25 | |
| 26 | SendApplicationCommand "/~ off" |
| 27 | 'enable the transceiver this command is board dependent |
| 28 | If sys_mode=0 Then |
| 29 | SendApplicationCommand "/board/Trx_enable pon_id=" & pon_ni & " " |
| 30 | Else |
| 31 | SendApplicationCommand "/board/Trx_enable pon_id=" & pon_ni + 3 & " " |
| 32 | End If |
| 33 | crt.sleep 100 |
| 34 | |
| 35 | ' optinal Set Pon |
| 36 | SendApplicationCommand "/api/set object=xgpon_ni pon_ni=" & pon_ni & " hw_pon_id.pon_id_1=0 hw_pon_id.pon_id_2=0 onu_alarms_thresholds.losi=4 onu_alarms_thresholds.lobi=4 onu_alarms_thresholds.looci=3 onu_alarms_thresholds.lopci=3 ploam_handling.ack_timeout=2000 ploam_handling.retrans_ranging_time=1 ploam_handling.retrans_assign_alloc_id=1 ploam_handling.retrans_key_control=1 ploam_handling.retrans_request_registration=1 pon_distance.max_log_distance=20 pon_distance.max_diff_reach=20" |
| 37 | |
| 38 | If sys_mode=1 Then |
| 39 | SendApplicationCommand "/a/s object=xgpon_trx pon_ni=" & pon_ni & " transceiver_type=lth_5302_pc" |
| 40 | End If |
| 41 | If sys_mode=2 Then |
| 42 | SendApplicationCommand "/a/s object=xgpon_trx pon_ni=" & pon_ni & " transceiver_type=ltw_627x_pc" |
| 43 | End If |
| 44 | |
| 45 | ' Activate PON |
| 46 | SendApplicationCommand "/api/oper object=xgpon_ni sub=set_pon_state pon_ni=" & pon_ni & " pon_state=active_working" |
| 47 | |
| 48 | SendApplicationCommand "/~ on" |
| 49 | |
| 50 | End Sub |