Skip Menu |

This queue is for tickets about the Net-GPSD3 CPAN distribution.

Report information
The Basics
Id: 73489
Status: resolved
Worked: 1.5 hours (90 min)
Priority: 0/
Queue: Net-GPSD3

People
Owner: MRDVT [...] cpan.org
Requestors: MRDVT [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.17
Fixed in: 0.18



Subject: GPSD POLL Class over the wire API changed
The new GPSD API changed the POLL class format. {"class":"POLL","time":"2011-12-27T04:12:58.157Z","active":0,"tpv":[],"gst":[],"sky":[]} This was reported by Ryan Press at presslab.us
Ryan, I see that the POLL API has changed and was not backwards compatible. I do remember seeing this on the email list but never got around to implementing. {"class":"POLL","time":"2011-12-27T04:12:58.157Z","active":0,"tpv":[],"gst":[],"sky":[]} So, "fixes" is now "tpv", "skyviews" is now "sky". I should update the Perl lib to support either version. "tpv" || "fixes" "sky" || "skyviews" then make the old methods deprecated aliases for the new ones. Do you know how to do this? I don't have a spare GPS receiver at the moment so I'm hesitant to go changing things without a way to test. I also need to review all of the datetime fields as the API changed the "time" value format from epoch to W3C in different objects over different versions without changing the key name. I don't have a list of which classes switched from epoch to W3C in which versions but they were not all done in a single version. I've been thinking about just incrementing the version and forgetting about backwards compatibility in the Perl library but that's just not very Perl-ish. I've logged this as RT 73489. https://rt.cpan.org/Ticket/Display.html?id=73489 Thanks, Mike mrdvt92
Ryan, This patch should get you going. Let me know how it works for you. Mike $ svn diff lib/ Index: lib/Net/GPSD3/Return/POLL.pm =================================================================== --- lib/Net/GPSD3/Return/POLL.pm (revision 1380) +++ lib/Net/GPSD3/Return/POLL.pm (working copy) @@ -80,6 +80,7 @@ sub _fixes { my $self=shift; + $self->{"fixes"}=delete($self->{"tpv"}) if exists $self->{"tpv"}; #RT 73489 $self->{"fixes"}=[] unless ref($self->{"fixes"}) eq "ARRAY"; return wantarray ? @{$self->{"fixes"}} : $self->{"fixes"}; } @@ -116,6 +117,7 @@ sub _skyviews { my $self=shift; + $self->{"skyviews"}=delete($self->{"sky"}) if exists $self->{"sky"}; #RT 73489 $self->{"skyviews"}=[] unless ref($self->{"skyviews"}) eq "ARRAY"; return wantarray ? @{$self->{"skyviews"}} : $self->{"skyviews"}; }