#!/usr/bin/perl

use strict;
use warnings;
use Fcntl;
use Time::HiRes qw( sleep );

write_byte(1210, chr(0x40));
sleep 0.2;
write_byte(1210, chr(0x05));

sub write_byte {
  my $port = shift;
  my $data = shift;

  sysopen (PORT,"/dev/port",O_RDWR) || die "error on /dev/port: $!";
  binmode (PORT);
  sysseek (PORT,$port,0)|| die "seek_err\n";
  syswrite(PORT,$data)  || print "write_err while writing $data \n";
  close (PORT);
}

