mirror of
https://github.com/brmlab/lasic.git
synced 2025-06-09 01:34:00 +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
|
||||
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
|
||||
|
||||
=head2 METHODS
|
||||
|
@ -158,7 +164,8 @@ sub msg {
|
|||
my $self = shift;
|
||||
|
||||
my (@args) = @_;
|
||||
push @args, 1;
|
||||
push @args, 1 + $self->seqid % 254;
|
||||
$self->seqid($self->seqid + 1);
|
||||
|
||||
my $fd = $self->fd();
|
||||
print $fd join(' ', @args)."\r\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue