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 | data_burst_profile = crt.Arguments(2)
|
| 25 | Else
|
| 26 | data_burst_profile = inputbox("Data burst profile: [0-3]" & VbCr & "0 - ranging" & VbCr & "1 - data" & VbCr & "2 - ranging FEC" & VbCr & "3 - data FEC")
|
| 27 | End IF
|
| 28 |
|
| 29 | 'SendApplicationCommand "/~ off"
|
| 30 |
|
| 31 | 'config onu
|
| 32 | serial = string(8 - Len(onu_id), "0") & onu_id
|
| 33 | 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
|
| 34 |
|
| 35 | 'activate onu
|
| 36 | SendApplicationCommand "/api/oper object=xgpon_onu sub=set_onu_state pon_ni=" & pon_ni & " onu_id=" & onu_id & " onu_state=active"
|
| 37 |
|
| 38 | 'SendApplicationCommand "/~ on"
|
| 39 |
|
| 40 | End Sub
|