Initial commit
[android-adb.git] / lib / Android / ADB / Device.pm
CommitLineData
9d265fd6
MG
1package Android::ADB::Device;
2
3use 5.014000;
4use strict;
5use warnings;
6
7use parent qw/Class::Accessor::Fast/;
8
9our $VERSION = '0.001';
10
11sub new {
12 my ($class, $serial, $state, @attrs) = @_;
13 my %attrs = map { split ':', $_, 2 } @attrs;
14 bless { serial => $serial, state => $state, %attrs }, $class
15}
16
17__PACKAGE__->mk_ro_accessors(qw/serial state usb product model device/);
18
191;
20__END__
21
22=encoding utf-8
23
24=head1 NAME
25
26Android::ADB::Device - information about an Android device
27
28=head1 SYNOPSIS
29
30 use Android::ADB;
31 my @devices = $adb->devices;
32 say $devices[0]->serial;
33 say $devices[0]->state; # e.g. offline, bootloader, sideload, or device
34
35 # The available attributes depend on your device
36 say $devices[0]->usb; # e.g. 2-1
37 say $devices[0]->product; # e.g. angler
38 say $devices[0]->model; # e.g. MI_MAX
39 say $devices[0]->device; # e.g. angler
40
41=head1 DESCRIPTION
42
43Information about an Android device in form of a blessed hash with a
44few accessors. See SYNPOSIS for a list of accessors.
45
46=head1 SEE ALSO
47
48L<Android::ADB>
49
50=head1 AUTHOR
51
52Marius Gavrilescu, E<lt>marius@ieval.roE<gt>
53
54=head1 COPYRIGHT AND LICENSE
55
56Copyright (C) 2017 by Marius Gavrilescu
57
58This library is free software; you can redistribute it and/or modify
59it under the same terms as Perl itself, either Perl version 5.24.2 or,
60at your option, any later version of Perl 5 you may have available.
61
62
63=cut
This page took 0.012349 seconds and 4 git commands to generate.