unify gmt offset to $r0ket::timediff
This commit is contained in:
parent
54257783cb
commit
ef16649125
|
@ -14,6 +14,7 @@ use Time::HiRes;
|
||||||
our $verbose=0;
|
our $verbose=0;
|
||||||
our $bridge; # Open device
|
our $bridge; # Open device
|
||||||
our $quiet=0;
|
our $quiet=0;
|
||||||
|
our $timediff=60*60*2;
|
||||||
|
|
||||||
### Utility
|
### Utility
|
||||||
sub sprint{
|
sub sprint{
|
||||||
|
@ -154,7 +155,7 @@ sub nice_mesh{
|
||||||
|
|
||||||
$out->{string}.=sprintf " t=%s (%+4d) rel=%s beacon=%s",
|
$out->{string}.=sprintf " t=%s (%+4d) rel=%s beacon=%s",
|
||||||
strftime("%Y-%m-%d %H:%M:%S",gmtime $out->{time}),
|
strftime("%Y-%m-%d %H:%M:%S",gmtime $out->{time}),
|
||||||
$out->{time}-(Time::HiRes::time+3600),
|
$out->{time}-(Time::HiRes::time+$timediff),
|
||||||
$out->{release},
|
$out->{release},
|
||||||
resolvebeacon($out->{beacon});
|
resolvebeacon($out->{beacon});
|
||||||
}elsif($type eq "i"){
|
}elsif($type eq "i"){
|
||||||
|
|
|
@ -61,7 +61,7 @@ while(1){
|
||||||
$p->{generation},
|
$p->{generation},
|
||||||
$p->{release},
|
$p->{release},
|
||||||
strftime("%Y-%m-%d %H:%M:%S",gmtime $p->{time}),
|
strftime("%Y-%m-%d %H:%M:%S",gmtime $p->{time}),
|
||||||
$p->{time}-(time+3600),
|
$p->{time}-(time+$r0ket::timediff),
|
||||||
r0ket::getbeacon($p->{beacon})
|
r0ket::getbeacon($p->{beacon})
|
||||||
);
|
);
|
||||||
$win->refresh;
|
$win->refresh;
|
||||||
|
|
|
@ -186,7 +186,7 @@ if($cmd =~ /^r/){
|
||||||
if($scmd eq "t"){
|
if($scmd eq "t"){
|
||||||
$pkt.="T";
|
$pkt.="T";
|
||||||
$pkt.=chr(shift); #gen
|
$pkt.=chr(shift); #gen
|
||||||
$pkt.=pack("N",scalar(time)+2*60*60);
|
$pkt.=pack("N",scalar(time)+$r0ket::timediff);
|
||||||
|
|
||||||
$pkt.=pack("N",0);
|
$pkt.=pack("N",0);
|
||||||
$pkt.=pack("N",0);
|
$pkt.=pack("N",0);
|
||||||
|
@ -197,7 +197,7 @@ if($cmd =~ /^r/){
|
||||||
}elsif($scmd eq "a"){
|
}elsif($scmd eq "a"){
|
||||||
$pkt.="A";
|
$pkt.="A";
|
||||||
$pkt.=chr(shift); #gen
|
$pkt.=chr(shift); #gen
|
||||||
$pkt.=pack("N",scalar(time)+1*60*60+ 300);
|
$pkt.=pack("N",scalar(time)+$r0ket::timediff+ 300);
|
||||||
|
|
||||||
$pkt.= pack("C",shift||0);
|
$pkt.= pack("C",shift||0);
|
||||||
$pkt.= pack("C",0);
|
$pkt.= pack("C",0);
|
||||||
|
@ -212,7 +212,7 @@ if($cmd =~ /^r/){
|
||||||
}elsif($scmd eq "b"){
|
}elsif($scmd eq "b"){
|
||||||
$pkt.="B";
|
$pkt.="B";
|
||||||
$pkt.=chr(shift); #gen
|
$pkt.=chr(shift); #gen
|
||||||
$pkt.=pack("N",scalar(time)+1*60*60+ 600);
|
$pkt.=pack("N",scalar(time)+$r0ket::timediff+ 600);
|
||||||
|
|
||||||
$pkt.= pack("C",shift||0);
|
$pkt.= pack("C",shift||0);
|
||||||
$pkt.= pack("C",0);
|
$pkt.= pack("C",0);
|
||||||
|
@ -227,7 +227,7 @@ if($cmd =~ /^r/){
|
||||||
}elsif($scmd eq "c"){
|
}elsif($scmd eq "c"){
|
||||||
$pkt.="\x1";
|
$pkt.="\x1";
|
||||||
$pkt.=chr(shift); #gen
|
$pkt.=chr(shift); #gen
|
||||||
$pkt.=pack("N",scalar(time)+1*60*60+ 600);
|
$pkt.=pack("N",scalar(time)+$r0ket::timediff+ 600);
|
||||||
|
|
||||||
$pkt.= pack("C",shift||0);
|
$pkt.= pack("C",shift||0);
|
||||||
$pkt.= pack("C",0);
|
$pkt.= pack("C",0);
|
||||||
|
|
Loading…
Reference in New Issue