# $language = "VBScript" | |
# $interface = "1.0" | |
Sub SendApplicationCommand(shell_command) | |
crt.Screen.Send shell_command & VbCr & VbCr | |
crt.sleep 1000 | |
End Sub | |
Sub main | |
pon_ni = inputbox("PON NI: XGPON:[0-7] XGS:[0-1]" ) | |
if pon_ni < 4 then | |
SendApplicationCommand "/board/i2c/dev_change dev=sw2" | |
crt.sleep 100 | |
SendApplicationCommand "/board/i2c/dev_write width=8 addr=0 val=0x" & hex(2 ^ (3 - pon_ni)) &" " | |
crt.sleep 10 | |
else | |
SendApplicationCommand "/board/i2c/dev_change dev=sw3" | |
crt.sleep 100 | |
SendApplicationCommand "/board/i2c/dev_write width=8 addr=0 val=0x" & hex(2 ^ pon_ni) &" " | |
crt.sleep 10 | |
end if | |
SendApplicationCommand "/board/i2c/dev_change sfp1 " | |
crt.sleep 10 | |
SendApplicationCommand "/board/i2c/dev_read width=8 addr=0x68" | |
crt.sleep 10 | |
SendApplicationCommand "/board/i2c/dev_read width=8 addr=0x69" | |
crt.sleep 10 | |
End Sub |