configurable interval
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 5 Oct 2020 14:59:40 +0000 (16:59 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 5 Oct 2020 14:59:40 +0000 (16:59 +0200)
zc-send

diff --git a/zc-send b/zc-send
index a048c7f..4287368 100755 (executable)
--- a/zc-send
+++ b/zc-send
@@ -23,11 +23,14 @@ if ( $path =~ m{$queue/(\w+)/} ) {
 
 my $raw;
 
-if ( $ARGV[0] eq m/interval/ ) {
+if ( $ARGV[0] =~ m/interval/ ) {
        # heartbeat interval
-       $raw = write_parameter_frame( "\x21" => "\x04" . pack('l',60) );
+       my $interval = $ARGV[1] || 300;
+       print "set heartbeat interval to $interval s\n";
+       $raw = write_parameter_frame( "\x21" => "\x04" . pack('l',$interval) );
 
-} else {       
+} else {
+       print "read_parameter_frame\n";
        $raw = read_parameter_frame( "\x00" => "\x04\xe8\x03\x00\x00",
        "\x21",
        "\x44",