| 1 | package Lab::Connection::Socket; | ||
| 2 | #ABSTRACT: IP socket connection | ||
| 3 | $Lab::Connection::Socket::VERSION = '3.899'; | ||
| 4 | use v5.20; | ||
| 5 | |||
| 6 | use Lab::Bus::Socket; | ||
| 7 | use Lab::Connection; | ||
| 8 | use Lab::Exception; | ||
| 9 | |||
| 10 | our @ISA = ("Lab::Connection"); | ||
| 11 | |||
| 12 | 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 | my $proto = shift; | ||
| 21 | my $class = ref($proto) || $proto; | ||
| 22 | my $twin = undef; | ||
| 23 | my $self = $class->SUPER::new(@_) | ||
| 24 | ; # getting fields and _permitted from parent class | ||
| 25 | $self->${ \( __PACKAGE__ . '::_construct' ) }(__PACKAGE__); | ||
| 26 | |||
| 27 | return $self; | ||
| 28 | } | ||
| 29 | |||
| 30 | #---For compatibility with Instruments written for GPIB---- | ||
| 31 | sub EnableTermChar { # 0/1 off/on | ||
| 32 | my $self = shift; | ||
| 33 | my $enable = shift; | ||
| 34 | print "EnableTermChar Ignored: Only for GPIB not for SOCKET?\n"; | ||
| 35 | |||
| 36 | #$self->{'TermChar'}=$enable;#bus()->connection_enabletermchar($self->connection_handle(), $enable);} | ||
| 37 | return 1; | ||
| 38 | } | ||
| 39 | |||
| 40 | sub SetTermChar { # the character as string | ||
| 41 | my $self = shift; | ||
| 42 | my $termchar = shift; | ||
| 43 | print "SetTermChar Ignored: Only for GPIB not for SOCKET?\n"; | ||
| 44 | |||
| 45 | #my $result=$self->bus()->connection_settermchar($self->connection_handle(), $termchar); | ||
| 46 | return 1; | ||
| 47 | } | ||
| 48 | |||
| 49 | 1; | ||
| 50 | |||
| 51 | __END__ |