mirror of
https://github.com/brmlab/lasic.git
synced 2025-06-09 09:43:59 +02:00
Brm::Lasic: Add seqid counter
This commit is contained in:
parent
9ea954d2a2
commit
ebd8d7a8b2
1 changed files with 8 additions and 1 deletions
|
@ -57,6 +57,12 @@ The tty device filehandle. Avoid using directly.
|
||||||
=cut
|
=cut
|
||||||
has 'fd' => (is => 'rw', isa => 'FileHandle');
|
has 'fd' => (is => 'rw', isa => 'FileHandle');
|
||||||
|
|
||||||
|
=item B<seqid>
|
||||||
|
|
||||||
|
Sequence id for commands. Just for internal use.
|
||||||
|
=cut
|
||||||
|
has 'seqid' => (is => 'rw', isa => 'Num', default => 0);
|
||||||
|
|
||||||
=back
|
=back
|
||||||
|
|
||||||
=head2 METHODS
|
=head2 METHODS
|
||||||
|
@ -158,7 +164,8 @@ sub msg {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
my (@args) = @_;
|
my (@args) = @_;
|
||||||
push @args, 1;
|
push @args, 1 + $self->seqid % 254;
|
||||||
|
$self->seqid($self->seqid + 1);
|
||||||
|
|
||||||
my $fd = $self->fd();
|
my $fd = $self->fd();
|
||||||
print $fd join(' ', @args)."\r\n";
|
print $fd join(' ', @args)."\r\n";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue