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 |
|
| 11 | If crt.Arguments.Count>0 Then
|
| 12 | pon_ni = crt.Arguments(0)
|
| 13 | Else
|
| 14 | pon_ni = inputbox("PON NI: XGPON:[0-7] XGS:[0-1]")
|
| 15 | End If
|
| 16 |
|
| 17 | If crt.Arguments.Count>1 Then
|
| 18 | onu_id = crt.Arguments(1)
|
| 19 | Else
|
| 20 | onu_id = inputbox("ONU id: [0-255]")
|
| 21 | End IF
|
| 22 |
|
| 23 | If crt.Arguments.Count>2 Then
|
| 24 | alloc_id = crt.Arguments(2)
|
| 25 | Else
|
| 26 | alloc_id = inputbox("Alloc id")
|
| 27 | End IF
|
| 28 |
|
| 29 | ' you can also comment all the input values out and set these values manually
|
| 30 | cbr_rt_bw = inputbox("cbr_rt_bw [bytes/sec]")
|
| 31 | cbr_nrt_bw = inputbox("cbr_nrt_bw [bytes/sec]")
|
| 32 | guaranteed_bw = inputbox("guaranteed_bw [bytes/sec]")
|
| 33 | maximum_bw = inputbox("maximum_bw [bytes/sec]")
|
| 34 | cbr_rt_compensation = inputbox("cbr_rt_compensation [yes,no]")
|
| 35 |
|
| 36 |
|
| 37 | SendApplicationCommand "/~ off"
|
| 38 |
|
| 39 | 'config alloc
|
| 40 | 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"
|
| 41 |
|
| 42 | SendApplicationCommand "/~ on"
|
| 43 |
|
| 44 | End Sub
|