@echo off

set F10GCOM=COM2
echo Assuming FILA10G is on serial port %F10GCOM%

echo ---- Configuring station name to "Ap"
rem http://www.asciitable.com/ and note fila10g hex format is xFF not 0xFF
echo regwrite regbank0 10 x4170 | sendstr %F10GCOM%
 

rem echo -- Switching to VSI1/VSI2(2Gbps) or VSI1-2(4Gbp)
echo inputselect vsi1-2 | sendstr %F10GCOM%
echo reset | sendstr %F10GCOM%

echo ---- Setting system clock
timesyncFILA10G %F10GCOM%

echo ---- Setting system clock
vdif_timesyncFILA10G %F10GCOM%

echo arp off | sendstr %F10GCOM%

echo ---- Source MAC, IP, Port for eth0
echo tengbcfg eth0 mac=ba:dc:af:e4:be:e1 | sendstr %F10GCOM%
echo tengbcfg eth0 ip=192.168.1.20 gateway=192.168.1.1 nm=27 | sendstr %F10GCOM%
echo tengbcfg eth0 port=46227 | sendstr %F10GCOM%

echo ---- Source MAC, IP, Port for eth1
echo tengbcfg eth1 mac=ba:dc:af:e4:be:e2 | sendstr %F10GCOM%
echo tengbcfg eth1 ip=192.168.1.21 gateway=192.168.1.1 nm=27 | sendstr %F10GCOM%
echo tengbcfg eth1 port=46227 | sendstr %F10GCOM%

echo -- Setting destination IP address 192.168.1.10 for eth0
echo regwrite regbank0 11 0xC0A8010a | sendstr %F10GCOM% 

echo -- Setting destination IP address 192.168.1.10 for eth1
echo regwrite regbank0 6  0xC0A8010a | sendstr %F10GCOM% 

echo -- Adding MAC for gateway (x.x.x.1) and dest IP (x.x.x.10) in eth0 ARP
echo tengbarp eth0 1  01:00:5E:40:20:01 | sendstr %F10GCOM%
echo tengbarp eth0 10 00:60:dd:47:76:e5 | sendstr %F10GCOM%

echo -- Adding MAC for gateway (x.x.x.1) and dest IP (x.x.x.10) in eth1 ARP
echo tengbarp eth1 1  01:00:5E:40:20:01 | sendstr %F10GCOM%
echo tengbarp eth1 10 00:60:dd:47:76:e5 | sendstr %F10GCOM%

echo -- dataformat select 5b or vdif
echo dataselect 5b | sendstr %F10GCOM%

rem look at the 'VDIF size-maxnumber table', (here set to 8000+32)
echo -- VDIF data packet size-1 in 8-bytes unit as 0x05...
echo regwrite regbank0 2 0x050003e7
echo -- VDIF data packet number-1 in 1sec 
echo regwrite regbank0 3 0x0400f9ff

echo ---- Check from the 10G info that multicast MAC
echo tengbinfo eth0 | sendstr %F10GCOM%
echo tengbinfo eth1 | sendstr %F10GCOM%


pause
