Net::GPSD3::Return::DEVICES - Net::GPSD3 Return DEVICES Object


Net-GPSD3 documentation Contained in the Net-GPSD3 distribution.

Index


Code Index:

NAME

Top

Net::GPSD3::Return::DEVICES - Net::GPSD3 Return DEVICES Object

SYNOPSIS

Top

DESCRIPTION

Top

Provides a Perl object interface to the DEVICE object returned by the GPSD daemon.

METHODS

Top

class

Returns the object class

string

Returns the JSON string

parent

Return the parent Net::GPSD object

devices

Returns a list of device data structures.

  my @device=$devices->devices; #({},...)
  my @device=$devices->devices; #[{},...]

Devices

Returns a list of Net::GPSD3::Return::DEVICES objects.

  my @device=$devices->Devices; #(bless{},...)
  my @device=$devices->Devices; #[bless{},...]

BUGS

Top

Log on RT and Send to gpsd-dev email list

SUPPORT

Top

DavisNetworks.com supports all Perl applications including this package.

Try gpsd-dev email list

AUTHOR

Top

  Michael R. Davis
  CPAN ID: MRDVT
  STOP, LLC
  domain=>michaelrdavis,tld=>com,account=>perl
  http://www.stopllc.com/

COPYRIGHT

Top

SEE ALSO

Top

Net::GPSD3, Net::GPSD3::Return::Unknown


Net-GPSD3 documentation Contained in the Net-GPSD3 distribution.
package Net::GPSD3::Return::DEVICES;
use strict;
use warnings;
use base qw{Net::GPSD3::Return::Unknown};

our $VERSION='0.12';

sub devices {
  my $self=shift;
  $self->{"devices"}=[] unless ref($self->{"devices"}) eq "ARRAY";
  return wantarray ? @{$self->{"devices"}} : $self->{"devices"};
}

sub Devices {
  my $self=shift;
  unless (defined $self->{"Devices"}) {
    $self->{"Devices"}=[
      map {$self->parent->constructor(%$_, string=>$self->parent->encode($_))}
        grep {ref($_) eq "HASH"} $self->devices];
  }
  return wantarray ? @{$self->{"Devices"}} : $self->{"Devices"};
}

1;