| 1 | package Net::GPSD3::Return::DEVICES; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use base qw{Net::GPSD3::Return::Unknown}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | our $VERSION='0.12'; | |||||||||
| 7 | |||||||||||
| 8 | =head1 NAME | ||||||||||
| 9 | |||||||||||
| 10 | Net::GPSD3::Return::DEVICES - Net::GPSD3 Return DEVICES Object | ||||||||||
| 11 | |||||||||||
| 12 | =head1 SYNOPSIS | ||||||||||
| 13 | |||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||
| 15 | |||||||||||
| 16 | Provides a Perl object interface to the DEVICE object returned by the GPSD daemon. | ||||||||||
| 17 | |||||||||||
| 18 | =head1 METHODS | ||||||||||
| 19 | |||||||||||
| 20 | =head2 class | ||||||||||
| 21 | |||||||||||
| 22 | Returns the object class | ||||||||||
| 23 | |||||||||||
| 24 | =head2 string | ||||||||||
| 25 | |||||||||||
| 26 | Returns the JSON string | ||||||||||
| 27 | |||||||||||
| 28 | =head2 parent | ||||||||||
| 29 | |||||||||||
| 30 | Return the parent Net::GPSD object | ||||||||||
| 31 | |||||||||||
| 32 | =head2 devices | ||||||||||
| 33 | |||||||||||
| 34 | Returns a list of device data structures. | ||||||||||
| 35 | |||||||||||
| 36 | my @device=$devices->devices; #({},...) | ||||||||||
| 37 | my @device=$devices->devices; #[{},...] | ||||||||||
| 38 | |||||||||||
| 39 | =cut | ||||||||||
| 40 | |||||||||||
| 41 | 3 | ▶ | sub devices { | ||||||||
|
Subroutine
devices: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 42 | 3 | my $self=shift; | |||||||||
| 43 | 3 | ▶ | $self->{"devices"}=[] unless ref($self->{"devices"}) eq "ARRAY"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 44 | 3 | ▶ | return wantarray ? @{$self->{"devices"}} : $self->{"devices"}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | =head2 Devices | ||||||||||
| 48 | |||||||||||
| 49 | Returns a list of L<Net::GPSD3::Return::DEVICES> objects. | ||||||||||
| 50 | |||||||||||
| 51 | my @device=$devices->Devices; #(bless{},...) | ||||||||||
| 52 | my @device=$devices->Devices; #[bless{},...] | ||||||||||
| 53 | |||||||||||
| 54 | =cut | ||||||||||
| 55 | |||||||||||
| 56 | 2 | ▶ | sub Devices { | ||||||||
|
Subroutine
Devices: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 57 | 2 | my $self=shift; | |||||||||
| 58 | 2 | ▶ | unless (defined $self->{"Devices"}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 59 | $self->{"Devices"}=[ | ||||||||||
| 60 | 1 | map {$self->parent->constructor(%$_, string=>$self->parent->encode($_))} | |||||||||
| 61 | 1 | grep {ref($_) eq "HASH"} $self->devices]; | |||||||||
| 62 | } | ||||||||||
| 63 | 2 | ▶ | return wantarray ? @{$self->{"Devices"}} : $self->{"Devices"}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 64 | } | ||||||||||
| 65 | |||||||||||
| 66 | =head1 BUGS | ||||||||||
| 67 | |||||||||||
| 68 | Log on RT and Send to gpsd-dev email list | ||||||||||
| 69 | |||||||||||
| 70 | =head1 SUPPORT | ||||||||||
| 71 | |||||||||||
| 72 | DavisNetworks.com supports all Perl applications including this package. | ||||||||||
| 73 | |||||||||||
| 74 | Try gpsd-dev email list | ||||||||||
| 75 | |||||||||||
| 76 | =head1 AUTHOR | ||||||||||
| 77 | |||||||||||
| 78 | Michael R. Davis | ||||||||||
| 79 | CPAN ID: MRDVT | ||||||||||
| 80 | STOP, LLC | ||||||||||
| 81 | domain=>michaelrdavis,tld=>com,account=>perl | ||||||||||
| 82 | http://www.stopllc.com/ | ||||||||||
| 83 | |||||||||||
| 84 | =head1 COPYRIGHT | ||||||||||
| 85 | |||||||||||
| 86 | This program is free software licensed under the... | ||||||||||
| 87 | |||||||||||
| 88 | The BSD License | ||||||||||
| 89 | |||||||||||
| 90 | The full text of the license can be found in the LICENSE file included with this module. | ||||||||||
| 91 | |||||||||||
| 92 | =head1 SEE ALSO | ||||||||||
| 93 | |||||||||||
| 94 | L<Net::GPSD3>, L<Net::GPSD3::Return::Unknown> | ||||||||||
| 95 | |||||||||||
| 96 | =cut | ||||||||||
| 97 | |||||||||||
| 98 | 2 | 1; | |||||||||