#!/usr/bin/perl
open(SP, ">/dev/ttyS0");
#open(SP, ">&STDOUT");
select(SP);
$|=1;
$null = pack("c", 0);
while(1){
    print "$null$null$null";
    for $i (1..100){
	$c = pack("c", rand(255));
	print SP "$c$c$c";
    }
    `stty speed 0 < /dev/ttyS0`;
    sleep(1);
    print STDOUT "change\n";
    `stty speed 115200 < /dev/ttyS0`;
    open(SP, ">/dev/ttyS0");

}
