Add script to Send test label
This commit is contained in:
parent
9ce3293b3b
commit
9c994af78c
20
script/send-test-label.pl
Normal file
20
script/send-test-label.pl
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#!/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);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user