use Device;
use System;
my ( $serverAddress, $port, $reportFile ) = @_;
my $System = new System($serverAddress, $port);
my $dut = new Device('DEV',127.0.0.1,5000);
####
package Device;
use Command;
use Comm;
sub new {
my $class = shift;
my $self = {
_device => shift,
_serveraddr => shift,
_port => shift
};
bless $self, $class;
return $self;
}
my $SockObj = Comm->new( $self->_serveraddr, $self->_port );
my $ComObj = Comm->new();
sub Action1 {
my ( $self, $x, $y ) = @_;
my $tmp = {
'hash1' => 'Command',
'value1' => $x,
'value2' => $y,
'Device' => $self->{_device}
};
$InputRequest = $ComObj->CreateInputString($tmp);
$SockObj->WriteInfo($InputRequest);
my $Response = $SockObj->ReadData();
$ComObj->TapResponse($Response);
}
####
package System;
use Comm;
use Command;
my $SockObj = Comm->new();
my $ComObj = Command->new();
sub new {
my $class = shift;
my $self = {
_serveraddr => shift,
_port => shift
};
bless $self, $class;
return $self;
}