| # $language = "VBScript" |
| # $interface = "1.0" |
| |
| Sub SendApplicationCommand(shell_command) |
| crt.Screen.Send shell_command & VbCr & VbCr |
| crt.sleep 200 |
| End Sub |
| |
| Sub main |
| If crt.Arguments.Count>0 Then |
| sys_mode = crt.Arguments(0) |
| Else |
| sys_mode = inputbox("system mode: [0:XGPON 1:XGS 2:NGPON2]") |
| End If |
| |
| If crt.Arguments.Count>0 Then |
| pon_ni = crt.Arguments(0) |
| Else |
| If sys_mode=0 Then |
| pon_ni = inputbox("PON NI: [0-7]") |
| Else |
| pon_ni = inputbox("PON NI: [0-1]") ' used for XGS/NGPON2 |
| End If |
| End If |
| |
| SendApplicationCommand "/~ off" |
| 'enable the transceiver this command is board dependent |
| If sys_mode=0 Then |
| SendApplicationCommand "/board/Trx_enable pon_id=" & pon_ni & " " |
| Else |
| SendApplicationCommand "/board/Trx_enable pon_id=" & pon_ni + 3 & " " |
| End If |
| crt.sleep 100 |
| |
| ' optinal Set Pon |
| 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" |
| |
| If sys_mode=1 Then |
| SendApplicationCommand "/a/s object=xgpon_trx pon_ni=" & pon_ni & " transceiver_type=lth_5302_pc" |
| End If |
| If sys_mode=2 Then |
| SendApplicationCommand "/a/s object=xgpon_trx pon_ni=" & pon_ni & " transceiver_type=ltw_627x_pc" |
| End If |
| |
| ' Activate PON |
| SendApplicationCommand "/api/oper object=xgpon_ni sub=set_pon_state pon_ni=" & pon_ni & " pon_state=active_working" |
| |
| SendApplicationCommand "/~ on" |
| |
| End Sub |