blob: 9137cd9a80738bc863f39e3fc76b1b49e4fd2f65 [file] [log] [blame]
# $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
pon_ni = crt.Arguments(0)
Else
pon_ni = inputbox("PON NI: XGPON:[0-7] XGS:[0-1]")
End If
If crt.Arguments.Count > 1 Then
onu_id = crt.Arguments(1)
Else
onu_id = inputbox("ONU id: [0-255]")
End IF
If crt.Arguments.Count > 2 Then
data_burst_profile = crt.Arguments(2)
Else
data_burst_profile = inputbox("Data burst profile: [0-3]" & VbCr & "0 - ranging" & VbCr & "1 - data" & VbCr & "2 - ranging FEC" & VbCr & "3 - data FEC")
End IF
'SendApplicationCommand "/~ off"
'config onu
serial = string(8 - Len(onu_id), "0") & onu_id
SendApplicationCommand "/api/set object=xgpon_onu pon_ni=" & pon_ni & " onu_id=" & onu_id & " serial_number.vendor_id=00000000 serial_number.vendor_specific=" & serial & " registration_id_auto_learning=yes ranging_burst_profile=0 data_burst_profile=" & data_burst_profile
'activate onu
SendApplicationCommand "/api/oper object=xgpon_onu sub=set_onu_state pon_ni=" & pon_ni & " onu_id=" & onu_id & " onu_state=active"
'SendApplicationCommand "/~ on"
End Sub