# $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 | |
alloc_id = crt.Arguments(2) | |
Else | |
alloc_id = inputbox("Alloc id") | |
End IF | |
' you can also comment all the input values out and set these values manually | |
cbr_rt_bw = inputbox("cbr_rt_bw [bytes/sec]") | |
cbr_nrt_bw = inputbox("cbr_nrt_bw [bytes/sec]") | |
guaranteed_bw = inputbox("guaranteed_bw [bytes/sec]") | |
maximum_bw = inputbox("maximum_bw [bytes/sec]") | |
cbr_rt_compensation = inputbox("cbr_rt_compensation [yes,no]") | |
SendApplicationCommand "/~ off" | |
'config alloc | |
SendApplicationCommand "/api/set object=xgpon_alloc pon_ni=" & pon_ni & " alloc_id=" & alloc_id & " onu_id=" & onu_id & " sla.cbr_rt_bw=" & cbr_rt_bw & " sla.cbr_nrt_bw=" & cbr_nrt_bw & " sla.guaranteed_bw=" & guaranteed_bw & " sla.maximum_bw=" & maximum_bw & " sla.additional_bw_eligibility=non_assured sla.cbr_rt_compensation=" & cbr_rt_compensation & " sla.cbr_rt_ap_index=0 sla.cbr_nrt_ap_index=0 sla.alloc_type=nsr sla.weight=0 sla.priority=0" | |
SendApplicationCommand "/~ on" | |
End Sub |