Protocol-Zebra-Label/script/send-test-label.pl

21 lines
459 B
Perl

#!/usr/bin/env perl
use lib 'lib';
BEGIN {
$ENV{ZMQ_PERL_BACKEND} = 'ZMQ::LibZMQ3';
}
use ZMQ;
use ZMQ::Constants ':all';
use Protocol::Zebra::Label;
my $p = Protocol::Zebra::Label->new();
my $data = $p->format({ name => 'sw2 192.168.1.11', price => '', barcode => '', count => 1 });
my $ctx = ZMQ::Context->new(1);
my $push = $ctx->socket(ZMQ_PUSH);
$push->connect('tcp://192.168.1.82:9999') == 0 or die "Can't connect:$!";
$push->sendmsg($data);