# $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 | |
port_id = crt.Arguments(2) | |
Else | |
port_id = inputbox("port_id") | |
End IF | |
SendApplicationCommand "/~ off" | |
'config port | |
SendApplicationCommand "/api/set object=xgpon_gem_port pon_ni=" & pon_ni & " gem_port_id=" & port_id & " onu_id=" & onu_id & " configuration.direction=bidirectional configuration.type=unicast encryption_mode=disable upstream_destination_queue=data control=enable" | |
SendApplicationCommand "/~ on" | |
End Sub |