blob: 109ca803c7343ae06c12ada3df920f63fe759cf6 [file] [log] [blame]
Shad Ansari2f7f9be2017-06-07 13:34:53 -07001# $language = "VBScript"
2# $interface = "1.0"
3
4Sub SendApplicationCommand(shell_command)
5 crt.Screen.Send shell_command & VbCr & VbCr
6 crt.sleep 1000
7End Sub
8
9Sub main
10
11 pon_ni = inputbox("PON NI: [0-15]" )
12
13
14if pon_ni < 8 then
15 SendApplicationCommand "/board/i2c/dev_change dev=sw2"
16 crt.sleep 100
17 SendApplicationCommand "/board/i2c/dev_write width=8 addr=0 val=0x" & hex(2 ^ (7 - pon_ni)) &" "
18 crt.sleep 10
19else
20SendApplicationCommand "/board/i2c/dev_change dev=sw3"
21 crt.sleep 100
22if pon_ni < 12 then
23
24 SendApplicationCommand "/board/i2c/dev_write width=8 addr=0 val=0x" & hex(2 ^ ( pon_ni - 4)) &" "
25 crt.sleep 10
26else
27 SendApplicationCommand "/board/i2c/dev_write width=8 addr=0 val=0x" & hex(2 ^ ( pon_ni - 12)) &" "
28 crt.sleep 10
29
30
31end if
32
33end if
34 SendApplicationCommand "/board/i2c/dev_change sfp2 "
35 crt.sleep 10
36 SendApplicationCommand "/board/i2c/dev_read width=8 addr=0x68"
37 crt.sleep 10
38 SendApplicationCommand "/board/i2c/dev_read width=8 addr=0x69"
39 crt.sleep 10
40
41
42End Sub