Connection/Socket.pm

filter: Statementstmt 50.0% 15 / 30 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 57.1% 4 / 7 Podpod 33.3% 1 / 3 totaltotal 44.4% 20 / 45 SCAR 9.7
CC
2
Cov
45%
new
6.0
EnableTermChar
2.0
SetTermChar
2.0
CRAP 2.6
« Exception/Base.pm ↑ Summary Moose/Instrument/Common.pm »
1 package Lab::Connection::Socket;
2 #ABSTRACT: IP socket connection
3 1 $Lab::Connection::Socket::VERSION = '3.881';
4 1 ▶use v5.20;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use Lab::Bus::Socket;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Lab::Connection;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Lab::Exception;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our @ISA = ("Lab::Connection");
11  
12 1 our %fields = (
13 bus_class => 'Lab::Bus::Socket',
14 wait_status => 0, # usec;
15 wait_query => 10e-6, # sec;
16 read_length => 1000, # bytes
17 );
18  
19 sub new {
20 0 ▶ my $proto = shift;
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
21 0 ▶ my $class = ref($proto) || $proto;
Condition0%0/3
ref $proto || $proto
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $proto || $proto
ref $proto $proto
Truth table0%0/3
A || B
A= ref $protoB= $proto
ABresult
1X1
011
000
22 0 my $twin = undef;
23 0 my $self = $class->SUPER::new(@_)
24 ; # getting fields and _permitted from parent class
25 0 $self->${ \( __PACKAGE__ . '::_construct' ) }(__PACKAGE__);
26  
27 0 return $self;
28 }
29  
30 #---For compatibility with Instruments written for GPIB----
31 sub EnableTermChar { # 0/1 off/on
32 0 ▶ my $self = shift;
Subroutine EnableTermChar: not called CC=1 SCAR=6.9
Pod undocumented
33 0 my $enable = shift;
34 0 print "EnableTermChar Ignored: Only for GPIB not for SOCKET?\n";
35  
36 #$self->{'TermChar'}=$enable;#bus()->connection_enabletermchar($self->connection_handle(), $enable);}
37 0 return 1;
38 }
39  
40 sub SetTermChar { # the character as string
41 0 ▶ my $self = shift;
Subroutine SetTermChar: not called CC=1 SCAR=6.9
Pod undocumented
42 0 my $termchar = shift;
43 0 print "SetTermChar Ignored: Only for GPIB not for SOCKET?\n";
44  
45 #my $result=$self->bus()->connection_settermchar($self->connection_handle(), $termchar);
46 0 return 1;
47 }
48  
49 1 1;
50  
51 __END__
52  
53 =pod
54  
55 =encoding UTF-8
56  
57 =head1 NAME
58  
59 Lab::Connection::Socket - IP socket connection
60  
61 =head1 VERSION
62  
63 version 3.881
64  
65 =head1 COPYRIGHT AND LICENSE
66  
67 This software is copyright (c) 2023 by the Lab::Measurement team; in detail:
68  
69 Copyright 2012 David Kalok
70 2013 Andreas K. Huettel
71 2016 Simon Reinhardt
72 2017 Andreas K. Huettel
73 2020 Andreas K. Huettel
74  
75  
76 This is free software; you can redistribute it and/or modify it under
77 the same terms as the Perl 5 programming language system itself.
78  
79 =cut
« Exception/Base.pm ↑ Summary Moose/Instrument/Common.pm »