Device::SerialPort::Xmodem contains an Xmodem file transfer protocol for Device::SerialPort.
SYNOPSIS
use Device::SerialPort::Xmodem;
This is an Xmodem implementation designed to receive a file using 128 byte blocks. This module is intended to be passed an open and prepared port with active connection.
At this time it can only receive 128 byte blocks, however 1k blocks are in the works. I do plan to write a send functionality soon.
Device::SerialPort::Xmodem::Constants
Synopsis
This is a set of contants that return hex values for the following:
nul ^@ 0x00 null
soh ^A 0x01 start of header 128 byte block
stx ^B 0x02 start of header 1k byte block
eot ^D 0x04 end of trasmission
ack ^E 0x06 acknowlegded
nak ^U 0x15 not acknowledged
can ^X 0x18 cancel
C 0x43 C ASCII char
ctrl_z ^Z 0x1A end of file marker
Xmodem::Block
Class that represents a single Xmodem data block.
Synopsis
my $b = Xmodem::Block->new( 1, 'My Data...< until-128-chars >...' );
if( defined $b ) {
# Ok, block instanced, verify its checksum
if( $b->verify( 'checksum', < my_chksum > ) ) {
...
} else {
...
}
} else {
# No block
}
# Calculate checksum, crc16, 32, ...
$crc16 = $b->crc16();
$crc32 = $b->crc32();
$chksm = $b->checksum();
$b->to_string(); # outputs a formated message block
Requirements:
· Perl
Product's homepage