Sha256: 63f064d1c6fcfe089504e1d1730aabbc158cb5337450367b723c29e247953260

Contents?: true

Size: 884 Bytes

Versions: 14

Compression:

Stored size: 884 Bytes

Contents

package Javonet::Core::Receiver::Receiver;
use utf8;
use strict;
use warnings;
use Exporter;
use Config;
use File::Basename;

my $perlLibDirJavonet;
my $perlLibDirDeps;

BEGIN {
    my $thisFileDir = dirname(__FILE__);
    $perlLibDirJavonet = "$thisFileDir/../../../";
    $perlLibDirDeps = "$thisFileDir/../../../../deps/lib/perl5"
}

use lib "$perlLibDirJavonet";
use lib "$perlLibDirDeps";

use aliased 'Javonet::Core::Interpreter::Interpreter' => 'Interpreter', qw(process);

our @ISA = qw(Exporter);
our @EXPORT = qw(send_command heart_beat);

sub heart_beat {
    my (@byte_array) = @_;
    my $response = "10";
    return $response;
}

sub send_command {
    my ($byte_array_as_string) = @_;
    my @byte_array = unpack("C*", Encode::encode("ascii", $byte_array_as_string));
    my @response = Interpreter->process(\@byte_array);
    return join '', map chr, @response;
}

1;

Version data entries

14 entries across 7 versions & 1 rubygems

Version Path
javonet-ruby-sdk-2.1.4 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.4 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.3 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.3 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.2 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.2 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.1 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.1 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.0 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.1.0 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.0.4 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.0.4 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.0.1 lib/javonet-ruby-sdk/Binaries/Perl/Linux/X64/lib/Javonet/Core/Receiver/Receiver.pm
javonet-ruby-sdk-2.0.1 lib/javonet-ruby-sdk/Binaries/Perl/MacOs/X64/lib/Javonet/Core/Receiver/Receiver.pm