<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/usr/bin/perl
open(SP, "&gt;/dev/ttyS0");
#open(SP, "&gt;&amp;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 &lt; /dev/ttyS0`;
    sleep(1);
    print STDOUT "change\n";
    `stty speed 115200 &lt; /dev/ttyS0`;
    open(SP, "&gt;/dev/ttyS0");

}
</pre></body></html>