File Coverage

blib/lib/Lab/Moose/Connection/IsoBus.pm
Criterion Covered Total %
statement 14 33 42.4
branch n/a
condition n/a
subroutine 5 11 45.4
pod 0 6 0.0
total 19 50 38.0


line stmt bran cond sub pod time code
1             package Lab::Moose::Connection::IsoBus;
2             $Lab::Moose::Connection::IsoBus::VERSION = '3.881';
3             #ABSTRACT: Connection back end to the Oxford Instruments IsoBus
4              
5 1     1   2097 use v5.20;
  1         5  
6              
7 1     1   6 use Moose;
  1         2  
  1         9  
8 1     1   7083 use MooseX::Params::Validate;
  1         3  
  1         8  
9 1     1   530 use Carp;
  1         2  
  1         71  
10 1     1   8 use namespace::autoclean;
  1         2  
  1         8  
11              
12             has base_connection => (
13             is => 'ro',
14             isa => 'Lab::Moose::Connection'
15             );
16              
17             has isobus_address => (
18             is => 'ro',
19             isa => 'Int'
20             );
21              
22             sub BUILD {
23 0     0 0   my $self = shift;
24              
25             }
26              
27             sub set_termchar {
28 0     0 0   my $self = shift;
29 0           my %args = @_;
30 0           my $termchar = delete $args{termchar};
31              
32 0           $self->base_connection->set_termchar(termchar => $termchar, %args);
33             }
34              
35             sub enable_read_termchar {
36 0     0 0   my $self = shift;
37 0           my %args = @_;
38              
39 0           $self->base_connection->enable_read_termchar(%args);
40             }
41              
42              
43             sub Write {
44 0     0 0   my $self = shift;
45 0           my %args = @_;
46 0           my $cmd = delete $args{command};
47 0           $cmd = "\@" . $self->isobus_address() . $cmd;
48 0           $self->base_connection->Write(command => $cmd, %args );
49             }
50              
51             sub Read {
52 0     0 0   my $self = shift;
53 0           my %args = @_;
54              
55 0           return $self->base_connection->Read( %args );
56             }
57              
58             sub Clear {
59 0     0 0   my $self = shift;
60 0           my %args = @_;
61              
62 0           $self->base_connection->Clear( %args );
63             }
64              
65             with 'Lab::Moose::Connection';
66              
67             __PACKAGE__->meta->make_immutable();
68              
69             1;
70              
71             __END__
72              
73             =pod
74              
75             =encoding UTF-8
76              
77             =head1 NAME
78              
79             Lab::Moose::Connection::IsoBus - Connection back end to the Oxford Instruments IsoBus
80              
81             =head1 VERSION
82              
83             version 3.881
84              
85             =head1 DESCRIPTION
86              
87             Connection backend for the Oxford Instruments IsoBus, a serial protocol
88             connecting several instruments via a bus master.
89              
90             =head1 COPYRIGHT AND LICENSE
91              
92             This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
93              
94             Copyright 2021 Andreas K. Huettel, Fabian Weinelt
95              
96              
97             This is free software; you can redistribute it and/or modify it under
98             the same terms as the Perl 5 programming language system itself.
99              
100             =cut